Create Conversation

Open a conversation with a contact in one inbox, optionally sending the first message in the same call. A first message runs the same side effects as the in-app composer, including outbound delivery. With a personal key it is attributed to the key's owner; with a workspace key it appears as Robô, as described under Send Message. When the contact already has a conversation in progress in that inbox, the call is refused with 409 and code: active_conversation_exists, and the blocking conversation is returned so it can be reused; conversations in the contact's other inboxes do not block. A teamId must name a team that serves the inbox — one with a member who is also a member of the inbox — or the call is refused with 400 and code: team_not_in_inbox; the conversation then stays on that team and is assigned to a member of both. An inboxId or contactId that is not the workspace's is answered 404. The key needs chat_conversations.create, and chat_messages.send as well when a first message is sent. A personal key starts the conversation as its owner, with the owner's own checks in the app: their role must allow starting conversations (disableChatConversationCreate), sending messages when a first message goes out (disableChatMessageSend), and assigning when a teamId or an assigneeId other than the owner is named (disableChatConversationAssign); the first message follows the inbox's signature rule as the owner's would. A personal key acts as its owner and never does more than they can in the app, right now: the owner's role, and for a conversation the owner's inboxes, teams and conversation access, decide. A refusal is 403 with details.code API_KEY_OWNER_PERMISSION_DENIED, naming the key permission and the part of the role that withholds it. A workspace key acts as Robô for the whole workspace and is held to no person's access. Every operation is scoped by the required workspaceId. A workspace-scoped API key that names any other workspace is refused with 403 before any query runs, so a workspace key can only ever reach its own workspace.

POST/api/v1/chat/conversations
X-API-Key<token>

Your Studio API key, personal or workspace-scoped. Generate one under Settings, then API Keys. Operations that reject workspace keys say so in their own description.

In: header

Request Body

application/json

Inbox, contact, initial routing, and an optional first message.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://agent-studio.seeyu.ai/api/v1/chat/conversations" \  -H "X-API-Key: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "workspaceId": "string",    "inboxId": "string",    "contactId": "string"  }'
{
  "conversation": {
    "id": "conv_01J9M4Q0X6R7",
    "workspaceId": "ws_01J8F2K3N5P7",
    "inboxId": "inb_01J8F2K3N5P8",
    "contactId": "cnt_01J8F2K3N5P9",
    "assigneeId": "usr_01J8F2K3N5PA",
    "teamId": null,
    "status": "open",
    "priority": "high",
    "lastActivityAt": "2026-08-28T14:22:05.000Z",
    "createdAt": "2026-08-27T09:10:44.000Z",
    "contact": {
      "id": "cnt_01J8F2K3N5P9",
      "name": "Ana Ribeiro",
      "email": "ana@example.com",
      "phone": "+5511987654321",
      "avatarUrl": null
    },
    "inbox": {
      "id": "inb_01J8F2K3N5P8",
      "name": "Support — WhatsApp",
      "channelType": "whatsapp"
    },
    "assignee": {
      "id": "usr_01J8F2K3N5PA",
      "name": "Marcos Lima",
      "avatarUrl": null
    },
    "lastMessage": {
      "id": "msg_01J9M4Q0X6RA",
      "content": "Thanks, that fixed it!",
      "messageType": "incoming",
      "createdAt": "2026-08-28T14:22:05.000Z"
    },
    "agentLastSeenAt": "2026-08-28T14:20:00.000Z",
    "additionalAttributes": null,
    "customAttributes": {
      "plan": "pro"
    },
    "unreadCount": 2
  }
}
{
  "error": "Invalid input: expected string, received undefined",
  "details": [
    {
      "code": "invalid_type",
      "expected": "string",
      "path": [
        "phone"
      ],
      "message": "Invalid input: expected string, received undefined"
    }
  ]
}
{
  "error": "Unauthorized"
}
{
  "error": "The owner of this API key can't use the chat_messages.send permission: their role in this workspace doesn't allow disableChatMessageSend",
  "details": {
    "code": "API_KEY_OWNER_PERMISSION_DENIED",
    "permission": "chat_messages.send",
    "control": "disableChatMessageSend"
  }
}
{
  "error": "Conversation not found"
}
{
  "error": "This contact already has a conversation in progress",
  "code": "active_conversation_exists",
  "conversation": {
    "id": "conv_01J9Z2K3M4N5P6Q7R8S9T0",
    "inboxId": "inbox_01J9Z2K3M4N5P6Q7R8S9T0",
    "inboxName": "Support",
    "status": "open",
    "teamName": "Tier 1",
    "assigneeId": null,
    "assigneeName": null,
    "aiAgentActive": false
  }
}
{
  "error": "Rate limit exceeded",
  "message": "API rate limit exceeded. Please retry after 2026-09-13T12:00:00.000Z",
  "retryAfter": 1789286400000
}
{
  "error": "Internal server error",
  "requestId": "req_01J9Z2K3M4N5P6Q7R8S9T0"
}