# Reply to a ticket

`POST https://console.advinservers.com/api/v1/client/tickets/{ticket}/reply`

### Overview

Adds a reply and returns the updated ticket with its conversation. Send `message` and optionally up to 5 files in `attachments[]`, limited to 4 MB each and 8 MB total. The department, subject and priority cannot be changed here. Replies have a stricter rate limit than ticket reads.

### Permissions

Requires the account permission `tickets.write` (Write to support).

## Authorization

Send `Authorization: Bearer <token>` with the request. Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

## Path parameters

- `ticket` (string, required): The ticket number returned by the support endpoints.

## Body

Sent as `multipart/form-data`.

- `message` (string, required): The message text. 2 to 20000 characters
- `attachments` (file[]): The value of `attachments`. At most 5 items

## Response 200

The record, as a JSON object. There is no envelope.

- `id` (integer, required): The id ID.
- `number` (string, required): The ticket reference sent by email, such as #ABC-123456. Use the numeric ticket ID for API requests.
- `subject` (string, required): The subject line for the message.
- `status` (string, required): The value of `status`.
- `priority` (string | null, required): The value of `priority`.
- `department` (string | null, required): The value of `department`.
- `opened_at` (string | null, required): The date and time for opened at, in UTC.
- `last_replied_at` (string | null, required): The date and time for last replied at, in UTC.
- `awaiting_customer` (boolean, required): Whether the customer is the one being waited on.
- `closed` (boolean, required): The value of `closed`.
- `service` (string | null, required): The value of `service`.
- `server` (object | null, required): The machine it is about, where the service names one. Enough of it to draw the badge the customer recognises and to link to it.
  - `id` (string, required): The id ID.
  - `uuid_short` (string, required): The value of `uuid_short`.
  - `name` (string, required): The name shown to customers.
  - `hostname` (string, required): The fully qualified hostname.
  - `template_name` (string | null, required): The value of `template_name`.
  - `template_icon_url` (string | null, required): The value of `template_icon_url`.
  - `windows` (boolean, required): The value of `windows`.
- `messages` (object[] | null): The conversation, oldest first, and only where it was asked for.
  - `id` (integer, required): The id ID.
  - `author` (string | null, required): Staff are shown by whatever name the installation puts on their replies, which is often a role rather than a person and is the name the customer already sees in the ticket emails.
  - `is_staff` (boolean, required): Whether the resource is staff.
  - `is_assistant` (boolean, required): A staff reply written by the AI assistant rather than a person.
  - `posted_at` (string | null, required): The date and time for posted at, in UTC.
  - `body` (string, required): The message body.
  - `attachments` (object[], required): The value of `attachments`.
    - `index` (integer, required): The value of `index`.
    - `filename` (string, required): The value of `filename`.
    - `url` (string, required): The complete URL.

```json
{
  "id": 5316,
  "number": "NQX-482913",
  "subject": "Packet loss on lambda-core",
  "status": "Open",
  "priority": "Medium",
  "department": "Technical Support",
  "opened_at": "2026-09-14T09:12:44+00:00",
  "last_replied_at": "2026-09-14T09:12:44+00:00",
  "awaiting_customer": false,
  "closed": false,
  "service": null,
  "server": {
    "id": "ecc6f4f1-c89b-4dce-a20b-a330641c5b0b",
    "uuid_short": "ecc6f4f1",
    "name": "lambda-core",
    "hostname": "lambda-core.blackmesa.example.com",
    "template_name": "Ubuntu 24.04",
    "template_icon_url": "/assets/icons/ubuntu.png",
    "windows": false
  },
  "messages": [
    {
      "id": 0,
      "author": "Gordon Freeman",
      "is_staff": false,
      "is_assistant": true,
      "posted_at": "2026-09-14T09:12:44+00:00",
      "body": "Since about 08:30 UTC lambda-core has been dropping around 5% of packets from the Sector C labs. MTR output from 192.0.2.44 is attached. sector-c-db in the same location is not affected, so we have paused the anti-mass spectrometer test runs for now.",
      "attachments": [
        {
          "index": 0,
          "filename": "mtr-lambda-core.txt",
          "url": "/api/v1/client/tickets/5316/messages/0/attachments/0"
        }
      ]
    }
  ]
}
```

## Errors

- `401`: The key was missing, malformed, revoked, or belongs to an account that no longer exists.
- `403`: Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
- `404`: The resource was not found in the selected team. Resources in another account or team also return 404.
- `422`: A field is missing or invalid, or the resource cannot accept this change in its current state. Check `message` for details. Field validation also includes an `errors` object keyed by field name.
- `429`: Too many requests. The `Retry-After` header says how many seconds to wait. Limits are per account, so several keys on one account share them.

## Example request

```bash
curl --request POST \
  --url 'https://console.advinservers.com/api/v1/client/tickets/{ticket}/reply' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --form 'message=A second run taken at 16:30 UTC, after Barney restarted lambda-core, is attached. Loss is down to about 1% but has not gone away.' \
  --form 'attachments[]=@mtr-lambda-core-1630.txt'
```
