> ## Documentation Index
> Fetch the complete documentation index at: https://docs.joinsayless.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tickets

> Create a ticket with a markdown body, and how SLA metrics work.

API and OAuth callers create a ticket with a markdown `description`. That one request writes the ticket and its content document, the same way the app does. Sayless stores the body as Lexical and derives the preview and URL id. Do not send Lexical `content`, `preview`, or `mutationId`, and do not call a separate content endpoint.

`POST /tickets/update` accepts `description` to replace that body on one ticket.

```bash theme={"system"}
curl -X POST "https://api.joinsayless.com/api/v1/tickets/create" \
  -H "Authorization: Bearer $SAYLESS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ticket-from-integration-42" \
  -d '{
    "workspaceId": "'"$SAYLESS_WORKSPACE_ID"'",
    "subject": "Renewal follow-up",
    "description": "Customer asked to review the renewal before Friday.",
    "statusId": "<status-id>"
  }'
```

`subject` is 1–100 characters. `priority` defaults to `3` (normal). `1` is urgent, `2` high, `4` low.

A successful create returns `{ "success": true, "data": { …ticket } }`.

`POST /tickets/info` accepts either the ticket UUID or the `subject-urlId` slug in `_id`.

## Comments and reactions

Create a comment with markdown `description`. Sayless stores the Lexical document. Do not send `content`.

```bash theme={"system"}
curl -X POST "https://api.joinsayless.com/api/v1/tickets/ticketComment/create" \
  -H "Authorization: Bearer $SAYLESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "'"$SAYLESS_WORKSPACE_ID"'",
    "ticketId": "<ticket-id>",
    "description": "We can review this on Thursday."
  }'
```

Add or remove a reaction with the Unicode character, the same value the app stores:

```bash theme={"system"}
curl -X POST "https://api.joinsayless.com/api/v1/tickets/ticketComment/comment_reaction_add" \
  -H "Authorization: Bearer $SAYLESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "'"$SAYLESS_WORKSPACE_ID"'",
    "_id": "<comment-id>",
    "emoji": "👍"
  }'
```

`comment_reaction_remove` uses the same body. `_id` is the comment id. A successful call returns the comment, including its `reactions`.

## SLA metrics

`POST /tickets/set_sla` sets a custom duration on one metric. `durationSeconds` is a positive number of seconds, at most one year. Send `null` to clear a custom **resolution** SLA.

| Metric | When the clock runs |
| - | - |
| `firstResponse` | From ticket creation until the first agent reply. |
| `nextResponse` | From the latest customer reply until the next agent reply. |
| `resolution` | From ticket creation until the ticket is done. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.