---
title: "Create a ticket"
method: POST
path: "/v1/tickets"
tags: ["Tickets"]
---

# Create a ticket

`POST /v1/tickets`

## Request

- Base URL: `https://api.capacity.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.capacity.com/v1/tickets`
- Auth: one of:
  - API key in header `x-capacity-id`
  - HTTP bearer

Create a new ticket.

## Request body

- object
  - `project_uuid` string, required: Uuid of the ticket's project
  - `title` string, required: Ticket title
  - `ticket_type_id` integer: Ticket type
  - `description` string: Ticket description
  - `reporter_uuid` string: Uuid of reporter
  - `reporter_email` string: Email of reporter
  - `reporter_name` string: Name of reporter
  - `priority_id` integer: Ticket priority
  - `due_date` string: Ticket due date
  - `assigned_user` string: Uuid of assigned user
  - `correspondence_email` string: Email of correspondence
  - `tags` string[]: List of ticket tags
  - `parameters` object: List of key value pairs of custom fields
  - `file_uuids` string[]: File UUIDs to attach to the ticket
  - `files` object[]: Files to attach to the ticket
    - `file_data` string: base64-encoded string of binary file data to upload. Required if no file object is provided
    - `file_url` string: URL to file to be uploaded
    - `filename` string: desired file name for the upload. Must include a file extension. Required if no file object is provided.
    - `folder_id` string: ID of the folder that the file will be created in. Leaving it out indicates the file should be in the root folder of the default knowledge base.
    - `is_public` boolean: Whether the file is public
    - `replace_duplicate` boolean: Whether to replace the existing file if there is one with the same name under the same folder

## Response `201`

The new ticket

- object
  - `body` object: Json body data in the request
  - `parameters` object: Query parameters in the request
  - `result` TicketSchema
    - `id` string: ID of the ticket
    - `project_uuid` string: Uuid of the ticket's project
    - `title` string: Ticket title
    - `ticket_type_id` integer: Ticket type
    - `description` string: Ticket description
    - `reporter_uuid` string: Uuid of ticket reporter
    - `reporter_email` string: Email of ticket reporter
    - `reporter_name` string: Name of ticket reporter
    - `priority_id` integer: Ticket priority
    - `due_date` string: Ticket due date
    - `assigned_user` string: Uuid of assigned user
    - `correspondence_email` string: Email of correspondence
    - `tags` string[]: Ticket tags
    - `file_attachments` string[]: File UUIDs attached to the ticket

## Other responses

- `400`: The request contains malformed data or violates data integrity

---

[API](https://skmtc.dev/capacity/apis/capacity-api-docs.md) - [All operations](https://skmtc.dev/capacity/apis/capacity-api-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/capacity/apis/capacity-api-docs/revisions/74c85bb61004?raw)
