Create a customer
Create a customer in Proto from your own system, using your own ID for them.
Deprecated: v1 is an older version of this request. Use v2 for new integrations.
Creates a customer in People in Proto, with your own ID for them – such as their CRM number. Not sure how to send a request? See Make your first request.
Request
Send a POST request to:
https://v3-api.proto.cx/api/platform/v1/customers/YOUR_TEAMSPACE_ID/create-customer/YOUR_CUSTOMER_ID/v2
Send a PUT request to:
https://v3-api.proto.cx/api/platform/v1/customers/YOUR_TEAMSPACE_ID/create-customer/YOUR_CUSTOMER_ID
In the body, send the details you have – every field is optional, so leave out any you don’t need. In the address and the body, replace anything starting with YOUR_ with your own – YOUR_CUSTOMER_ID is your ID for the customer, such as their CRM number:
{
"name": "Amara Okafor",
"email": "amara.okafor@example.com",
"phone_number": "+2348031234567",
"location": "Lagos, Nigeria",
"avatar": "https://example.com/amara.png",
"external_customer_id": "2348031234567",
"tag_ids": ["YOUR_TAG_ID"],
"tag_group_ids": ["YOUR_TAG_GROUP_ID"]
}
{
"name": "Amara Okafor",
"email": "amara.okafor@example.com",
"phone_number": "+2348031234567",
"location": "Lagos, Nigeria",
"avatar": "https://example.com/amara.png",
"external_customer_id": "2348031234567"
}
| Field | Required | What it is |
|---|---|---|
name | No | Their name |
email | No | Their email address |
phone_number | No | Their phone number, with the country code |
location | No | Where they are |
avatar | No | A web address for their picture |
external_customer_id | No | Their ID on a channel, such as their WhatsApp number |
tag_ids | No | IDs of tags to give them – v2 only. To tag by name instead, use Add tags to a customer. |
tag_group_ids | No | IDs of tag groups to give them – v2 only |
Response
Proto replies 200 OK with the new customer:
{
"id": "01JC8Z4M9W3T6Q2K7N5R1B8XHD",
"subcompany_id": "01HSWE652DMW6REJ1FB1135PRZ",
"provided_unique_id": "CRM-48213",
"external_customer_id": "2348031234567",
"name": "Amara Okafor",
"location": "Lagos, Nigeria",
"email": "amara.okafor@example.com",
"phone_number": "+2348031234567",
"avatar": "https://example.com/amara.png",
"tags": [
{ "id": "01HZ0QK3V7B2M8D4F6G9J1N5PR", "tag": "VIP", "color": "#16a34a" }
],
"tag_groups": [
{ "id": "01HZ0QM8C2D4F6H8K1N3Q5S7UW", "name": "Plan", "color": "#2563eb", "tags": [] }
]
}
Proto replies 200 OK with the customer, whether it created or updated them:
{
"id": "01JC8Z4M9W3T6Q2K7N5R1B8XHD",
"subcompany_id": "01HSWE652DMW6REJ1FB1135PRZ",
"provided_unique_id": "CRM-48213",
"external_customer_id": "2348031234567",
"name": "Amara Okafor",
"location": "Lagos, Nigeria",
"email": "amara.okafor@example.com",
"phone_number": "+2348031234567",
"avatar": "https://example.com/amara.png"
}
| Field | What it is |
|---|---|
id | Proto’s own ID for the customer, shown as Person ID |
subcompany_id | Your teamspace ID |
provided_unique_id | Your ID for the customer, shown as Unique ID |
external_customer_id | Their ID on a channel, shown as Channel ID |
tags | Their tags, each with its ID, name and colour – v2 only |
tag_groups | Their tag groups, each with its ID, name, colour and tags – v2 only |
The other fields are the details you sent. A detail you didn’t send is null.
Errors
| You get | What it means |
|---|---|
400 Customer already exists | Someone already has this ID. To change their details, use Update a customer. |
404 | A tag or tag group ID isn’t in your teamspace. |
422 | A field is empty or isn’t text, or avatar isn’t a web address. |
| You get | What it means |
|---|---|
422 | A field is empty or isn’t text. |
For errors any request can return, see If something goes wrong.