> For the complete documentation index, see [llms.txt](https://developers.clashperk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.clashperk.com/tickets.md). Agents can also search and read this documentation through its [MCP server](https://developers.clashperk.com/~gitbook/mcp).

# Tickets

Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only.

## GET /tickets/{guildId}

> Get the server's ticket panels and saved replies

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}":{"get":{"operationId":"getTicketSettings","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get the server's ticket panels and saved replies","tags":["Tickets"]}}}}
```

## List tickets opened in the server

> Newest first, 25 per page. To get the next page, pass the \`nextCursor\` from the response as \`before\`.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"TicketStatus":{"type":"string","enum":["open","sleep","closed"]},"TicketListDto":{"type":"object","properties":{"tickets":{"type":"array","items":{"$ref":"#/components/schemas/TicketDto"}},"counts":{"$ref":"#/components/schemas/TicketCountsDto"},"total":{"type":"number","description":"Tickets matching the status filter, across every page."},"nextCursor":{"type":["string","null"],"description":"Pass as `before` for the next 25. Null on the last page."}},"required":["tickets","counts","total","nextCursor"]},"TicketDto":{"type":"object","properties":{"status":{"allOf":[{"$ref":"#/components/schemas/TicketStatus"}]},"channelStatus":{"allOf":[{"$ref":"#/components/schemas/ChannelStatus"}]},"id":{"type":"string"},"number":{"type":"number","description":"The ticket's number in the server."},"panelId":{"type":"string"},"panelName":{"type":["string","null"],"description":"Null when the panel was deleted."},"typeId":{"type":"string"},"typeLabel":{"type":["string","null"],"description":"Null when the type was deleted."},"typeEmoji":{"type":["string","null"]},"openedBy":{"$ref":"#/components/schemas/TicketMemberDto"},"claimedBy":{"anyOf":[{"$ref":"#/components/schemas/TicketMemberDto"},{"type":"null"}]},"closedBy":{"anyOf":[{"$ref":"#/components/schemas/TicketMemberDto"},{"type":"null"}]},"accountTag":{"type":["string","null"],"description":"The linked game account the member picked, if the type asked for one."},"accountName":{"type":["string","null"]},"channelId":{"type":"string"},"channelName":{"type":["string","null"],"description":"Null once the channel is deleted, which closing does."},"staffThreadId":{"type":["string","null"]},"createdAt":{"format":"date-time","type":"string"},"closedAt":{"format":"date-time","type":["string","null"]}},"required":["status","channelStatus","id","number","panelId","panelName","typeId","typeLabel","typeEmoji","openedBy","claimedBy","closedBy","accountTag","accountName","channelId","channelName","staffThreadId","createdAt","closedAt"]},"ChannelStatus":{"type":"string","enum":["ok","archived","locked","deleted","noAccess","unknown"]},"TicketMemberDto":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":["string","null"],"description":"From Discord, or the name the bot last saw for someone who left. Null when neither is known."},"avatarUrl":{"type":["string","null"],"description":"Null when they aren't in the server."}},"required":["id","displayName","avatarUrl"]},"TicketCountsDto":{"type":"object","properties":{"open":{"type":"number"},"sleep":{"type":"number"},"closed":{"type":"number"}},"required":["open","sleep","closed"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/list":{"get":{"description":"Newest first, 25 per page. To get the next page, pass the `nextCursor` from the response as `before`.","operationId":"listTickets","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/TicketStatus"}},{"name":"before","required":false,"in":"query","description":"The `nextCursor` of the page before, for the tickets opened before it.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketListDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List tickets opened in the server","tags":["Tickets"]}}}}
```

## Close an opened ticket

