Skip to main content
Create a contact if the identifier does not exist, or update the existing contact when it does.
When a group ID or group identifier is passed in group, the upsert only creates or updates a contact with that identifier within that group. If a contact with the same identifier already exists in a different group, it is not updated.

Endpoint

POST https://app.sling.com.ng/api/v1/upsert-contact

Headers

HeaderValue
Acceptapplication/json
AuthorizationBearer {API_TOKEN}
Content-Typeapplication/json

Body parameters

identifier
string
required
Unique identifier for the contact. Used to match an existing record for update.
group
string
required
Group ID or group identifier to assign the contact to. Use 0 for standalone.
name
string
required
Contact name.
email
string
required
Contact email address.
phone
string
required
Contact phone number.

Example payload

{
  "identifier": "john-doe-001",
  "group": "vip-customers",
  "name": "John Doe",
  "email": "[email protected]",
  "phone": "08031234567"
}

Response

Success Response

Contacts endpoints return status: "success" when the operation completes. The details field indicates whether the contact was created or updated:
  • Contact created successfully
  • Contact updated successfully
{
  "status": "success",
  "details": "Contact updated successfully",
  "data": {
    "id": 159,
    "name": "HIIIII",
    "first_name": null,
    "last_name": null,
    "email": "[email protected]",
    "phone": "0903344",
    "identifier": "1234564",
    "description": "dddd1",
    "group": {
      "id": 1,
      "name": "Sling",
      "identifier": null,
      "description": null,
      "created_at": "2025-04-17T05:45:53.000000Z",
      "updated_at": "2025-04-17T23:11:56.000000Z"
    },
    "created_at": "2026-05-28T15:32:13.000000Z",
    "updated_at": "2026-05-28T15:32:24.000000Z"
  }
}