Create a Contact

Use this endpoint to create and save a new contact in Engage.

Endpoint and Methods

POST /_rest/v2/contacts

Body

Required fields:

  • contactInfo

  • phone

Optional fields:

  • Other contact fields can also be added under "metadata" (e.g., firstname, email)

Sample Request

Copy
{
  “contactInfo”:
[
 {
   “phone”: “1231231234”,
   “metadata”: {
     “Firstname”: “Abby”,
     “Lastname”: “Normal”,
     “email”: “Abbynormal@mail.com”
   }
 }
]
}

Sample Responses

Code 201 Response

Response code 201 returns the new contact Id(s) for successfully created contact(s).

Copy
[
  {
    "location": "US",
    "_id": "5f8618c60340af3d06a56a24",
    "phone": "1231231234",
    "metadata": {
      "firstname": "Abby",
      "lastname": "Normal",
      "email": "Anormal@mail.com",
      "phone": "1231231234"
    },
    "listId": "7ec42fa6cced218bba350cef00216c5dac58ded8",
    "timezone": null,
    "deleteFlag": false,
    "createdDate": "2020-10-13T21:14:46.970Z",
    "createdBy": "ejerez",
    "customerId": "1006568"
  }
]

Code 401 Response

Response code 401 returns an error that the authorization token is invalid.

Code 422 Response

Response code 422 returns a message that the phone field is not valid.

Code 500 Response

Response code 500 returns an error during contact creation.