> For the complete documentation index, see [llms.txt](https://docs.zaia.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zaia.app/documentation/api-reference-alpha/reference/tickets.md).

# Tickets

## GET /api/v1/tickets/{id}/details

> Retrieves a ticket with details.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets/{id}/details":{"get":{"description":"Retrieves a ticket with details.","tags":["Tickets"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"id","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"responses":{"200":{"description":"Retrieves a ticket.","content":{"application/json":{"schema":{"type":"object","properties":{"assigneeEmail":{"type":"string","nullable":true,"description":"The email of the user currently assigned to the ticket."},"assigneeId":{"type":"string","nullable":true,"format":"uuid","description":"The user ID currently assigned to the ticket."},"assigneeName":{"type":"string","nullable":true,"description":"The display name of the user currently assigned to the ticket."},"assigneePicture":{"type":"string","nullable":true,"description":"The picture of the user currently assigned to the ticket."},"channelId":{"type":"string","nullable":true,"format":"uuid","description":"The channel ID associated with the ticket chat."},"channelName":{"type":"string","nullable":true,"description":"The display name of the channel associated with the ticket chat."},"channelType":{"type":"string","nullable":true,"enum":["api","widget","waha","whatsapp","instagram",null],"description":"The type of the channel associated with the ticket chat."},"chatId":{"type":"string","format":"uuid","description":"The chat ID associated with the ticket."},"chatIsRemoved":{"type":"boolean","description":"Whether the chat associated with the ticket has been soft removed."},"chatOwnerId":{"type":"string","format":"uuid","description":"The chat owner super identity ID associated with the ticket chat."},"chatPublicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The shared chat memory snapshot associated with the ticket."},"completedAt":{"type":"string","nullable":true,"format":"date-time","description":"When the ticket was completed."},"createdAt":{"type":"string","format":"date-time","description":"When the ticket was created."},"id":{"type":"string","format":"uuid","description":"The ticket ID represented by this row."},"isOwnerBlocked":{"type":"boolean","nullable":true,"description":"Whether the external chat owner is blocked."},"ongoingAt":{"type":"string","nullable":true,"format":"date-time","description":"When the ticket entered the ongoing state."},"ownerEmail":{"type":"string","nullable":true,"description":"The email of the chat owner when the owner is a platform user."},"ownerEntity":{"type":"string","enum":["externalUsers","users"],"description":"The owner entity type associated with the chat owner super identity."},"ownerIdentifier":{"type":"string","nullable":true,"description":"The identifier of the chat owner when the owner is an external user."},"ownerName":{"type":"string","nullable":true,"description":"The display name of the chat owner resolved from external users or users."},"pendingChatMessages":{"type":"integer","description":"The number of pending chat messages still waiting on the ticket."},"responderEntity":{"type":"string","enum":["agents","squads"],"description":"The responder entity type assigned to the ticket chat."},"responderId":{"type":"string","format":"uuid","description":"The responder ID assigned to the ticket chat."},"responderName":{"type":"string","description":"The display name of the responder assigned to the ticket chat."},"responderPicture":{"type":"string","nullable":true,"description":"The picture of the responder assigned to the ticket chat."},"responderVersionId":{"type":"string","nullable":true,"format":"uuid","description":"The version ID of the responder entity for this ticket chat."},"responderVersionNumber":{"type":"integer","nullable":true,"description":"The version number of the responder entity for this ticket chat."},"status":{"type":"string","enum":["pending","ongoing","completed"],"description":"The lifecycle status of the ticket."},"summary":{"type":"string","description":"The short summary of the ticket."},"tags":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"activeTicketCount":{"type":"integer","minimum":0,"description":"The number of active tickets for this tag."},"color":{"type":"string","enum":["default","gray","red","orange","yellow","green","blue","purple","pink","brown"],"description":"The color of the tag."},"description":{"type":"string","minLength":3,"maxLength":250,"description":"The description of the tag."},"name":{"type":"string","minLength":3,"maxLength":50,"description":"The display name of the tag."},"workspaceId":{"type":"string","format":"uuid","description":"The workspace that owns this tag."}},"required":["createdAt","id","updatedAt","activeTicketCount","color","description","name","workspaceId"]},"description":"The tags currently associated with the ticket."},"ticketingTeamId":{"type":"string","nullable":true,"format":"uuid","description":"The ticketing team ID currently assigned to the ticket."},"ticketingTeamName":{"type":"string","nullable":true,"description":"The display name of the ticketing team currently assigned to the ticket."},"ticketingTeamPicture":{"type":"string","nullable":true,"description":"The picture of the ticketing team currently assigned to the ticket."},"workspaceId":{"type":"string","format":"uuid","description":"The workspace ID associated with the ticket."}},"required":["assigneeEmail","assigneeId","assigneeName","assigneePicture","channelId","channelName","channelType","chatId","chatIsRemoved","chatOwnerId","chatPublicMemory","completedAt","createdAt","id","isOwnerBlocked","ongoingAt","ownerEmail","ownerEntity","ownerIdentifier","ownerName","pendingChatMessages","responderEntity","responderId","responderName","responderPicture","responderVersionId","responderVersionNumber","status","summary","tags","ticketingTeamId","ticketingTeamName","ticketingTeamPicture","workspaceId"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Ticket not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## GET /api/v1/tickets/details

> Retrieves multiple tickets with details.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets/details":{"get":{"description":"Retrieves multiple tickets with details.","tags":["Tickets"],"parameters":[{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"assigneeIds","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"chatIds","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"includeRemoved","in":"query"},{"schema":{"type":"number","minimum":1,"default":1,"description":"The page number."},"required":false,"description":"The page number.","name":"pageNumber","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"The page size."},"required":false,"description":"The page size.","name":"pageSize","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"responderIds","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"responderVersionIds","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["pending","ongoing","completed"]},"required":true,"name":"status","in":"query"},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}],"default":[]},"required":false,"name":"tagIds","in":"query"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"responses":{"200":{"description":"Retrieves all tickets for the workspace.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"assigneeEmail":{"type":"string","nullable":true,"description":"The email of the user currently assigned to the ticket."},"assigneeId":{"type":"string","nullable":true,"format":"uuid","description":"The user ID currently assigned to the ticket."},"assigneeName":{"type":"string","nullable":true,"description":"The display name of the user currently assigned to the ticket."},"assigneePicture":{"type":"string","nullable":true,"description":"The picture of the user currently assigned to the ticket."},"channelId":{"type":"string","nullable":true,"format":"uuid","description":"The channel ID associated with the ticket chat."},"channelName":{"type":"string","nullable":true,"description":"The display name of the channel associated with the ticket chat."},"channelType":{"type":"string","nullable":true,"enum":["api","widget","waha","whatsapp","instagram",null],"description":"The type of the channel associated with the ticket chat."},"chatId":{"type":"string","format":"uuid","description":"The chat ID associated with the ticket."},"chatIsRemoved":{"type":"boolean","description":"Whether the chat associated with the ticket has been soft removed."},"chatOwnerId":{"type":"string","format":"uuid","description":"The chat owner super identity ID associated with the ticket chat."},"chatPublicMemory":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The shared chat memory snapshot associated with the ticket."},"completedAt":{"type":"string","nullable":true,"format":"date-time","description":"When the ticket was completed."},"createdAt":{"type":"string","format":"date-time","description":"When the ticket was created."},"id":{"type":"string","format":"uuid","description":"The ticket ID represented by this row."},"isOwnerBlocked":{"type":"boolean","nullable":true,"description":"Whether the external chat owner is blocked."},"ongoingAt":{"type":"string","nullable":true,"format":"date-time","description":"When the ticket entered the ongoing state."},"ownerEmail":{"type":"string","nullable":true,"description":"The email of the chat owner when the owner is a platform user."},"ownerEntity":{"type":"string","enum":["externalUsers","users"],"description":"The owner entity type associated with the chat owner super identity."},"ownerIdentifier":{"type":"string","nullable":true,"description":"The identifier of the chat owner when the owner is an external user."},"ownerName":{"type":"string","nullable":true,"description":"The display name of the chat owner resolved from external users or users."},"pendingChatMessages":{"type":"integer","description":"The number of pending chat messages still waiting on the ticket."},"responderEntity":{"type":"string","enum":["agents","squads"],"description":"The responder entity type assigned to the ticket chat."},"responderId":{"type":"string","format":"uuid","description":"The responder ID assigned to the ticket chat."},"responderName":{"type":"string","description":"The display name of the responder assigned to the ticket chat."},"responderPicture":{"type":"string","nullable":true,"description":"The picture of the responder assigned to the ticket chat."},"responderVersionId":{"type":"string","nullable":true,"format":"uuid","description":"The version ID of the responder entity for this ticket chat."},"responderVersionNumber":{"type":"integer","nullable":true,"description":"The version number of the responder entity for this ticket chat."},"status":{"type":"string","enum":["pending","ongoing","completed"],"description":"The lifecycle status of the ticket."},"summary":{"type":"string","description":"The short summary of the ticket."},"tags":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"activeTicketCount":{"type":"integer","minimum":0,"description":"The number of active tickets for this tag."},"color":{"type":"string","enum":["default","gray","red","orange","yellow","green","blue","purple","pink","brown"],"description":"The color of the tag."},"description":{"type":"string","minLength":3,"maxLength":250,"description":"The description of the tag."},"name":{"type":"string","minLength":3,"maxLength":50,"description":"The display name of the tag."},"workspaceId":{"type":"string","format":"uuid","description":"The workspace that owns this tag."}},"required":["createdAt","id","updatedAt","activeTicketCount","color","description","name","workspaceId"]},"description":"The tags currently associated with the ticket."},"ticketingTeamId":{"type":"string","nullable":true,"format":"uuid","description":"The ticketing team ID currently assigned to the ticket."},"ticketingTeamName":{"type":"string","nullable":true,"description":"The display name of the ticketing team currently assigned to the ticket."},"ticketingTeamPicture":{"type":"string","nullable":true,"description":"The picture of the ticketing team currently assigned to the ticket."},"workspaceId":{"type":"string","format":"uuid","description":"The workspace ID associated with the ticket."}},"required":["assigneeEmail","assigneeId","assigneeName","assigneePicture","channelId","channelName","channelType","chatId","chatIsRemoved","chatOwnerId","chatPublicMemory","completedAt","createdAt","id","isOwnerBlocked","ongoingAt","ownerEmail","ownerEntity","ownerIdentifier","ownerName","pendingChatMessages","responderEntity","responderId","responderName","responderPicture","responderVersionId","responderVersionNumber","status","summary","tags","ticketingTeamId","ticketingTeamName","ticketingTeamPicture","workspaceId"]}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## PATCH /api/v1/tickets/{id}/complete

> Completes a ticket.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets/{id}/complete":{"patch":{"description":"Completes a ticket.","tags":["Tickets"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"id","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},"required":["userId"]}}}},"responses":{"200":{"description":"The ticket was completed.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"assigneeId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the user assigned to the ticket."},"chatId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"circumstance":{"type":"string","enum":["takeover","handover"],"description":"The type of ticket creation: takeover (human intervention) or handover (agent automatic creation)."},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"lastViewedAt":{"type":"string","nullable":true,"format":"date-time","description":"The last time the ticket was viewed by the assignee."},"ongoingAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["pending","ongoing","completed"]},"summary":{"type":"string","description":"A brief summary of the chat up until the ticket was created."},"ticketingTeamId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the ticketing team responsible for the ticket."}},"required":["createdAt","id","updatedAt","assigneeId","chatId","circumstance","completedAt","lastViewedAt","ongoingAt","status","summary","ticketingTeamId"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Ticket not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"412":{"description":"Ticket is not ongoing.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## POST /api/v1/tickets

> Creates a new ticket.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets":{"post":{"description":"Creates a new ticket.","tags":["Tickets"],"parameters":[{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chatId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"ticketingTeamId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the ticketing team responsible for the ticket."},"assigneeId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"status":{"type":"string","enum":["pending","ongoing"]}},"required":["chatId","ticketingTeamId","assigneeId","status"]}}}},"responses":{"200":{"description":"The ticket was created.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"assigneeId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the user assigned to the ticket."},"chatId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"circumstance":{"type":"string","enum":["takeover","handover"],"description":"The type of ticket creation: takeover (human intervention) or handover (agent automatic creation)."},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"lastViewedAt":{"type":"string","nullable":true,"format":"date-time","description":"The last time the ticket was viewed by the assignee."},"ongoingAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["pending","ongoing","completed"]},"summary":{"type":"string","description":"A brief summary of the chat up until the ticket was created."},"ticketingTeamId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the ticketing team responsible for the ticket."}},"required":["createdAt","id","updatedAt","assigneeId","chatId","circumstance","completedAt","lastViewedAt","ongoingAt","status","summary","ticketingTeamId"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Chat not found or assignee not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"409":{"description":"Ticket already exists.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## POST /api/v1/tickets/{ticketId}/tags

> Creates tags for a ticket.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets/{ticketId}/tags":{"post":{"description":"Creates tags for a ticket.","tags":["Tickets"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"ticketId","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tagId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},"required":["tagId"]}}}},"responses":{"200":{"description":"The tag was attached to the ticket.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"tagId":{"type":"string","format":"uuid","description":"The tag associated with the ticket."},"ticketId":{"type":"string","format":"uuid","description":"The ticket associated with the tag."},"tag":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"activeTicketCount":{"type":"integer","minimum":0,"description":"The number of active tickets for this tag."},"color":{"type":"string","enum":["default","gray","red","orange","yellow","green","blue","purple","pink","brown"],"description":"The color of the tag."},"description":{"type":"string","minLength":3,"maxLength":250,"description":"The description of the tag."},"name":{"type":"string","minLength":3,"maxLength":50,"description":"The display name of the tag."},"workspaceId":{"type":"string","format":"uuid","description":"The workspace that owns this tag."}},"required":["createdAt","id","updatedAt","activeTicketCount","color","description","name","workspaceId"]}},"required":["createdAt","updatedAt","tagId","ticketId","tag"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Ticket or tag not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## DELETE /api/v1/tickets/{ticketId}/tags/{tagId}

> Removes a tag from a ticket.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets/{ticketId}/tags/{tagId}":{"delete":{"description":"Removes a tag from a ticket.","tags":["Tickets"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"tagId","in":"path"},{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"ticketId","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"responses":{"200":{"description":"The tag was removed from the ticket.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"An informative message for a call that has no effective result to be returned."}},"required":["message"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Ticket tag relationship not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## PATCH /api/v1/tickets/{id}/takeover

> Takes over a ticket.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets/{id}/takeover":{"patch":{"description":"Takes over a ticket.","tags":["Tickets"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"id","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assigneeId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},"required":["assigneeId"]}}}},"responses":{"200":{"description":"The ticket was taken over.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"assigneeId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the user assigned to the ticket."},"chatId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"circumstance":{"type":"string","enum":["takeover","handover"],"description":"The type of ticket creation: takeover (human intervention) or handover (agent automatic creation)."},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"lastViewedAt":{"type":"string","nullable":true,"format":"date-time","description":"The last time the ticket was viewed by the assignee."},"ongoingAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["pending","ongoing","completed"]},"summary":{"type":"string","description":"A brief summary of the chat up until the ticket was created."},"ticketingTeamId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the ticketing team responsible for the ticket."}},"required":["createdAt","id","updatedAt","assigneeId","chatId","circumstance","completedAt","lastViewedAt","ongoingAt","status","summary","ticketingTeamId"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Ticket not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"412":{"description":"Ticket is not ongoing or already assigned.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```

## PATCH /api/v1/tickets/{id}/assignee

> Updates the assignee of a ticket.

```json
{"openapi":"3.1.0","info":{"title":"Public API","version":"1.0.0"},"servers":[{"description":"API Server","url":"https://api.endless.zaia.app"}],"paths":{"/api/v1/tickets/{id}/assignee":{"patch":{"description":"Updates the assignee of a ticket.","tags":["Tickets"],"parameters":[{"schema":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"required":true,"description":"A UUID v4 string that identifies an entity.","name":"id","in":"path"},{"schema":{"type":"string","description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page."},"required":true,"description":"The API key to use for authentication. Can be created in the api keys section on the workspace settings page.","name":"authorization","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assigneeId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."}},"required":["assigneeId"]}}}},"responses":{"200":{"description":"The ticket was updated.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"updatedAt":{"type":"string","format":"date-time"},"assigneeId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the user assigned to the ticket."},"chatId":{"type":"string","format":"uuid","description":"A UUID v4 string that identifies an entity."},"circumstance":{"type":"string","enum":["takeover","handover"],"description":"The type of ticket creation: takeover (human intervention) or handover (agent automatic creation)."},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"lastViewedAt":{"type":"string","nullable":true,"format":"date-time","description":"The last time the ticket was viewed by the assignee."},"ongoingAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["pending","ongoing","completed"]},"summary":{"type":"string","description":"A brief summary of the chat up until the ticket was created."},"ticketingTeamId":{"type":"string","nullable":true,"format":"uuid","description":"The id of the ticketing team responsible for the ticket."}},"required":["createdAt","id","updatedAt","assigneeId","chatId","circumstance","completedAt","lastViewedAt","ongoingAt","status","summary","ticketingTeamId"]}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"404":{"description":"Ticket not found or assignee not found.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}},"412":{"description":"Ticket is completed.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The error code."},"cta":{"type":"object","properties":{"type":{"type":"string","enum":["support-contact"]},"url":{"type":"string","format":"uri"}},"required":["type","url"],"description":"The error call-to-action."},"feedback":{"type":"object","properties":{"enUs":{"type":"string"},"esEs":{"type":"string"},"ptBr":{"type":"string"}},"description":"The error feedback."},"message":{"type":"string","description":"The error message."},"name":{"type":"string","description":"The error name."}},"required":["feedback","message","name"],"description":"The description of a known exception."}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zaia.app/documentation/api-reference-alpha/reference/tickets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