> Does the same as the Close button in Discord. A transcript of the ticket and its staff thread goes to the ticket close log, the ticket type's role changes are undone, Notify Me subscribers get a DM, and the channel is deleted.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/{ticketId}/close":{"post":{"description":"Does the same as the Close button in Discord. A transcript of the ticket and its staff thread goes to the ticket close log, the ticket type's role changes are undone, Notify Me subscribers get a DM, and the channel is deleted.","operationId":"closeTicket","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"ticketId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Close an opened ticket","tags":["Tickets"]}}}}
```

## Create a ticket panel

> The panel starts with default settings and one General ticket type. Each panel in a server needs a different name.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"CreateTicketPanelInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]},"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/panels":{"post":{"description":"The panel starts with default settings and one General ticket type. Each panel in a server needs a different name.","operationId":"createTicketPanel","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTicketPanelInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Create a ticket panel","tags":["Tickets"]}}}}
```

## Delete a ticket panel

> Tickets already opened from it aren't affected. Its message in Discord stops opening new tickets.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/panels/{panelId}":{"delete":{"description":"Tickets already opened from it aren't affected. Its message in Discord stops opening new tickets.","operationId":"deleteTicketPanel","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"panelId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Delete a ticket panel","tags":["Tickets"]}}}}
```

## Update a ticket panel

> You only need to send the fields you want to change. If the panel is already posted in Discord, post it again to show the changes.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"TicketPanelInput":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"name":{"type":"string","minLength":1,"maxLength":100},"embed":{"$ref":"#/components/schemas/TicketEmbedInput"},"button":{"$ref":"#/components/schemas/TicketButtonInput"},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsInput"},"extraButtons":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonInput"}},"extraButtonsPlacement":{"type":"string","description":"`row` keeps extra buttons beside the type buttons; `col` starts a new row.","enum":["row","col"]},"saveTranscripts":{"type":"boolean","description":"Post a transcript to the ticket close log when a ticket closes."}}},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedInput":{"type":"object","properties":{"title":{"type":["string","null"],"minLength":1,"maxLength":256},"description":{"type":["string","null"],"minLength":1,"maxLength":2000},"color":{"type":["number","null"],"minimum":1,"maximum":16777215},"imageUrl":{"type":["string","null"],"maxLength":512,"format":"uri"},"thumbnailUrl":{"type":["string","null"],"maxLength":512,"format":"uri"},"footerText":{"type":["string","null"],"minLength":1,"maxLength":2048}}},"TicketButtonInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"emoji":{"type":["string","null"],"maxLength":56},"style":{"type":"number","description":"Discord button style: 1 blue, 2 grey, 3 green, 4 red.","minimum":1,"maximum":4}},"required":["label","style"]},"TicketLogChannelsInput":{"type":"object","properties":{"buttonClick":{"type":["string","null"],"description":"Every click on the panel."},"statusChange":{"type":["string","null"],"description":"Tickets put to sleep, reopened or claimed."},"ticketClose":{"type":["string","null"],"description":"Closed tickets, with a transcript when the panel saves them."}}},"TicketExtraButtonInput":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"label":{"type":"string","minLength":1,"maxLength":80},"emoji":{"type":["string","null"],"maxLength":56},"style":{"type":"number","description":"Ignored for link buttons, which Discord always shows grey.","minimum":1,"maximum":4},"url":{"type":"string","maxLength":256,"format":"uri"}},"required":["kind","label"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/panels/{panelId}":{"patch":{"description":"You only need to send the fields you want to change. If the panel is already posted in Discord, post it again to show the changes.","operationId":"updateTicketPanel","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"panelId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPanelInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Update a ticket panel","tags":["Tickets"]}}}}
```

## Add a ticket type to a panel

> A panel can have up to 25 ticket types.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"CreateTicketTypeInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"emoji":{"type":["string","null"],"maxLength":56}},"required":["label"]},"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/panels/{panelId}/types":{"post":{"description":"A panel can have up to 25 ticket types.","operationId":"addTicketType","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"panelId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTicketTypeInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Add a ticket type to a panel","tags":["Tickets"]}}}}
```

## Reorder a panel's ticket types

> Send all of the panel's ticket type IDs, each once, in the order you want.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"ReorderTicketTypesInput":{"type":"object","properties":{"typeIds":{"maxItems":25,"type":"array","items":{"type":"string"}}},"required":["typeIds"]},"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/panels/{panelId}/types/order":{"put":{"description":"Send all of the panel's ticket type IDs, each once, in the order you want.","operationId":"reorderTicketTypes","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"panelId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderTicketTypesInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Reorder a panel's ticket types","tags":["Tickets"]}}}}
```

