> 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/giveaways.md). Agents can also search and read this documentation through its [MCP server](https://developers.clashperk.com/~gitbook/mcp).

# Giveaways

Giveaways: create, enter, draw and reroll. Dashboard sessions only.

## GET /giveaways/{guildId}

> List the server's giveaways

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"GiveawaysDto":{"type":"object","properties":{"giveaways":{"type":"array","items":{"$ref":"#/components/schemas/GiveawayDto"}}},"required":["giveaways"]},"GiveawayDto":{"type":"object","properties":{"id":{"type":"string"},"guildId":{"type":"string"},"channelId":{"type":"string"},"messageId":{"type":["string","null"]},"hostUserId":{"type":"string"},"hostName":{"type":["string","null"]},"prize":{"type":"string"},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"winnerCount":{"type":"number"},"eligibility":{"$ref":"#/components/schemas/GiveawayEligibilityDto"},"status":{"type":"string"},"entryCount":{"type":"number"},"winners":{"type":"array","items":{"type":"string"}},"endsAt":{"type":"number"},"endedAt":{"type":["number","null"]},"createdAt":{"type":"number"}},"required":["id","guildId","channelId","messageId","hostUserId","hostName","prize","title","description","imageUrl","winnerCount","eligibility","status","entryCount","winners","endsAt","endedAt","createdAt"]},"GiveawayEligibilityDto":{"type":"object","properties":{"mode":{"allOf":[{"$ref":"#/components/schemas/GiveawayMode"}]},"allGuildClans":{"type":"boolean"},"clanTags":{"type":"array","items":{"type":"string"}},"boostFactor":{"type":["number","null"]}},"required":["mode","allGuildClans","clanTags","boostFactor"]},"GiveawayMode":{"type":"string","enum":["open","boosted","restricted"]},"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":{"/giveaways/{guildId}":{"get":{"operationId":"listGiveaways","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawaysDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List the server's giveaways","tags":["Giveaways"]}}}}
```

## Create a giveaway

> ClashPerk posts it in the channel within a few seconds. Set the end time as a date or epoch milliseconds, up to 60 days ahead. The image must be a public link to a picture.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"CreateGiveawayInput":{"type":"object","properties":{"endsAt":{"type":"string","description":"Date string or timestamp in milliseconds","format":"date-time"},"channelId":{"type":"string"},"hostUserId":{"type":"string"},"applicationId":{"type":"string","description":"The bot that posts and runs it. Only an API-key caller (a bot) can set it."},"hostName":{"type":"string","description":"The host's Discord name, shown on the dashboard.","maxLength":100},"prize":{"type":"string","minLength":1,"maxLength":256},"title":{"type":"string","description":"Replaces the \"🎉 Giveaway · prize\" heading on the posted message.","maxLength":100},"description":{"type":"string","description":"Replaces the line under the heading. Markdown.","maxLength":1000},"imageUrl":{"type":"string","maxLength":2048,"format":"uri"},"winnerCount":{"type":"number","minimum":1,"maximum":50},"eligibility":{"$ref":"#/components/schemas/GiveawayEligibilityInput"}},"required":["endsAt","channelId","hostUserId","prize","winnerCount","eligibility"]},"GiveawayEligibilityInput":{"type":"object","properties":{"mode":{"allOf":[{"$ref":"#/components/schemas/GiveawayMode"}]},"allGuildClans":{"type":"boolean"},"clanTags":{"uniqueItems":true,"maxItems":100,"type":"array","items":{"type":"string"}},"boostFactor":{"type":"number","minimum":2,"maximum":100}},"required":["mode"]},"GiveawayMode":{"type":"string","enum":["open","boosted","restricted"]},"GiveawayDto":{"type":"object","properties":{"id":{"type":"string"},"guildId":{"type":"string"},"channelId":{"type":"string"},"messageId":{"type":["string","null"]},"hostUserId":{"type":"string"},"hostName":{"type":["string","null"]},"prize":{"type":"string"},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"winnerCount":{"type":"number"},"eligibility":{"$ref":"#/components/schemas/GiveawayEligibilityDto"},"status":{"type":"string"},"entryCount":{"type":"number"},"winners":{"type":"array","items":{"type":"string"}},"endsAt":{"type":"number"},"endedAt":{"type":["number","null"]},"createdAt":{"type":"number"}},"required":["id","guildId","channelId","messageId","hostUserId","hostName","prize","title","description","imageUrl","winnerCount","eligibility","status","entryCount","winners","endsAt","endedAt","createdAt"]},"GiveawayEligibilityDto":{"type":"object","properties":{"mode":{"allOf":[{"$ref":"#/components/schemas/GiveawayMode"}]},"allGuildClans":{"type":"boolean"},"clanTags":{"type":"array","items":{"type":"string"}},"boostFactor":{"type":["number","null"]}},"required":["mode","allGuildClans","clanTags","boostFactor"]},"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":{"/giveaways/{guildId}":{"post":{"description":"ClashPerk posts it in the channel within a few seconds. Set the end time as a date or epoch milliseconds, up to 60 days ahead. The image must be a public link to a picture.","operationId":"createGiveaway","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGiveawayInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawayDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Create a giveaway","tags":["Giveaways"]}}}}
```

