# Convert a conversation to a ticket

```http
POST https://trydimmi.com/api/v1/conversations/{conversation}/ticket
```

## Authorization

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

## Path parameters

- `conversation` (string, required): Id of the conversation, such as conv_01jx2m8k4t, or its number, such as 1042 for #1042. Find it with GET /conversations or GET /search.

## Body

- `ai_fill` (boolean): true to have the AI read the conversation and propose values for the type's fields. They are kept as suggestions, or saved straight into empty fields where the type or field fills itself. false or left out skips this.
- `fields` (object): A JSON object of field values, keyed by the field keys of the ticket type in type_id. Text is a string, numbers a number, boolean true or false, date "YYYY-MM-DD", single choice one option, multiple choice a list of options, such as {"order_number": "A-1042", "refund": true}.
- `state_id` (string): Id of the ticket state, starting with tkts_, such as tkts_01jx2m8k4t. Find it with GET /ticket-states.
- `title` (string): The title of the ticket, at most 200 characters.
- `type_id` (string, required): Id of the ticket type, starting with tktt_, such as tktt_01jx2m8k4t. Find it with GET /ticket-types.

## Response 201 (Created)

- `data` (object, required)
  - `assignee_id` (string | null, required): Id of the teammate who works the ticket, such as mem_...; null when nobody is assigned.
  - `close_loop` (boolean, required): True when the ticket is marked to close the loop with its customers; false by default.
  - `company_id` (string | null, required): Id of the company the ticket belongs to, such as cmp_...; null for none.
  - `contact_id` (string | null, required): Id of the customer the ticket belongs to, such as ctc_...; null for none.
  - `conversation_id` (string | null, required): Id of the conversation a customer ticket is tied to, where its replies live, such as conv_...; null for other kinds.
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `created_by_type` (string, required): Who made the ticket: member, contact, agent, workflow, integration or system.
  - `customer_visible` (boolean, required): True when the customer can see the ticket.
  - `deleted_at` (string | null, required): When the ticket was deleted; null while it is live.
  - `description` (string, required): The ticket's description, up to 20000 characters; empty when none was written.
  - `external_id` (string | null, required): The caller's own id for the ticket, unique in the workspace, so a retry finds the ticket it already made; null when none was sent.
  - `fields` (object, required): The ticket's field values, keyed by each field's key; empty when none are set.
  - `group` (string, required): Group of the ticket's state: submitted, in_progress, waiting_customer, waiting_team or resolved.
  - `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.
  - `impact` (object)
    - `companies` (integer, required): How many companies the tracker reaches through its linked conversations.
    - `conversations` (integer, required): How many conversations are linked to the tracker.
    - `customers` (integer, required): How many customers the tracker reaches through its linked conversations.
    - `revenue` (number, required): Total monthly revenue of the companies reached, read from each company's monthly_spend or mrr attribute; a company with neither counts as 0.
  - `inbox_id` (string, required): Id of the inbox the ticket belongs to, such as inbox_....
  - `issues` (object[] | null, required): The issues in outside trackers that stand behind the ticket; empty for none.
    - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
    - `deployed_at` (string | null, required): When the issue's fix was seen deployed. Null until then.
    - `done_at` (string | null, required): When the issue was seen done in its tool. Null until then.
    - `external_id` (string, required): The issue's or incident's own id in the provider's tool.
    - `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.
    - `installation_id` (string | null, required): Id of the connected integration the issue is read through, such as itg_.... Null when that integration is gone or none is used.
    - `key` (string, required): The issue's short key as its tool shows it, such as ENG-123.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `provider` (string, required): The tool the issue or incident lives in: linear, jira, github, incident_io, rootly or pagerduty.
    - `severity` (string, required): The issue's or incident's severity as the provider names it. Empty when none is known.
    - `status` (string, required): The issue's status as its tool names it, as last seen, such as In Progress. Empty when not yet read.
    - `status_group` (string, required): What dimmi maps the issue's status to: backlog, unstarted, started, done or canceled.
    - `sync_error` (string | null, required): Why the last check of the issue failed. Null when it worked.
    - `synced_at` (string | null, required): When the issue was last checked against its tool. Null when never checked.
    - `team_id` (string, required): The provider's own id of the team the issue belongs to. Empty when not known.
    - `team_name` (string, required): Name of the team the issue belongs to in its tool. Empty when not known.
    - `ticket_id` (string, required): Id of the ticket the issue is linked to, such as tkt_....
    - `title` (string, required): The issue's title as last seen in its tool. Empty when not yet read.
    - `url` (string, required): Web address of the issue in its tool.
    - `warning` (string | null, required): A problem a person should know about, such as a Linear team the app cannot see. Null when there is none.
  - `kind` (string, required): Kind of ticket: customer (tied to one conversation), back_office or tracker.
  - `linked_conversations` (integer, required): How many conversations are linked to the ticket.
  - `links` (object[] | null): The ticket's links to other tickets and conversations. Only present when one ticket is read on its own.
    - `conversation_id` (string | null, required): Id of the conversation the link points to, such as conv_.... Null when the link points to another ticket instead.
    - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
    - `from_ticket_id` (string, required): Id of the ticket the link starts from, such as tkt_....
    - `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): What the link means: back_office (work behind a customer ticket), tracker (a report of a tracked problem), follow_up or related.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `ticket` (object, required)
      - `assignee_id` (string | null, required): Id of the teammate the linked ticket is assigned to, starting with mem_. Null when nobody holds it.
      - `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): The linked ticket's kind: customer, back_office or tracker.
      - `reference` (string, required): The linked ticket's number as the team reads it, such as T-142.
      - `state` (object, required)
        - `customer_label` (string, required): What the customer sees when their ticket is in this state.
        - `group` (string, required): The fixed group that says what the state means: submitted, in_progress, waiting_customer, waiting_team or resolved.
        - `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 state's name as the team sees it.
      - `title` (string, required): The linked ticket's title.
      - `type_name` (string, required): Name of the linked ticket's type.
      - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
    - `to_ticket_id` (string | null, required): Id of the ticket the link points to, such as tkt_.... Null when the link points to a conversation instead.
  - `number` (integer, required): The ticket's number within the workspace; the reference is T- followed by it.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `priority` (string, required): The ticket's priority: none, low, medium, high or urgent.
  - `reference` (string, required): The ticket's reference as the team reads it, such as T-482.
  - `resolved_at` (string | null, required): When the ticket was resolved; null while it is not.
  - `sla_clocks` (object[] | null): The service level clocks on the ticket. Only present when one ticket is read on its own.
    - `breached_at` (string | null, required): When the clock passed its due time unmet; null if it has not.
    - `conversation_id` (string | null, required): Id of the conversation the clock runs on, such as conv_...; null when it runs on a ticket.
    - `due_at` (string, required): When the target must be met, counting only the policy's open hours.
    - `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.
    - `paused_at` (string | null, required): When the clock was paused; null while it is not paused.
    - `policy_id` (string, required): Id of the service level policy the clock follows, such as sla_....
    - `started_at` (string, required): When the clock started.
    - `state` (string, required): Where the clock stands: running, paused, met, breached or canceled.
    - `stopped_at` (string | null, required): When the clock ended; null while it still runs or is paused.
    - `target` (string, required): What the clock promises: first_reply, next_reply, follow_up or resolution.
    - `ticket_id` (string | null, required): Id of the ticket the clock runs on, such as tkt_...; null when it runs on a plain conversation.
    - `warn_at` (string | null, required): When the team is warned ahead of the due time; null when no warning is set.
  - `sla_policy_id` (string | null, required): Id of the service level policy the ticket follows, such as sla_...; null for none.
  - `state` (object, required)
    - `customer_label` (string, required): What the customer sees when their ticket is in this state.
    - `group` (string, required): The fixed group that says what the state means: submitted, in_progress, waiting_customer, waiting_team or resolved.
    - `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 state's name as the team sees it.
  - `state_id` (string, required): Id of the ticket's state, such as tkts_.... Send it wherever a ticket state is asked for.
  - `state_since` (string, required): When the ticket entered its current state.
  - `suggestions` (object, required): Field values the AI proposed, keyed by field key, waiting until a person accepts them; empty for none.
  - `team_id` (string | null, required): Id of the team the ticket is assigned to, such as team_...; null for none.
  - `title` (string, required): The ticket's title, up to 200 characters.
  - `type` (object, required)
    - `icon` (string, required): Name of the type's icon, lowercase with dashes, such as ticket.
    - `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): What the ticket is: customer, back_office or tracker.
    - `name` (string, required): The ticket type's name.
  - `type_id` (string, required): Id of the ticket's type, such as tktt_.... Send it wherever a ticket type is asked for.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `version` (integer, required): Number that goes up on every change. Send it back when editing so an edit made against an older copy is refused.

