Examples
Let's establish some of our data that will be used in the following examples:
Workspace ID : a1405560-c8d3-4b1a-877d-3f449ad95352
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 .
Request Response (200 - OK)
Copy 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"
}'
Copy {
"id" : "12bd0e40-9361-4e32-8b26-99b4ab7eae09" ,
"computedDisplayName" : "John Doe" ,
"featuredIdentifiers" : [
{
"key" : "emailaddress" ,
"value" : "contacts@bird.com"
}
] ,
"identifierCount" : 1 ,
"attributes" : {
"displayName" : "John Doe" ,
"emailaddress" : [
"contacts@bird.com"
] ,
"initialReference" : "028d45dd-8e3f-43bb-8aa5-9d6833f08945" ,
"timezone" : "America/Sao_Paulo"
} ,
"createdAt" : "2024-11-26T15:00:00.000Z" ,
"updatedAt" : "2024-11-26T15:00:00.000Z"
}
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 .
Request Response (200 - OK)
Copy 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"
}
}'
Copy {
"id" : "12bd0e40-9361-4e32-8b26-99b4ab7eae09" ,
"computedDisplayName" : "John" ,
"identifierCount" : 0 ,
"attributes" : {
"firstName" : "John" ,
"initialReference" : "32d6f4f9-7e9c-4271-bd83-9d6976808f2f" ,
"lastName" : "Doe" ,
"timezone" : "America/Sao_Paulo"
} ,
"createdAt" : "2024-11-26T15:00:00.000Z" ,
"updatedAt" : "2024-11-26T15:00:00.000Z"
}
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 .
Request Response (200 - OK)
Copy 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"]
}'
Copy {
"id" : "12bd0e40-9361-4e32-8b26-99b4ab7eae09" ,
"computedDisplayName" : "" ,
"identifierCount" : 0 ,
"attributes" : {
"initialReference" : "32d6f4f9-7e9c-4271-bd83-9d6976808f2f" ,
"timezone" : "America/Sao_Paulo"
} ,
"listIds" : [
"12bd0e40-9361-4e32-8b26-99b4ab7eae09"
] ,
"createdAt" : "2024-11-26T15:00:00.000Z" ,
"updatedAt" : "2024-11-26T15:00:00.000Z"
}
Create a contact with providing all the details
In this example, we're creating a contact providing all the examples above.
Request Response (200 - OK)
Copy 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"
}
}'
Copy {
"id" : "12bd0e40-9361-4e32-8b26-99b4ab7eae09" ,
"computedDisplayName" : "John" ,
"featuredIdentifiers" : [
{
"key" : "emailaddress" ,
"value" : "contacts@bird.com"
}
] ,
"identifierCount" : 1 ,
"attributes" : {
"emailaddress" : [
"contacts@bird.com"
] ,
"firstName" : "John" ,
"initialReference" : "32d6f4f9-7e9c-4271-bd83-9d6976808f2f" ,
"lastName" : "Doe" ,
"timezone" : "America/Sao_Paulo"
} ,
"listIds" : [
"12bd0e40-9361-4e32-8b26-99b4ab7eae09"
] ,
"createdAt" : "2024-11-26T15:00:00.000Z" ,
"updatedAt" : "2024-11-26T15:00:00.000Z"
}