## GET /giveaways/{guildId}/{giveawayId}

> Get one giveaway

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"GiveawayDto":{"type":"object","properties":{"id":{"type":"string"},"guildId":{"type":"string"},"channelId":{"type":"string"},"messageId":{"type":["string","null"]},"hostUserId":{"type":"string"},"hostName":{"type":["string","null"]},"prize":{"type":"string"},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"winnerCount":{"type":"number"},"eligibility":{"$ref":"#/components/schemas/GiveawayEligibilityDto"},"status":{"type":"string"},"entryCount":{"type":"number"},"winners":{"type":"array","items":{"type":"string"}},"endsAt":{"type":"number"},"endedAt":{"type":["number","null"]},"createdAt":{"type":"number"}},"required":["id","guildId","channelId","messageId","hostUserId","hostName","prize","title","description","imageUrl","winnerCount","eligibility","status","entryCount","winners","endsAt","endedAt","createdAt"]},"GiveawayEligibilityDto":{"type":"object","properties":{"mode":{"allOf":[{"$ref":"#/components/schemas/GiveawayMode"}]},"allGuildClans":{"type":"boolean"},"clanTags":{"type":"array","items":{"type":"string"}},"boostFactor":{"type":["number","null"]}},"required":["mode","allGuildClans","clanTags","boostFactor"]},"GiveawayMode":{"type":"string","enum":["open","boosted","restricted"]},"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":{"/giveaways/{guildId}/{giveawayId}":{"get":{"operationId":"getGiveaway","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giveawayId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawayDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get one giveaway","tags":["Giveaways"]}}}}
```

## Update a giveaway

> Attach the posted message ID, or change the prize, winner count or end time.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"UpdateGiveawayInput":{"type":"object","properties":{"title":{"type":["string","null"],"description":"Null puts the default heading back.","maxLength":100},"description":{"type":["string","null"],"description":"Null puts the default line back.","maxLength":1000},"endsAt":{"type":"string","description":"Date string or timestamp in milliseconds","format":"date-time"},"messageId":{"type":"string"},"prize":{"type":"string","minLength":1,"maxLength":256},"winnerCount":{"type":"number","minimum":1,"maximum":50},"eligibility":{"description":"New clans or boost for an active giveaway. The mode can't change.","allOf":[{"$ref":"#/components/schemas/GiveawayEligibilityInput"}]}}},"GiveawayEligibilityInput":{"type":"object","properties":{"mode":{"allOf":[{"$ref":"#/components/schemas/GiveawayMode"}]},"allGuildClans":{"type":"boolean"},"clanTags":{"uniqueItems":true,"maxItems":100,"type":"array","items":{"type":"string"}},"boostFactor":{"type":"number","minimum":2,"maximum":100}},"required":["mode"]},"GiveawayMode":{"type":"string","enum":["open","boosted","restricted"]},"GiveawayDto":{"type":"object","properties":{"id":{"type":"string"},"guildId":{"type":"string"},"channelId":{"type":"string"},"messageId":{"type":["string","null"]},"hostUserId":{"type":"string"},"hostName":{"type":["string","null"]},"prize":{"type":"string"},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"winnerCount":{"type":"number"},"eligibility":{"$ref":"#/components/schemas/GiveawayEligibilityDto"},"status":{"type":"string"},"entryCount":{"type":"number"},"winners":{"type":"array","items":{"type":"string"}},"endsAt":{"type":"number"},"endedAt":{"type":["number","null"]},"createdAt":{"type":"number"}},"required":["id","guildId","channelId","messageId","hostUserId","hostName","prize","title","description","imageUrl","winnerCount","eligibility","status","entryCount","winners","endsAt","endedAt","createdAt"]},"GiveawayEligibilityDto":{"type":"object","properties":{"mode":{"allOf":[{"$ref":"#/components/schemas/GiveawayMode"}]},"allGuildClans":{"type":"boolean"},"clanTags":{"type":"array","items":{"type":"string"}},"boostFactor":{"type":["number","null"]}},"required":["mode","allGuildClans","clanTags","boostFactor"]},"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":{"/giveaways/{guildId}/{giveawayId}":{"patch":{"description":"Attach the posted message ID, or change the prize, winner count or end time.","operationId":"updateGiveaway","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giveawayId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGiveawayInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawayDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Update a giveaway","tags":["Giveaways"]}}}}
```

## List a giveaway's entrants

