POST
/
contacts
/
create
curl --request POST \
  --url https://api.indiepitcher.com/v1/contacts/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "john@acme.com",
  "userId": "1234567",
  "avatarUrl": "https://example.com/avatar.jpg",
  "name": "John Doe",
  "languageCode": "en_US",
  "updateIfExists": true,
  "ignoreListSubscriptionsWhenUpdating": true,
  "subscribedToLists": [
    "onboarding",
    "newsletter"
  ],
  "customProperties": {
    "company": "Acme",
    "age": 35
  }
}'
{
  "success": true,
  "data": {
    "email": "john@acme.com",
    "userId": 123456,
    "name": "John Doe",
    "avatarUrl": "https://example.com/profile_pictures/123456",
    "languageCode": "en-US",
    "hardBouncedAt": "2024-04-23T18:25:43.511Z",
    "subscribedToLists": [
      "onboarding",
      "newsletter"
    ],
    "customProperties": {
      "company": "Acme",
      "age": 35
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
email
string

The email of the contact.

userId
string | null

The user id of the contact.

avatarUrl
string | null

The avatar url of the contact.

name
string | null

The full name of the contact.

languageCode
string | null

The language code of the contact.

updateIfExists
boolean | null

If a contact with the provided email already exists, update the contact with the new data.

ignoreListSubscriptionsWhenUpdating
boolean | null

Whether to ignore subscribedToLists field if the contact already exists and updateIfExists is set to true. Useful to avoid accidentally resubscribing a contact to lists they unsubscribed before. Default value is true.

subscribedToLists
string[]

The array of mailing lists the contact is subscribed to.

customProperties
object

The custom properties set for this contact.

Response

200 - application/json
A created or updated contact
success
boolean
data
object