# Start a conversation

```http
POST https://trydimmi.com/api/v1/conversations
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `conversations:write`.

## Body

- `assignee_id` (string): mem_..., me, or null for nobody. A teammate's conversation is theirs by default.
- `author` (string): member (default): you write first and the customer receives it. contact: you record what the customer wrote. One of: `contact`, `member`.
- `author_id` (string): Import only, author member: the teammate (mem_...) who wrote the first message.
- `body` (string, required): The first message in Markdown. As a teammate, the customer receives exactly this text.
- `channel_connection_id` (string): The channel to send on (chn_..., an email address's channel_connection from GET /email-addresses). Required with author member.
- `closed_at` (string): Import only, with status closed: when it closed; the first message's time by default.
- `contact` (object, required)
  - `email` (string): The customer's email address, at most 320 characters, such as ana@example.com. Used to find them when no id or external_id is given; a new contact is added when none matches.
  - `external_id` (string): Your own system's id of the customer, 1 to 255 characters, such as user_8421. Used to find them when no id is given; a new contact is added when none matches.
  - `id` (string): Id of an existing contact, starting with ctc_, such as ctc_01jx2m8k4t. Find it with GET /contacts. It wins over external_id and email.
  - `name` (string): The name to give the customer when they are new, at most 255 characters, such as Ana Silva.
- `created_at` (string): Import only (needs imports:manage): when the conversation really started, RFC 3339, from 2000 to now. Any import field records history: nothing is sent and nothing reacts.
- `external_id` (string): Import only: the conversation's id in the tool it comes from; sending it again returns the first copy.
- `inbox_id` (string): With author contact: the inbox (inbox_...) whose API channel takes the message.
- `status` (string): Import only: open (default) or closed. One of: `open`, `closed`.
- `subject` (string): The subject of the conversation, at most 255 characters.

## Response 201 (Created)

- `data` (object, required)
  - `ai_handoff_reason` (string | null, required): Why the AI agent stepped aside, such as customer_requested, unknown, max_replies, frustration, safety or human_replied. Null when it has not handed off.
  - `ai_pending_approvals` (integer, required): How many of the AI agent's actions in this conversation are waiting for a teammate to approve them.
  - `ai_reply_count` (integer, required): How many replies the AI agent has sent in this conversation.
  - `ai_state` (string, required): Who may speak next: off (the AI agent is not in it), active (the agent answers) or handed_off (only humans from now on).
  - `assignee` (object, required)
    - `avatar_url` (string | null, required): Address of the teammate's picture, or null when they have none.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `name` (string, required): The teammate's name.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `assignment_wait` (object, required)
    - `reason` (string, required): Why the conversation waits for an assignee: no_available_member or all_at_capacity.
    - `since` (string, required): When the conversation started waiting for an assignee.
  - `channel` (object, required)
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `name` (string, required): The name the team gave this channel connection.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `type` (string, required): The kind of channel: widget, email, api, slack, whatsapp, facebook or instagram.
  - `closed_at` (string | null, required): When the conversation was closed. Null when it has never been closed.
  - `contact` (object, required)
    - `avatar_url` (string | null, required): URL of the contact's picture. Null when they have none.
    - `email` (string | null, required): The contact's email address. Null when unknown.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `kind` (string, required): How well the contact is known: user when your app identified them, lead for anyone else.
    - `name` (string | null, required): The contact's name. Null when unknown.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `timezone` (string | null, required): The contact's IANA time zone, such as Europe/Berlin, for reading times in their local time. Null when unknown.
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `first_customer_message_at` (string | null, required): When the customer first wrote in this conversation. Null when they have not written yet.
  - `first_reply_at` (string | null, required): When the customer got their first reply. Null when nobody has replied yet.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `inbox` (object, required)
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `name` (string, required): Display name of the inbox, team or member this short form stands for.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `last_activity_at` (string | null, required): When anything last happened in the conversation. Null when nothing has yet.
  - `last_message` (object, required)
    - `author` (object, required)
      - `avatar_url` (string | null, required): Link to the author's picture. Null when they have none.
      - `id` (string | null, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
      - `name` (string, required): The author's name as shown on the entry.
      - `type` (string, required): Who wrote the entry: contact, member, agent (the AI), system or integration.
    - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
    - `excerpt` (string, required): Start of the message as plain text, cut to 140 characters with a trailing … when longer. Empty when the message has no body.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `type` (string, required): Kind of timeline entry: message, note or event.
  - `last_message_at` (string | null, required): When the latest message was written. Null when there are no messages.
  - `message_count` (integer, required): How many messages the conversation holds.
  - `number` (integer, required): The human reference number, such as 1042 for #1042. Unique within the workspace and never reused.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `priority` (string, required): How urgent the conversation is: none, low, medium, high or urgent.
  - `snoozed_until` (string | null, required): When a snoozed conversation wakes and reopens. Null unless status is snoozed.
  - `spam` (boolean, required): True when the conversation is marked as spam. A flag beside status, so unmarking it restores where it stood.
  - `status` (string, required): Where the conversation stands: open (needs the team), snoozed (until snoozed_until) or closed.
  - `subject` (string | null, required): The conversation's subject line. Null when it has none.
  - `tags` (object[] | null, required): The tags on the conversation, each with its id and name. Empty when it has none.
    - `color` (string | null, required): The tag's color as a hex value, such as #ff5500, kept as the workspace wrote it; null when it has none.
    - `icon` (string | null, required): Name of the tag's icon; null when it has none.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `name` (string, required): The tag's name.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `team` (object, required)
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `name` (string, required): Display name of the inbox, team or member this short form stands for.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `unread` (boolean, required): True when the conversation has something the calling member has not read. Judged for the caller, not for the whole team.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `viewers` (object[]): The teammates looking at the conversation right now, each with id, name and avatar. Present only when the list asked for viewers.
    - `avatar_url` (string | null, required): Web address of the viewing teammate's picture. Null when not given.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `name` (string, required): Name of the teammate currently viewing the conversation.
  - `waiting_since` (string | null, required): Since when the customer has waited for an answer: their latest message is newer than the latest reply. Null when nobody waits or it is closed.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/conversations' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "assignee_id": "<string>",
  "author": "contact",
  "author_id": "<string>",
  "body": "<string>",
  "channel_connection_id": "<string>",
  "closed_at": "2026-11-01T09:30:00Z",
  "contact": {
    "email": "ada@example.com",
    "external_id": "<string>",
    "id": "<string>",
    "name": "<string>"
  },
  "created_at": "2026-11-01T09:30:00Z",
  "external_id": "<string>",
  "inbox_id": "<string>",
  "status": "open",
  "subject": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "ai_handoff_reason": "<string>",
    "ai_pending_approvals": 123,
    "ai_reply_count": 123,
    "ai_state": "<string>",
    "assignee": {
      "avatar_url": "<string>",
      "id": "<string>",
      "name": "<string>",
      "object": "<string>"
    },
    "assignment_wait": {
      "reason": "<string>",
      "since": "2026-11-01T09:30:00Z"
    },
    "channel": {
      "id": "<string>",
      "name": "<string>",
      "object": "<string>",
      "type": "<string>"
    },
    "closed_at": "2026-11-01T09:30:00Z",
    "contact": {
      "avatar_url": "<string>",
      "email": "<string>",
      "id": "<string>",
      "kind": "<string>",
      "name": "<string>",
      "object": "<string>",
      "timezone": "<string>"
    },
    "created_at": "2026-11-01T09:30:00Z",
    "first_customer_message_at": "2026-11-01T09:30:00Z",
    "first_reply_at": "2026-11-01T09:30:00Z",
    "id": "<string>",
    "inbox": {
      "id": "<string>",
      "name": "<string>",
      "object": "<string>"
    },
    "last_activity_at": "2026-11-01T09:30:00Z",
    "last_message": {
      "author": {
        "avatar_url": "<string>",
        "id": "<string>",
        "name": "<string>",
        "type": "<string>"
      },
      "created_at": "2026-11-01T09:30:00Z",
      "excerpt": "<string>",
      "id": "<string>",
      "object": "<string>",
      "type": "<string>"
    },
    "last_message_at": "2026-11-01T09:30:00Z",
    "message_count": 123,
    "number": 123,
    "object": "<string>",
    "priority": "<string>",
    "snoozed_until": "2026-11-01T09:30:00Z",
    "spam": true,
    "status": "<string>",
    "subject": "<string>",
    "tags": [
      {
        "color": "<string>",
        "icon": "<string>",
        "id": "<string>",
        "name": "<string>",
        "object": "<string>"
      }
    ],
    "team": {
      "id": "<string>",
      "name": "<string>",
      "object": "<string>"
    },
    "unread": true,
    "updated_at": "2026-11-01T09:30:00Z",
    "viewers": [
      {
        "avatar_url": "<string>",
        "id": "<string>",
        "name": "<string>"
      }
    ],
    "waiting_since": "2026-11-01T09:30:00Z"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