> Winners come first, then up to \`limit\` other entrants in the order they entered. Clans and tickets follow who is in the chosen clans right now.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"GiveawayEntriesDto":{"type":"object","properties":{"total":{"type":"number"},"winners":{"type":"array","items":{"$ref":"#/components/schemas/GiveawayEntryDto"}},"entries":{"description":"Everyone else, in entry order.","type":"array","items":{"$ref":"#/components/schemas/GiveawayEntryDto"}}},"required":["total","winners","entries"]},"GiveawayEntryDto":{"type":"object","properties":{"userId":{"type":"string"},"displayName":{"type":["string","null"],"description":"The Discord name saved with the user's linked accounts, when they have one."},"player":{"description":"The linked account that counts the entrant in a chosen clan.","anyOf":[{"$ref":"#/components/schemas/GiveawayEntryPlayerDto"},{"type":"null"}]},"clan":{"anyOf":[{"$ref":"#/components/schemas/GiveawayEntryClanDto"},{"type":"null"}]},"tickets":{"type":"number","description":"0 for a restricted entrant outside the chosen clans, who can't win."},"enteredAt":{"type":"number"}},"required":["userId","displayName","player","clan","tickets","enteredAt"]},"GiveawayEntryPlayerDto":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":["string","null"]}},"required":["tag","name"]},"GiveawayEntryClanDto":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":"string"}},"required":["tag","name"]},"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":{"/giveaways/{guildId}/{giveawayId}/entries":{"get":{"description":"Winners come first, then up to `limit` other entrants in the order they entered. Clans and tickets follow who is in the chosen clans right now.","operationId":"listGiveawayEntries","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giveawayId","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":500,"type":"number"}},{"name":"offset","required":false,"in":"query","schema":{"minimum":0,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawayEntriesDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List a giveaway's entrants","tags":["Giveaways"]}}}}
```

## Enter a giveaway

> One entry per user. Restricted giveaways reject a user who is not in a chosen clan.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"EnterGiveawayInput":{"type":"object","properties":{"userId":{"type":"string"},"displayName":{"type":"string","description":"The user's Discord name, shown in the entrant list.","maxLength":100}},"required":["userId"]},"GiveawayEntryResultDto":{"type":"object","properties":{"entryCount":{"type":"number"},"tickets":{"type":"number","description":"More than 1 when a boosted giveaway counts the user in a chosen clan."},"player":{"anyOf":[{"$ref":"#/components/schemas/GiveawayEntryPlayerDto"},{"type":"null"}]},"clan":{"anyOf":[{"$ref":"#/components/schemas/GiveawayEntryClanDto"},{"type":"null"}]}},"required":["entryCount","tickets","player","clan"]},"GiveawayEntryPlayerDto":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":["string","null"]}},"required":["tag","name"]},"GiveawayEntryClanDto":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":"string"}},"required":["tag","name"]},"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":{"/giveaways/{guildId}/{giveawayId}/enter":{"post":{"description":"One entry per user. Restricted giveaways reject a user who is not in a chosen clan.","operationId":"enterGiveaway","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giveawayId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterGiveawayInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawayEntryResultDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Enter a giveaway","tags":["Giveaways"]}}}}
```

## Draw a giveaway

> Picks the winners and ends the giveaway. Fails if it is already drawn.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"GiveawayDrawResultDto":{"type":"object","properties":{"winners":{"type":"array","items":{"type":"string"}},"entryCount":{"type":"number"}},"required":["winners","entryCount"]},"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":{"/giveaways/{guildId}/{giveawayId}/draw":{"post":{"description":"Picks the winners and ends the giveaway. Fails if it is already drawn.","operationId":"drawGiveaway","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giveawayId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawayDrawResultDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Draw a giveaway","tags":["Giveaways"]}}}}
```

## Reroll a giveaway

> Draws a fresh set of winners, skipping the previous ones.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"GiveawayDrawResultDto":{"type":"object","properties":{"winners":{"type":"array","items":{"type":"string"}},"entryCount":{"type":"number"}},"required":["winners","entryCount"]},"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":{"/giveaways/{guildId}/{giveawayId}/reroll":{"post":{"description":"Draws a fresh set of winners, skipping the previous ones.","operationId":"rerollGiveaway","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giveawayId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiveawayDrawResultDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Reroll a giveaway","tags":["Giveaways"]}}}}
```

## POST /giveaways/{guildId}/{giveawayId}/cancel

> Cancel a giveaway without drawing

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Giveaways","description":"Giveaways: create, enter, draw and reroll. 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":{"/giveaways/{guildId}/{giveawayId}/cancel":{"post":{"operationId":"cancelGiveaway","parameters":[{"name":"guildId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giveawayId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Cancel a giveaway without drawing","tags":["Giveaways"]}}}}
```


---

# 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/giveaways.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.
