Sign inGet started

Create a contact

POST
/workspaces/{workspaceId}/contacts
The contact creation endpoint allows adding a new contact with multiple identifiers, attributes, and lists, specifying their details and associations during the creation process.
Cuerpo de la solicitud
displayName
string
obligatorio
The display name for the contact.
identifiers
array of object
Mostrar parámetros secundarios
identifiers.key
string
obligatorio
The identifier key.
identifiers.value
string
obligatorio
The identifier value.
identifiers.properties
object
Object with key-value pairs, where the key is up to 64 characters, only letters and digits. This can be used to store additional information about the identifier.
accountIds
array of string
The list of account ids for the contact.
listIds
array of string
The list of list ids for the contact.
companyRefs
array of string
The list of company references for the contact.
attributes
object
A map of key-value pairs, where the values are boolean, number, or string, or a non-empty array of those, or null
Cuerpo de la respuesta
accountIds
array of string
The list of account ids for the contact.
attributes
object
A map of key-value pairs, where the values are boolean, number, or string, or a non-empty array of those, or null
companyRefs
array of string
The list of company references for the contact.
computedDisplayName
string
The computed display name for the contact. It can be derived, in the following order if available, from the displayName attribute, the firstName attribute, the emailaddress identifier, or the phonenumber identifier.
createdAt
string
obligatorio
featuredIdentifiers
array of object
The list of identifiers for the contact.
Mostrar atributos secundarios
featuredIdentifiers.key
string
obligatorio
The identifier key. This can be from your custom identifier key or one of the built-in keys.
featuredIdentifiers.value
string
obligatorio
The identifier value. This represents the actual value for the identifier.
id
string
obligatorio
The unique identifier for the contact.
identifierCount
integer
The number of identifiers for the contact.
isAnonymous
boolean
Whether the contact is anonymous. A contact is anonymous if it has no identifiers, or only has visitorid identifiers.
listIds
array of string
The list of list ids for the contact.
updatedAt
string
obligatorio
workspaceId
string
Your workspace identifier.
Ejemplo de código
curl -X POST 'https://api.bird.com/workspaces/{workspaceId}/contacts' \
  -H 'Authorization: AccessKey YOUR_ACCESS_KEY'

Examples

Let's establish some of our data that will be used in the following examples:
  • Workspace ID: a1405560-c8d3-4b1a-877d-3f449ad95352
  • AccessKey: abcd

Create a contact with identifiers

In this example, we're creating a contact providing identifiers. To know more about identifiers, please refer to this documentation.
Ejemplo de código
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/contacts" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "identifiers": [
    {
      "key": "emailaddress",
      "value": "contacts@bird.com"
    }
  ],
  "displayName": "John Doe"
}'

Create a contact with attributes

In this example, we're creating a contact providing attributes. To know more about attributes, please refer to this documentation.
Ejemplo de código
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/contacts" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "displayName": "John Doe",
  "attributes": {
    "firstName": "John",
    "lastName": "Doe"
  }
}'

Create a contact with lists

In this example, we're creating a contact providing list IDs. To knoe more about lists, please refer to this documentation.
Ejemplo de código
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/contacts" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "displayName": "John Doe",
  "listIds": ["12bd0e40-9361-4e32-8b26-99b4ab7eae09"]
}'

Create a contact with providing all the details

In this example, we're creating a contact providing all the examples above.
Ejemplo de código
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/contacts" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "displayName": "John Doe",
  "listIds": ["12bd0e40-9361-4e32-8b26-99b4ab7eae09"],
  "identifiers": [
    {
      "key": "emailaddress",
      "value": "contacts+2@bird.com"
    }
  ],
  "attributes": {
    "firstName": "John",
    "lastName": "Doe"
  }
}'