Create contacts for a chatbot

POST/v1/chatbots/{chatbotId}/contacts

Add one or more contacts with custom attributes to a chatbot with the legacy v1 API, for example to import people from your CRM.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Creates contacts for a chatbot in one call. Call it when you import people from your CRM or billing system so the chatbot knows who it is talking to.

Request

POST /v1/chatbots/{chatbotId}/contacts

Path parameters:

Name Type Required Description
chatbotId string Yes The ID of the chatbot, starting with agt_.

Body fields:

Name Type Required Description
contacts array Yes The contacts to create. Each item needs an email or a phone.

Fields of each item in contacts:

Name Type Required Description
email string No Email address. Required when phone is missing.
phone string No Phone number in international format. Required when email is missing.
name string No Full name.
attributes object No Custom attribute values keyed by attribute name. Every key must exist, see Create custom attribute.

You can also upload contacts as a CSV file in the dashboard, see Uploading contacts.

Example request

curl -X POST https://api.askocto.co/v1/chatbots/agt_8f3k2m/contacts \
  -H "Authorization: Bearer $OCTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contacts": [
      {
        "email": "maya@example.com",
        "name": "Maya Jensen",
        "attributes": { "plan": "pro" }
      }
    ]
  }'
const response = await fetch("https://api.askocto.co/v1/chatbots/agt_8f3k2m/contacts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.OCTO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    contacts: [
      { email: "maya@example.com", name: "Maya Jensen", attributes: { plan: "pro" } },
    ],
  }),
})

const { created, data } = await response.json()
console.log(`Created ${created} contacts`, data[0].id)

Example response

A successful call returns 201 Created.

{
  "created": 1,
  "data": [
    {
      "id": "con_4d7h2q",
      "chatbotId": "agt_8f3k2m",
      "name": "Maya Jensen",
      "email": "maya@example.com",
      "phone": null,
      "attributes": { "plan": "pro" },
      "createdAt": "2026-03-14T09:30:00Z",
      "updatedAt": "2026-03-14T09:30:00Z"
    }
  ]
}

Response fields

Name Type Description
created integer How many contacts were created.
data array The new contacts, in the order you sent them. Each has an id starting with con_.

Errors

Status Code When
400 invalid_request An item has neither email nor phone, or attributes uses a key that is not in the schema.
401 unauthorized The API key is missing, malformed or revoked.
404 not_found No chatbot with this ID exists in your workspace.
409 conflict A contact with the same email already exists for this chatbot.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

Something unclear or missing? Tell us and we will fix the page.