## 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/{conversation}/ticket' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ai_fill": true,
  "fields": {
    "<key>": null
  },
  "state_id": "<string>",
  "title": "<string>",
  "type_id": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "assignee_id": "<string>",
    "close_loop": true,
    "company_id": "<string>",
    "contact_id": "<string>",
    "conversation_id": "<string>",
    "created_at": "2026-11-01T09:30:00Z",
    "created_by_type": "<string>",
    "customer_visible": true,
    "deleted_at": "2026-11-01T09:30:00Z",
    "description": "<string>",
    "external_id": "<string>",
    "fields": {
      "<key>": null
    },
    "group": "<string>",
    "id": "<string>",
    "impact": {
      "companies": 123,
      "conversations": 123,
      "customers": 123,
      "revenue": 123.45
    },
    "inbox_id": "<string>",
    "issues": [
      {
        "created_at": "2026-11-01T09:30:00Z",
        "deployed_at": "2026-11-01T09:30:00Z",
        "done_at": "2026-11-01T09:30:00Z",
        "external_id": "<string>",
        "id": "<string>",
        "installation_id": "<string>",
        "key": "<string>",
        "object": "<string>",
        "provider": "<string>",
        "severity": "<string>",
        "status": "<string>",
        "status_group": "<string>",
        "sync_error": "<string>",
        "synced_at": "2026-11-01T09:30:00Z",
        "team_id": "<string>",
        "team_name": "<string>",
        "ticket_id": "<string>",
        "title": "<string>",
        "url": "<string>",
        "warning": "<string>"
      }
    ],
    "kind": "<string>",
    "linked_conversations": 123,
    "links": [
      {
        "conversation_id": "<string>",
        "created_at": "2026-11-01T09:30:00Z",
        "from_ticket_id": "<string>",
        "id": "<string>",
        "kind": "<string>",
        "object": "<string>",
        "ticket": {
          "assignee_id": "<string>",
          "id": "<string>",
          "kind": "<string>",
          "reference": "<string>",
          "state": {},
          "title": "<string>",
          "type_name": "<string>",
          "updated_at": "2026-11-01T09:30:00Z"
        },
        "to_ticket_id": "<string>"
      }
    ],
    "number": 123,
    "object": "<string>",
    "priority": "<string>",
    "reference": "<string>",
    "resolved_at": "2026-11-01T09:30:00Z",
    "sla_clocks": [
      {
        "breached_at": "2026-11-01T09:30:00Z",
        "conversation_id": "<string>",
        "due_at": "2026-11-01T09:30:00Z",
        "id": "<string>",
        "object": "<string>",
        "paused_at": "2026-11-01T09:30:00Z",
        "policy_id": "<string>",
        "started_at": "2026-11-01T09:30:00Z",
        "state": "<string>",
        "stopped_at": "2026-11-01T09:30:00Z",
        "target": "<string>",
        "ticket_id": "<string>",
        "warn_at": "2026-11-01T09:30:00Z"
      }
    ],
    "sla_policy_id": "<string>",
    "state": {
      "customer_label": "<string>",
      "group": "<string>",
      "id": "<string>",
      "name": "<string>"
    },
    "state_id": "<string>",
    "state_since": "2026-11-01T09:30:00Z",
    "suggestions": {
      "<key>": null
    },
    "team_id": "<string>",
    "title": "<string>",
    "type": {
      "icon": "<string>",
      "id": "<string>",
      "kind": "<string>",
      "name": "<string>"
    },
    "type_id": "<string>",
    "updated_at": "2026-11-01T09:30:00Z",
    "version": 123
  }
}
```

---

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