Create a contact

POST
/api/v1/orgs/{orgId}/contacts

Creates a contact. Requires at least one email or phone. Phones must be E.164.

An email or phone already used by another contact in the organization returns 409 with details.existingContactId; get or update that contact instead.

tags are labels, created in the organization catalog when missing. If tagging fails after the contact is saved, the request returns 500 and the contact exists without those tags; retrying the create returns the 409 above, then set tags with PATCH.

Requires the api_contacts_create scope.

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token using a Clai API key secret (clai_live_*).

In: header

Path Parameters

NameTypeDescription
orgId
required
string

Organization ID the key is operating in

Header Parameters

NameTypeDescription
Idempotency-Key
required
string

Required. Replays return the created contact.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
fullName
required
string
Length1 <= length <= 200
emailsarray<object>
Default[]
value
required
string
labelstring
Allowed"personal""work"
phonesarray<object>
Default[]
value
required
string
labelstring
Allowed"personal""work"
addressesarray<object>
Default[]
placeIdstring | null
DefaultnullLength1 <= length
formattedstring
Default""Lengthlength <= 500
componentsobject
Default{"line1":"","line2":"","city":"","region":"","postalCode":"","country":""}
line1string
Default""Lengthlength <= 200
line2string
Default""Lengthlength <= 200
citystring
Default""Lengthlength <= 120
regionstring
Default""Lengthlength <= 120
postalCodestring
Default""Lengthlength <= 40
countrystring
Default""Lengthlength <= 120
labelstring
Allowed"personal""work"
companiesarray<object>
Default[]
name
required
string
Length1 <= length <= 200
rolestring
Length1 <= length <= 120
linksarray<object>
Default[]
value
required
string
Length1 <= length
labelstring
Allowed"personal""work"
tagsarray<string>
Itemsitems <= 20

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://app.goclai.com/api/v1/orgs/org_2abc123/contacts" \  -H "Idempotency-Key: b9a4d3c2-2f1e-4c5a-8e7d-1a2b3c4d5e6f" \  -H "Content-Type: application/json" \  -d '{    "fullName": "string"  }'
{
  "contactId": "b5ec5d98-4bee-4da1-ad24-dde86346cb1d",
  "fullName": "string",
  "email": "string",
  "phone": "string",
  "emails": [
    {
      "value": "string",
      "label": "personal"
    }
  ],
  "phones": [
    {
      "value": "string",
      "label": "personal"
    }
  ],
  "addresses": [
    {
      "placeId": "string",
      "formatted": "string",
      "components": {
        "line1": "string",
        "line2": "string",
        "city": "string",
        "region": "string",
        "postalCode": "string",
        "country": "string"
      },
      "label": "personal"
    }
  ],
  "companies": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "role": "string"
    }
  ],
  "links": [
    {
      "value": "string",
      "label": "personal"
    }
  ],
  "tags": [
    "string"
  ],
  "dealActivity": "active",
  "dealsCount": 0,
  "lastActivityAt": "string",
  "firstSeenAt": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "linked": true,
  "contactUrl": "string"
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}