Users & Data

Contacts API: sync your customers

Use the Contacts API to create, update, list, and delete contacts so your AI chatbot knows each customer's name, plan, and details. Endpoints and limits.

Contacts are the people your agent talks to. When a verified user chats (see Identity verification), Assistrio matches their userId to a contact's external_id and gives the agent that contact's name, email, phone, and attributes — like plan, company, or account status.

Tip

In the dashboard, Contacts › API (or Sync contacts from your system on an empty Contacts page) opens a ready-to-run cURL request with your agent ID filled in. See Contacts for adding contacts by hand or from a CSV file.

Base URL and auth

Base URL
https://api.assistrio.com/api/v1/agents/{agentId}/contacts
Authorization: Bearer ak_…

Endpoints

MethodPathDoes
GET/contacts?page=1&limit=50&q=List contacts, newest first. limit 1–200 (default 50); q searches name, email, phone, and external_id. Returns { contacts, total, page, limit }.
POST/contactsCreate or update up to 5,000 contacts. Returns { added, updated, skipped }.
GET/contacts/{externalId}Get one contact. Returns { contact }.
PATCH/contacts/{externalId}Update name, email, phone, or attributes. Returns { contact }.
DELETE/contacts/{externalId}Delete a contact. Returns { ok: true }.

Create or update contacts

cURL
curl -X POST https://api.assistrio.com/api/v1/agents/YOUR_AGENT_ID/contacts \
  -H "Authorization: Bearer $ASSISTRIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contacts": [
      {
        "external_id": "user_123",
        "name": "Ada Lovelace",
        "email": "ada@example.com",
        "phone": "+14155550100",
        "attributes": { "plan": "Pro", "company": "Analytical Engines" }
      }
    ]
  }'
Response
{
  "added": 1,
  "updated": 0,
  "skipped": []
}
  • A row with an external_id updates the contact with that external_id. A row without one updates the contact with the same email. Otherwise a new contact is added.
  • Each row needs at least a name, email, phone, or external_id. Rows that can't be saved come back in skipped as { row, error } (row counts from 1) — the rest are still saved.
  • You can also send a single contact object instead of { contacts: [...] }. externalId, user_id, and userId work as names for external_id, and custom_attributes for attributes.
  • Sending attributes replaces the contact's attributes instead of merging them — include every attribute you want to keep. This applies to PATCH too.
  • Attribute values are stored as strings (numbers are converted); empty values are dropped, and . or $ in a key becomes _.

Contact object

JSON
{
  "id": "…",
  "externalId": "user_123",
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "phone": "+14155550100",
  "attributes": { "plan": "Pro", "company": "Analytical Engines" },
  "source": "api",
  "lastSeenAt": "2026-11-01T10:24:00.000Z",
  "createdAt": "2026-10-12T08:00:00.000Z",
  "updatedAt": "2026-11-01T10:24:00.000Z"
}

Limits

LimitValue
Contacts per request5,000
Contacts per agent50,000
Attributes per contact30
Attribute key / value length40 / 500 characters (values are strings)
external_id / name / email / phone128 / 120 / 254 / 40 characters (email must be valid)
Rate limit300 requests per minute per API key

Errors

Errors return JSON with an error message, such as { "error": "That API key is wrong or was deleted." }. Statuses: 400 (invalid input or agent ID), 401 (missing or invalid key), 404 (agent not in this workspace, or contact not found), and 429 (rate limited — this one also includes "errorCode": "RATE_LIMITED"; wait a minute and retry).

Was this page helpful?

Need help? Contact support — we reply within one to two business days.