## Delete a ticket type

> Tickets already opened with this type stay open.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/panels/{panelId}/types/{typeId}":{"delete":{"description":"Tickets already opened with this type stay open.","operationId":"deleteTicketType","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"panelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"typeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Delete a ticket type","tags":["Tickets"]}}}}
```

## Update a ticket type

> You only need to send the fields you want to change.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"TicketTypeInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"emoji":{"type":["string","null"],"maxLength":56},"buttonStyle":{"type":"number","description":"Used in buttons mode.","minimum":1,"maximum":4},"requireLinkedAccount":{"type":"boolean","description":"Requirements below only apply when this is on."},"thMin":{"type":["number","null"],"minimum":1,"maximum":20},"minTrophies":{"type":["number","null"],"minimum":1,"maximum":10000},"minLeagueTier":{"type":["string","null"],"description":"105000013 (Valkyrie League 13) to 105000036 (Legend League).","pattern":"^1050000(1[3-9]|2\\d|3[0-6])$"},"questions":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionInput"}},"pingRoleIds":{"description":"Pinged on new tickets, and staff on them.","maxItems":10,"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"maxItems":10,"type":"array","items":{"type":"string"}},"addRoleIds":{"description":"Given to the member who opens the ticket.","maxItems":10,"type":"array","items":{"type":"string"}},"removeRoleIds":{"description":"Taken from the member who opens the ticket.","maxItems":10,"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string","description":"`{count}`, `{user}`, `{account_name}` and `{account_th}` are filled in.","minLength":1,"maxLength":64},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"],"minimum":1,"maximum":999},"allowClaim":{"type":"boolean"}}},"TicketQuestionInput":{"type":"object","properties":{"label":{"type":"string","description":"Discord shows at most 45 characters in the form.","minLength":1,"maxLength":45},"required":{"type":"boolean"}},"required":["label","required"]},"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/panels/{panelId}/types/{typeId}":{"patch":{"description":"You only need to send the fields you want to change.","operationId":"updateTicketType","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"panelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"typeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketTypeInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Update a ticket type","tags":["Tickets"]}}}}
```

## Replace the server's saved ticket replies

