Linking Contacts with a Deal

POST https://app.alaaqat.com/api/deals/{_id}/attach-contacts

Where _id is the deal's identifier.

Relationship between Deal and Contact

contact_ids is an array used to link contacts in deals.

Header

Accept: application/json

Body

internal_name : value

{
  "contact_ids": [
    "6505bfaca1b58a446e0ccd03"
  ]
}

Response

The return type will always be Deal.

{
    "data": {
        "properties": {
            "_id": "66552c5bf8309b0cae098994",
            "deal_name": "test",
            "amount": 50,
            "deal_stage": "closed_lost",
            "updated_at": "2024-05-28T01:22:05.561000Z",
            "created_at": "2024-05-28T00:59:07.325000Z",
            "close_date": "2024-04-30T21:00:00.000000Z",
            "forcast_amount": 20,
            "next_steps": "test",
            "forecast_amount": 20
        },
        "contacts": [
            {
                "_id": "6505bfaca1b58a446e0ccd03",
                "account_id": 1,
                "firstname": "Shamaseen",
                "lastname": "Mohammad"
            },
            {
                "_id": "66036296905a0cb19b08bd75",
                "account_id": 1,
                "firstname": "Ammar",
                "lastname": "Alhasanat"
            }
        ]
    },
    "message": "Entity was modified Successfully"
}


Unlinking a Contact from a Deal


POST https://app.alaaqat.com/api/deals/{_id}/detach-contact

Where _id is the deal's identifier.

Header

Accept: application/json

Body

internal_name : value

{
  "contact_id":"65cb6719ae87531d6c045873"
}

Response

The return type will always be Deal.

{
    "data": {
        "properties": {
            "_id": "66552c5bf8309b0cae098994",
            "deal_name": "test",
            "amount": 50,
            "deal_stage": "closed_lost",
            "updated_at": "2024-05-28T01:22:05.561000Z",
            "created_at": "2024-05-28T00:59:07.325000Z",
            "close_date": "2024-04-30T21:00:00.000000Z",
            "forcast_amount": 20,
            "next_steps": "test",
            "forecast_amount": 20
        },
        "contacts": [
            {
                "_id": "66036296905a0cb19b08bd75",
                "account_id": 1,
                "firstname": "Ammar",
                "lastname": "Alhasanat",
                "gender": "male",
                "preferred_language": "en",
                "timezone": 3,
                "channels": [
                    {
                        "platform_third_party_id": "105587665642391",
                        "contact_third_party_id": "7032577303535589",
                        "created_at": {
                            "$date": {
                                "$numberLong": "1711497878830"
                            }
                        }
                    }
                ],
                "relation_stage": "lead",
                "original_source": "facebook",
                "original_source_drill_down_1": "conversations",
                "created_by": 0,
                "first_received_message_at": "2024-03-27T00:04:38.830000Z",
                "last_received_message_at": "2024-05-23T21:58:25.943000Z",
                "whatsapp_number": null,
                "updated_at": "2024-05-23T21:58:25.948000Z",
                "created_at": "2024-03-27T00:04:38.833000Z",
                "image": "https:\/\/app.alaaqat.com\/files\/accounts\/1\/accounts\/1\/contacts\/66036296905a0cb19b08bd75\/image.jpeg",
                "first_facebook_message_received_at": "2024-03-27T00:04:38.360000Z",
                "last_facebook_message_received_at": "2024-03-27T00:04:38.360000Z",
                "deal_ids": [
                    "66552c5bf8309b0cae098994"
                ]
            }
        ]
    },
    "message": "Entity was modified Successfully"
}