Create a contact
Create a contact for a workspace.
curl --request POST \
--url https://api.openphone.com/v1/contacts \
--header 'Content-Type: application/json' \
--data '{
"defaultFields": {
"company": "OpenPhone",
"emails": [
{
"name": "company email",
"value": "[email protected]"
}
],
"firstName": "John",
"lastName": "Doe",
"phoneNumbers": [
{
"name": "company phone",
"value": "+12345678901"
}
],
"role": "Sales"
},
"customFields": [
{
"key": "inbound-lead",
"value": [
"option1",
"option2"
]
}
],
"createdByUserId": "US123abc",
"source": "public-api",
"externalId": "664d0db69fcac7cf2e6ec"
}'
{
"data": {
"id": "664d0db69fcac7cf2e6ec",
"externalId": "664d0db69fcac7cf2e6ec",
"source": "public-api",
"defaultFields": {
"company": "OpenPhone",
"emails": [
{
"name": "company email",
"value": "[email protected]",
"id": "acb123"
}
],
"firstName": "John",
"lastName": "Doe",
"phoneNumbers": [
{
"name": "company phone",
"value": "+12345678901",
"id": "acb123"
}
],
"role": "Sales"
},
"customFields": [
{
"name": "Inbound Lead",
"key": "inbound-lead",
"id": "66d0d87d534de8fd1c433cec3",
"type": "multi-select",
"value": [
"option1",
"option2"
]
}
],
"createdAt": "2022-01-01T00:00:00Z",
"updatedAt": "2022-01-01T00:00:00Z",
"createdByUserId": "US123abc"
}
}
Body
The contact's first name.
The contact's company name.
The contact's last name.
The contact's role.
The unique identifier of the user who created the contact.
The contact's source. Defaults to null
for contacts created in the UI. Defaults to public-api
for contacts created via the public API. Cannot be one of the following reserved words: openphone
, device
, csv
, other
or start with one of the following reserved prefixes: openphone
, csv
.
1 - 72
An external identifier of the contact.
1 - 75
Response
The unique identifier of the contact.
An external identifier of the contact.
1 - 75
Indicates how the contact was created or where it originated from.
1 - 75
The contact's company name.
The contact's first name.
The contact's last name.
The contact's role.
The name of the custom contact field. This name is set by users in the OpenPhone interface when the custom field is created.
multi-select
Value defined for the multi select type custom field.
The identifying key for contact custom field.
The unique identifier for the contact custom field.
Timestamp of contact creation in ISO 8601 format.
Timestamp of last contact update in ISO 8601 format.
The unique identifier of the user who created the contact.
Was this page helpful?
curl --request POST \
--url https://api.openphone.com/v1/contacts \
--header 'Content-Type: application/json' \
--data '{
"defaultFields": {
"company": "OpenPhone",
"emails": [
{
"name": "company email",
"value": "[email protected]"
}
],
"firstName": "John",
"lastName": "Doe",
"phoneNumbers": [
{
"name": "company phone",
"value": "+12345678901"
}
],
"role": "Sales"
},
"customFields": [
{
"key": "inbound-lead",
"value": [
"option1",
"option2"
]
}
],
"createdByUserId": "US123abc",
"source": "public-api",
"externalId": "664d0db69fcac7cf2e6ec"
}'
{
"data": {
"id": "664d0db69fcac7cf2e6ec",
"externalId": "664d0db69fcac7cf2e6ec",
"source": "public-api",
"defaultFields": {
"company": "OpenPhone",
"emails": [
{
"name": "company email",
"value": "[email protected]",
"id": "acb123"
}
],
"firstName": "John",
"lastName": "Doe",
"phoneNumbers": [
{
"name": "company phone",
"value": "+12345678901",
"id": "acb123"
}
],
"role": "Sales"
},
"customFields": [
{
"name": "Inbound Lead",
"key": "inbound-lead",
"id": "66d0d87d534de8fd1c433cec3",
"type": "multi-select",
"value": [
"option1",
"option2"
]
}
],
"createdAt": "2022-01-01T00:00:00Z",
"updatedAt": "2022-01-01T00:00:00Z",
"createdByUserId": "US123abc"
}
}