> Staff can use these replies in any ticket in the server. You can save up to 25, and each needs a different name.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Tickets","description":"Ticket panels, ticket types, saved replies and opened tickets. Dashboard sessions only."}],"servers":[{"url":"/v1","description":"[latest]"},{"url":"/v2","description":"[unstable]"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"in header (authorization: bearer [token])"}},"schemas":{"TicketSavedRepliesInput":{"type":"object","properties":{"savedReplies":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyInput"}}},"required":["savedReplies"]},"TicketSavedReplyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"content":{"type":"string","minLength":1,"maxLength":1800}},"required":["name","content"]},"TicketsDto":{"type":"object","properties":{"panels":{"type":"array","items":{"$ref":"#/components/schemas/TicketPanelDto"}},"savedReplies":{"type":"array","items":{"$ref":"#/components/schemas/TicketSavedReplyDto"}}},"required":["panels","savedReplies"]},"TicketPanelDto":{"type":"object","properties":{"displayMode":{"allOf":[{"$ref":"#/components/schemas/TicketDisplayMode"}]},"id":{"type":"string"},"name":{"type":"string"},"embed":{"$ref":"#/components/schemas/TicketEmbedDto"},"button":{"$ref":"#/components/schemas/TicketButtonDto"},"ticketTypes":{"type":"array","items":{"$ref":"#/components/schemas/TicketTypeDto"}},"logChannels":{"$ref":"#/components/schemas/TicketLogChannelsDto"},"extraButtons":{"type":"array","items":{"$ref":"#/components/schemas/TicketExtraButtonDto"}},"extraButtonsPlacement":{"type":"string"},"saveTranscripts":{"type":"boolean"},"ticketCount":{"type":"number"},"openTicketCount":{"type":"number"},"updatedAt":{"format":"date-time","type":"string"}},"required":["displayMode","id","name","embed","button","ticketTypes","logChannels","extraButtons","extraButtonsPlacement","saveTranscripts","ticketCount","openTicketCount","updatedAt"]},"TicketDisplayMode":{"type":"string","enum":["menu","buttons"]},"TicketEmbedDto":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"color":{"type":["number","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"footerText":{"type":["string","null"]}},"required":["title","description","color","imageUrl","thumbnailUrl","footerText"]},"TicketButtonDto":{"type":"object","properties":{"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"}},"required":["label","emoji","style"]},"TicketTypeDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"buttonStyle":{"type":"number"},"requireLinkedAccount":{"type":"boolean"},"thMin":{"type":["number","null"]},"minTrophies":{"type":["number","null"]},"minLeagueTier":{"type":["string","null"]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/TicketQuestionDto"}},"pingRoleIds":{"type":"array","items":{"type":"string"}},"viewOnlyRoleIds":{"type":"array","items":{"type":"string"}},"addRoleIds":{"type":"array","items":{"type":"string"}},"removeRoleIds":{"type":"array","items":{"type":"string"}},"openCategoryId":{"type":["string","null"]},"sleepCategoryId":{"type":["string","null"]},"namingConvention":{"type":"string"},"createStaffThread":{"type":"boolean"},"autoSleepHours":{"type":["number","null"]},"allowClaim":{"type":"boolean"}},"required":["id","label","emoji","buttonStyle","requireLinkedAccount","thMin","minTrophies","minLeagueTier","questions","pingRoleIds","viewOnlyRoleIds","addRoleIds","removeRoleIds","openCategoryId","sleepCategoryId","namingConvention","createStaffThread","autoSleepHours","allowClaim"]},"TicketQuestionDto":{"type":"object","properties":{"label":{"type":"string"},"required":{"type":"boolean"}},"required":["label","required"]},"TicketLogChannelsDto":{"type":"object","properties":{"buttonClick":{"type":["string","null"]},"statusChange":{"type":["string","null"]},"ticketClose":{"type":["string","null"]}},"required":["buttonClick","statusChange","ticketClose"]},"TicketExtraButtonDto":{"type":"object","properties":{"kind":{"allOf":[{"$ref":"#/components/schemas/TicketExtraButtonKind"}]},"id":{"type":"string"},"label":{"type":"string"},"emoji":{"type":["string","null"]},"style":{"type":"number"},"url":{"type":["string","null"]}},"required":["kind","id","label","emoji","style","url"]},"TicketExtraButtonKind":{"type":"string","enum":["link-account","url"]},"TicketSavedReplyDto":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"}},"required":["name","content"]},"ErrorResponseDto":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/ErrorCodes"}]},"message":{"type":"string"},"statusCode":{"type":"number"},"method":{"type":"string"},"path":{"type":"string"}},"required":["code","message","statusCode","method","path"]},"ErrorCodes":{"type":"string","enum":["FORBIDDEN","UNAUTHORIZED","NOT_FOUND","BAD_REQUEST","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","HANDOFF_TOKEN_EXPIRED","USER_BLOCKED","INVALID_PASSKEY","GUILD_ACCESS_FORBIDDEN","BOT_NOT_IN_GUILD","GIVEAWAY_NOT_FOUND","GIVEAWAY_NOT_ACTIVE","GIVEAWAY_ALREADY_DRAWN","GIVEAWAY_ALREADY_ENTERED","GIVEAWAY_NO_LINKED_ACCOUNT","GIVEAWAY_NOT_IN_CLAN"]}}},"paths":{"/tickets/{guildId}/saved-replies":{"put":{"description":"Staff can use these replies in any ticket in the server. You can save up to 25, and each needs a different name.","operationId":"replaceSavedReplies","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSavedRepliesInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Replace the server's saved ticket replies","tags":["Tickets"]}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.clashperk.com/tickets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
