# Create ticket

`POST /v1/tickets` · scope `tickets:write`

Create a new support ticket. Returns the ticket number in the `ticket` field (not `ticket_number`), for example `{"ticket": 886174}`; use this number as `@number` in the other ticket routes.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/v1/tickets` |
| Method | `POST` |
| Scope | `tickets:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Tokens that can call it | app tokens (`tinoat_`), personal API tokens (`tinopat_`) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `dept_id` | body | integer | no | Department id |
| `subject` | body | string | no | Ticket subject |
| `body` | body | string | no | Ticket message |

## Example request

```bash
curl -X POST "https://api.tino.vn/v1/tickets" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "dept_id": 1,
  "subject": "Subject",
  "body": "Message ..."
}'
```

`$TINO_TOKEN` is a token with the scope `tickets:write`.

SDK ([SDK & examples](/en/docs/sdk)): Python `client.support.create_ticket(dept_id=...)`, Node.js `await client.support.createTicket({ dept_id: ... });`, PHP `$client->support->createTicket(['dept_id' => ...]);`.

## Example response

```json
{
 "ticket": 886174
}
```

Live sample from a test account with personal data masked; long arrays and strings are trimmed (`… N more item(s)`, `… N more line(s)`).
