# Open a support ticket with Fleet

**POST** `/tickets`

## Request body

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "requester_id": {
      "type": "integer",
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "User of the company Fleet support answers; an employee or an admin"
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "content": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000,
      "description": "The request, in the requester's words"
    },
    "category": {
      "type": "string",
      "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"
    },
    "order_id": {
      "type": "integer",
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "Order of the company the request is about"
    },
    "device_id": {
      "type": "integer",
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "Device the request is about"
    }
  },
  "required": [
    "requester_id",
    "subject",
    "content"
  ]
}
```

## Responses

### 201

Created ticket

**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

**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

Company, order, or device not found

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "COMPANY_NOT_FOUND",
        "ORDER_NOT_FOUND",
        "DEVICE_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 ticket; nothing was created

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "TICKET_CREATION_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._
