POST
/
v1
/
contacts
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

application/json
defaultFields
object
required
customFields
object[]
createdByUserId
string

The unique identifier of the user who created the contact.

source
string
default:
public-api

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.

Required string length: 1 - 72
externalId
string | null

An external identifier of the contact.

Required string length: 1 - 75

Response

201
application/json
Success
data
object
required

Was this page helpful?