Create contact identifier
POST
/workspaces/{workspaceId}/contacts/{contactId}/identifiers
This endpoint is used to create a new identifier for a contact. The identifier will
be added to the contact and can be used for different purposes such as targeting, mapping, and more.
Treść żądania
key
string
wymagane
The identifier key.
value
string
wymagane
The identifier value.
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.
Treść odpowiedzi
contactId
string
wymagane
key
string
wymagane
value
string
wymagane
properties
object
createdAt
string
wymagane
Przykład kodu
curl -X POST 'https://api.bird.com/workspaces/{workspaceId}/contacts/{contactId}/identifiers' \
-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
- Contact ID: 12bd0e40-9361-4e32-8b26-99b4ab7eae09
Create an identifier without properties
In this example, we're creating an identifier without custom properties.
Przykład kodu
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/contacts/12bd0e40-9361-4e32-8b26-99b4ab7eae09/identifiers" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
"key": "emailaddress",
"value": "contacts@bird.com"
}'Przykład kodu
{
"contactId": "12bd0e40-9361-4e32-8b26-99b4ab7eae09",
"key": "emailaddress",
"value": "contacts@bird.com",
"properties": {
"isGmail": true
},
"createdAt": "2024-11-26T15:00:00.000Z"
}Create an identifier with properties
In this example, we're creating an identifier with custom properties.
Przykład kodu
curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/contacts/12bd0e40-9361-4e32-8b26-99b4ab7eae09/identifiers" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
"key": "emailaddress",
"value": "contacts@bird.com",
"properties": {
"isGmail": true
}
}'Przykład kodu
{
"contactId": "12bd0e40-9361-4e32-8b26-99b4ab7eae09",
"key": "emailaddress",
"value": "contacts@bird.com",
"properties": {
"isGmail": true
},
"createdAt": "2024-11-26T15:00:00.000Z"
}