Skip to main content
POST
/
api
/
contact
Create a new contact
curl --request POST \
  --url http://localhost:3000/api/contact \
  --header 'Content-Type: application/json' \
  --data '
{
  "primaryPhone": "+212612345678",
  "firstName": "John",
  "lastName": "Doe",
  "fullName": "John Doe",
  "primaryEmail": "john@example.com",
  "address": "123 Main St",
  "city": "Casablanca",
  "state": "Casablanca-Settat",
  "zip": "20000",
  "occupation": "Engineer",
  "preferredChannel": "phone",
  "customAttributes": {
    "age": 30,
    "interests": [
      "tech"
    ]
  }
}
'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organizationId": "123e4567-e89b-12d3-a456-426614174000",
  "primaryPhone": "+212612345678",
  "channels": [],
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-01T00:00:00.000Z",
  "firstName": "John",
  "lastName": "Doe",
  "fullName": "John Doe",
  "primaryEmail": "john@example.com",
  "address": "123 Main St",
  "city": "Casablanca",
  "state": "Casablanca-Settat",
  "zip": "20000",
  "occupation": "Engineer",
  "preferredChannel": "phone",
  "gender": "male"
}

Body

application/json
primaryPhone
string
required
Example:

"+212612345678"

firstName
string
Example:

"John"

lastName
string
Example:

"Doe"

fullName
string
Example:

"John Doe"

primaryEmail
string
Example:

"john@example.com"

address
string
Example:

"123 Main St"

city
string
Example:

"Casablanca"

state
string
Example:

"Casablanca-Settat"

zip
string
Example:

"20000"

occupation
string
Example:

"Engineer"

preferredChannel
string
Example:

"phone"

customAttributes
object
Example:
{ "age": 30, "interests": ["tech"] }

Response

Contact created successfully

id
string
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

organizationId
string
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

primaryPhone
string
required
Example:

"+212612345678"

channels
string[] | null
required
Example:
[]
createdAt
string<date-time>
required
Example:

"2024-01-01T00:00:00.000Z"

updatedAt
string<date-time>
required
Example:

"2024-01-01T00:00:00.000Z"

firstName
string | null
Example:

"John"

lastName
string | null
Example:

"Doe"

fullName
string | null
Example:

"John Doe"

primaryEmail
string | null
Example:

"john@example.com"

address
string | null
Example:

"123 Main St"

city
string | null
Example:

"Casablanca"

state
string | null
Example:

"Casablanca-Settat"

zip
string | null
Example:

"20000"

occupation
string | null
Example:

"Engineer"

preferredChannel
string | null
Example:

"phone"

gender
enum<string>
Available options:
male,
female