# Reply to a ticket

`POST https://evohub.io/api/v1/support/tickets/{id}/messages`

Part of the [Support API](https://docs.evohub.io/support.md) reference · operationId `replyToTicket`.

Adds a message from the caller to one of their tickets. Replying
sets the ticket's `status` back to `open`, whatever it was, so a
resolved or closed ticket is reopened by answering it.

`body` is required (surrounding spaces are trimmed).

Requires no scope.

## Authorization

Any one of:

- `bearerKey`
- `headerKey`

Where:

- `bearerKey`: HTTP Bearer — An EvoHub API key (`evohub_…`) as a bearer token.
- `headerKey`: API key in the header `X-API-Key` — An EvoHub API key (`evohub_…`).

## Path parameters

- `id` (string, required, example `tkt_3f9a1c2e7b5d4a60`): The ticket's ID.

## Request body (required)

Content type: `application/json`

Type: `object`

- `body` (string, required): The message.

## Responses

### 201 — The message was added.

Content type: `application/json`

Type: `object`

- `success` (boolean, value `true`)
- `data` (TicketMessage)
  - `id` (string, example `msg_8e2d4f6a1b3c5d70`)
  - `ticket_id` (string)
  - `author_id` (string)
  - `author_type` (string, one of `user`, `admin`): `user` for the ticket's owner, `admin` for EvoHub support.
  - `body` (string)
  - `created_at` (string (date-time))

### 400 — The body is not JSON (`INVALID_JSON`), or `body` is missing or blank (`VALIDATION_ERROR`).

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Support; the gateway's own refusals leave it out.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `ticket not found`)
  - `request_id` (string)

### 401 — No API key was sent, or it is unknown, revoked or expired (`UNAUTHORIZED`).

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Support; the gateway's own refusals leave it out.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `ticket not found`)
  - `request_id` (string)

### 404 — The ticket does not exist, or it is not one of the caller's own (`NOT_FOUND`).

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Support; the gateway's own refusals leave it out.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `ticket not found`)
  - `request_id` (string)

### 429 — Too many requests (`RATE_LIMITED`). Wait for `Retry-After` seconds.

Headers:

- `Retry-After` (integer): Seconds to wait before retrying.

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Support; the gateway's own refusals leave it out.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `ticket not found`)
  - `request_id` (string)

### 500 — Something went wrong on EvoHub's side (`INTERNAL_ERROR`). Retry later.

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Support; the gateway's own refusals leave it out.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `ticket not found`)
  - `request_id` (string)

## Example request

```bash
curl -X POST 'https://evohub.io/api/v1/support/tickets/tkt_3f9a1c2e7b5d4a60/messages' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "body": "Confirmed, deliveries are on time again. Thank you!"
}'
```
