# Reply to a support ticket

**POST** `/tickets/{ticket_id}/messages`

## Parameters

### `ticket_id` (_path_, required)

Ticket id

- **Type:** `string`
- **Example:** `"42"`
- **Constraints:** pattern `^[1-9]\d*$`

## Request body

**application/json**

_Schema ref:_ `#/components/schemas/AddTicketMessageBody` (AddTicketMessageBody)

```json
{
  "type": "object",
  "properties": {
    "author_id": {
      "type": "integer",
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "User of the company who writes it; an employee or an admin"
    },
    "content": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000
    }
  },
  "required": [
    "author_id",
    "content"
  ]
}
```

## Responses

### 201

Ticket with the reply

**application/json**

_Schema ref:_ `#/components/schemas/GetTicketResponse` (GetTicketResponse)

```json
{
  "type": "object",
  "properties": {
    "data": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "reference": {
              "type": "string",
              "description": "Reference Fleet support quotes in its replies",
              "example": "48213"
            },
            "subject": {
              "type": "string",
              "nullable": true
            },
            "category": {
              "type": "string",
              "nullable": true,
              "enum": [
                "ORDER__UPDATE",
                "ORDER__SHIPPING",
                "CONTRACT__INFORMATION",
                "CONTRACT__RENEWAL",
                "CONTRACT__INVOICE",
                "INSURANCE__LOST",
                "INSURANCE__BROKEN",
                "TECHNICAL_PROBLEM",
                "MDM",
                "COCKPIT",
                "EDR",
                "INSURANCE_OXIDATION",
                "PASSWORD_MANAGER",
                "VPN",
                "SOFTWARE_PROBLEM",
                "HARDWARE_PROBLEM",
                "STORAGE",
                "TRANSFER",
                "RETURN",
                "MDM_INSTALL",
                "MDM_ACTIONS",
                "ORDER_ISSUE",
                "INVOICE"
              ],
              "description": "What the request is about, as in Cockpit's support form",
              "example": "HARDWARE_PROBLEM"
            },
            "status": {
              "type": "string",
              "enum": [
                "OPENED",
                "WAITING_CLIENT",
                "WAITING_FLEET",
                "WAITING_SUPPLIER",
                "WAITING_DEVICE_RETURN",
                "IN_REPAIR",
                "SHIPPING",
                "CLOSING",
                "SOLVED",
                "CLOSED",
                "DELETED"
              ],
              "description": "Support ticket status; WAITING_CLIENT means Fleet waits for the company's answer"
            },
            "content": {
              "type": "string",
              "nullable": true,
              "description": "The request as the requester wrote it"
            },
            "requester_id": {
              "type": "integer"
            },
            "order_id": {
              "type": "integer",
              "nullable": true
            },
            "device_ids": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "opened_at": {
              "type": "string",
              "nullable": true,
              "description": "ISO 8601"
            },
            "closed_at": {
              "type": "string",
              "nullable": true,
              "description": "ISO 8601"
            }
          },
          "required": [
            "id",
            "reference",
            "subject",
            "category",
            "status",
            "content",
            "requester_id",
            "order_id",
            "device_ids",
            "opened_at",
            "closed_at"
          ]
        },
        {
          "type": "object",
          "properties": {
            "messages": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "content": {
                    "type": "string",
                    "nullable": true,
                    "description": "HTML when content_type is html_body"
                  },
                  "content_type": {
                    "type": "string",
                    "enum": [
                      "body",
                      "html_body",
                      "plain_body"
                    ]
                  },
                  "author_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "User of the company who wrote it, when known"
                  },
                  "from_fleet": {
                    "type": "boolean",
                    "description": "True when Fleet support wrote it"
                  },
                  "created_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "ISO 8601"
                  }
                },
                "required": [
                  "id",
                  "content",
                  "content_type",
                  "author_id",
                  "from_fleet",
                  "created_at"
                ]
              },
              "description": "Replies after the opening request, oldest first"
            }
          },
          "required": [
            "messages"
          ]
        }
      ]
    }
  },
  "required": [
    "data"
  ]
}
```

### 400

Validation error, or the author is not a user of the company

**application/json**

_Schema ref:_ `#/components/schemas/CreateTicketBadRequestResponse` (CreateTicketBadRequestResponse)

```json
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Every validation failure, comma-separated",
          "example": "Required, must be an ISO 3166-1 alpha-2 country code"
        },
        "type": {
          "type": "string",
          "enum": [
            "validation_error"
          ]
        },
        "error": {
          "type": "string",
          "enum": [
            "validation_error"
          ]
        }
      },
      "required": [
        "message",
        "type",
        "error"
      ]
    },
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string",
          "enum": [
            "INVALID_USER"
          ]
        }
      },
      "required": [
        "error"
      ]
    }
  ]
}
```

### 401

Missing, invalid, or revoked API key

**text/plain**

```json
{
  "type": "string",
  "example": "Unauthorized"
}
```

### 403

The API key has READ scope; this operation needs WRITE

**application/json**

_Schema ref:_ `#/components/schemas/InsufficientScopeErrorResponse` (InsufficientScopeErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INSUFFICIENT_SCOPE"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 404

Ticket not found

**application/json**

_Schema ref:_ `#/components/schemas/TicketNotFoundErrorResponse` (TicketNotFoundErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "TICKET_NOT_FOUND"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 429

Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.

**text/plain**

```json
{
  "type": "string",
  "example": "Too many requests, please try again later."
}
```

### 500

Unexpected server error

**application/json**

_Schema ref:_ `#/components/schemas/InternalErrorResponse` (InternalErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INTERNAL_ERROR"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 502

Fleet support could not receive the reply, or has not received the ticket yet; nothing was added

**application/json**

_Schema ref:_ `#/components/schemas/TicketSyncFailedErrorResponse` (TicketSyncFailedErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "TICKET_SYNC_FAILED"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 503

Rate limiting is temporarily unavailable; retry with backoff

**application/json**

_Schema ref:_ `#/components/schemas/RateLimiterUnavailableResponse` (RateLimiterUnavailableResponse)

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "required": [
    "message"
  ]
}
```

## Security

```json
[
  {
    "bearerAuth": []
  }
]
```

**bearerAuth:** Bearer token using a Fleet platform API key (flt_sk_…).

---

_Generated from the OpenAPI specification for raw Markdown / tooling use._
