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

# Clans

Clan details, member activity, links, capital raids and clan games.

## List recent activity in clans

> Deprecated: send the same request with the \`QUERY\` method. This route is removed on 2026-11-25.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"ClanActivityInputDto":{"type":"object","properties":{"clanTags":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string"}},"days":{"type":"number","default":7,"minimum":1,"maximum":30},"limit":{"type":"number","default":50,"minimum":1,"maximum":100},"types":{"type":"array","description":"Only these event types; all of them when omitted.","default":["town_hall_upgrade","joined","left","clan_level_up","capital_hall_level_up","war_league_change","capital_league_change"],"minItems":1,"items":{"$ref":"#/components/schemas/ClanActivityType"}}},"required":["clanTags"]},"ClanActivityType":{"type":"string","enum":["town_hall_upgrade","joined","left","clan_level_up","capital_hall_level_up","war_league_change","capital_league_change"],"description":"Only these event types; all of them when omitted."},"ClanActivityDto":{"type":"object","properties":{"items":{"description":"Newest first.","type":"array","items":{"$ref":"#/components/schemas/ClanActivityItemDto"}}},"required":["items"]},"ClanActivityItemDto":{"type":"object","properties":{"type":{"allOf":[{"$ref":"#/components/schemas/ClanActivityType"}]},"player":{"description":"Who it happened to; null for clan-wide events.","anyOf":[{"$ref":"#/components/schemas/ClanActivityPlayerDto"},{"type":"null"}]},"level":{"type":["number","null"],"description":"The new Town Hall, clan or Capital Hall level; null otherwise."},"league":{"type":["string","null"],"description":"The new war or capital league; null otherwise."},"createdAt":{"format":"date-time","type":"string"},"clan":{"$ref":"#/components/schemas/ClanActivityClanDto"}},"required":["type","player","level","league","createdAt","clan"]},"ClanActivityPlayerDto":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":"string"}},"required":["tag","name"]},"ClanActivityClanDto":{"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":{"/clans/activity":{"post":{"deprecated":true,"description":"Deprecated: send the same request with the `QUERY` method. This route is removed on 2026-11-25.","operationId":"getClanActivityViaPost","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClanActivityInputDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClanActivityDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List recent activity in clans","tags":["Clans"]}}}}
```

## GET /clans/{clanTag}

> Get a clan's profile

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"ClanDto":{"type":"object","properties":{"type":{"enum":["open","inviteOnly","closed"],"type":"string"},"warFrequency":{"enum":["always","moreThanOncePerWeek","oncePerWeek","lessThanOncePerWeek","never","unknown"],"type":"string"},"tag":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"location":{"$ref":"#/components/schemas/LocationDto"},"chatLanguage":{"$ref":"#/components/schemas/ChatLanguageDto"},"badgeUrls":{"$ref":"#/components/schemas/ClanBadge"},"clanLevel":{"type":"number"},"clanPoints":{"type":"number"},"clanBuilderBasePoints":{"type":"number"},"requiredTrophies":{"type":"number"},"requiredTownhallLevel":{"type":"number"},"requiredBuilderBaseTrophies":{"type":"number"},"warWinStreak":{"type":"number"},"warWins":{"type":"number"},"warTies":{"type":"number"},"warLosses":{"type":"number"},"isWarLogPublic":{"type":"boolean"},"warLeague":{"$ref":"#/components/schemas/NamedLeagueDto"},"members":{"type":"number"},"labels":{"type":"array","items":{"$ref":"#/components/schemas/LabelDto"}},"memberList":{"type":"array","items":{"$ref":"#/components/schemas/ClanMemberDto"}},"clanCapital":{"$ref":"#/components/schemas/ClanCapitalDto"},"isFamilyFriendly":{"type":"boolean"},"clanCapitalPoints":{"type":"number"},"capitalLeague":{"$ref":"#/components/schemas/NamedLeagueDto"}},"required":["type","tag","name","description","badgeUrls","clanLevel","clanPoints","clanBuilderBasePoints","requiredTrophies","warWinStreak","warWins","isWarLogPublic","members","labels","memberList","clanCapital","isFamilyFriendly","clanCapitalPoints"]},"LocationDto":{"type":"object","properties":{"localizedName":{"type":"string"},"id":{"type":"number"},"name":{"type":"string"},"isCountry":{"type":"boolean"},"countryCode":{"type":"string"}},"required":["id","name","isCountry"]},"ChatLanguageDto":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"number"},"languageCode":{"type":"string"}},"required":["name","id","languageCode"]},"ClanBadge":{"type":"object","properties":{"large":{"type":"string"},"small":{"type":"string"},"medium":{"type":"string"}},"required":["large","small","medium"]},"NamedLeagueDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"LabelDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"iconUrls":{"$ref":"#/components/schemas/IconUrlsDto"}},"required":["id","name","iconUrls"]},"IconUrlsDto":{"type":"object","properties":{"small":{"type":"string"},"tiny":{"type":"string"},"medium":{"type":"string"}},"required":["small"]},"ClanMemberDto":{"type":"object","properties":{"role":{"enum":["member","admin","coLeader","leader"],"type":"string"},"name":{"type":"string"},"tag":{"type":"string"},"expLevel":{"type":"number"},"townHallLevel":{"type":"number"},"leagueTier":{"$ref":"#/components/schemas/LeagueTierDto"},"builderBaseLeague":{"$ref":"#/components/schemas/NamedLeagueDto"},"trophies":{"type":"number"},"builderBaseTrophies":{"type":"number"},"clanRank":{"type":"number"},"previousClanRank":{"type":"number"},"donations":{"type":"number"},"donationsReceived":{"type":"number"},"playerHouse":{"$ref":"#/components/schemas/PlayerHouseDto"}},"required":["role","name","tag","expLevel","townHallLevel","leagueTier","trophies","clanRank","previousClanRank","donations","donationsReceived"]},"LeagueTierDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"iconUrls":{"$ref":"#/components/schemas/LeagueTierIconUrlsDto"}},"required":["id","name","iconUrls"]},"LeagueTierIconUrlsDto":{"type":"object","properties":{"small":{"type":"string"},"large":{"type":"string"}},"required":["small","large"]},"PlayerHouseDto":{"type":"object","properties":{"elements":{"type":"array","items":{"$ref":"#/components/schemas/PlayerHouseElementDto"}}},"required":["elements"]},"PlayerHouseElementDto":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"number"}},"required":["type","id"]},"ClanCapitalDto":{"type":"object","properties":{"capitalHallLevel":{"type":"number"},"districts":{"type":"array","items":{"$ref":"#/components/schemas/ClanCapitalDistrictDto"}}}},"ClanCapitalDistrictDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"districtHallLevel":{"type":"number"}},"required":["id","name","districtHallLevel"]},"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":{"/clans/{clanTag}":{"get":{"operationId":"getClan","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClanDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get a clan's profile","tags":["Clans"]}}}}
```

## Get last-seen times for a clan's members

> Shows when each member was last active, and how active they've been over the last day and the last 30 days. Members ClashPerk hasn't seen yet are left out.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"LastSeenDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LastSeenMemberDto"}}},"required":["items"]},"LastSeenMemberDto":{"type":"object","properties":{"clan":{"$ref":"#/components/schemas/LastSeenMemberClan"},"name":{"type":"string"},"tag":{"type":"string"},"lastSeen":{"format":"date-time","type":"string"},"leagueId":{"type":"number"},"townHallLevel":{"type":"number"},"scores":{"type":"object","properties":{"last24h":{"type":"number"},"last30d":{"type":"number"}},"required":["last24h","last30d"]}},"required":["name","tag","lastSeen","leagueId","townHallLevel","scores"]},"LastSeenMemberClan":{"type":"object","properties":{"name":{"type":"string"},"tag":{"type":"string"}},"required":["name","tag"]},"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":{"/clans/{clanTag}/lastseen":{"get":{"description":"Shows when each member was last active, and how active they've been over the last day and the last 30 days. Members ClashPerk hasn't seen yet are left out.","operationId":"getClanLastSeen","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LastSeenDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get last-seen times for a clan's members","tags":["Clans"]}}}}
```

## Get a clan's legend battle totals for one day

> Covers members in Legend League. Members with no battles logged that day are left out.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"BattleLogAggregateItemsDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BattleLogDailyDto"}}},"required":["items"]},"BattleLogDailyDto":{"type":"object","properties":{"name":{"type":"string"},"tag":{"type":"string"},"battleDate":{"type":"string"},"trophies":{"type":"number"},"offenseTrophies":{"type":"number"},"defenseTrophies":{"type":"number"},"gain":{"type":"number"},"attackCount":{"type":"number"},"defenseCount":{"type":"number"}},"required":["name","tag","battleDate","trophies","offenseTrophies","defenseTrophies","gain","attackCount","defenseCount"]},"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":{"/clans/{clanTag}/legend-battles/daily":{"get":{"description":"Covers members in Legend League. Members with no battles logged that day are left out.","operationId":"getClanDailyLegendBattles","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}},{"name":"battleDate","required":true,"in":"query","description":"The battle day, which starts at 05:00 UTC.","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BattleLogAggregateItemsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get a clan's legend battle totals for one day","tags":["Clans"]}}}}
```

## Rank a clan's members by Legend League trophies

> Uses the current members. For a past season, each member's trophies are where they finished it.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"BattleLogLeaderboardDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BattleLogLeaderboardItemDto"}}},"required":["items"]},"BattleLogLeaderboardItemDto":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":"string"},"trophies":{"type":"number"}},"required":["tag","name","trophies"]},"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":{"/clans/{clanTag}/legend-battles/leaderboard":{"get":{"description":"Uses the current members. For a past season, each member's trophies are where they finished it.","operationId":"getClanLegendLeaderboard","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}},{"name":"seasonId","required":false,"in":"query","description":"The league season's start date. Defaults to the current season.","schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BattleLogLeaderboardDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Rank a clan's members by Legend League trophies","tags":["Clans"]}}}}
```

## List a clan's Capital Gold contributions

> Pass a month such as \`2026-10\` to see that month. Without one, you get the last 10 days.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"CapitalContributionDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CapitalContributionItemDto"}}},"required":["items"]},"CapitalContributionItemDto":{"type":"object","properties":{"name":{"type":"string"},"tag":{"type":"string"},"season":{"type":"string"},"initial":{"type":"number"},"current":{"type":"number"},"clan":{"$ref":"#/components/schemas/CapitalContributionClanDto"},"createdAt":{"format":"date-time","type":"string"}},"required":["name","tag","season","initial","current","clan","createdAt"]},"CapitalContributionClanDto":{"type":"object","properties":{"name":{"type":"string"},"tag":{"type":"string"}},"required":["name","tag"]},"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":{"/clans/{clanTag}/capital-contribution":{"get":{"description":"Pass a month such as `2026-10` to see that month. Without one, you get the last 10 days.","operationId":"getClanCapitalContributions","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}},{"name":"season","required":false,"in":"query","schema":{"pattern":"^\\d{4}-\\d{2}$","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapitalContributionDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List a clan's Capital Gold contributions","tags":["Clans"]}}}}
```

## GET /clans/{clanTag}/capital-raids

> List a clan's Capital raid weekends

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"CapitalRaidsDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CapitalRaidSeasonDto"}}},"required":["items"]},"CapitalRaidSeasonDto":{"type":"object","properties":{"name":{"type":"string"},"tag":{"type":"string"},"state":{"type":"string"},"members":{"type":"array","items":{"$ref":"#/components/schemas/CapitalRaidMemberDto"}},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"offensiveReward":{"type":"number"},"defensiveReward":{"type":"number"},"capitalTotalLoot":{"type":"number"},"totalAttacks":{"type":"number"},"enemyDistrictsDestroyed":{"type":"number"},"raidsCompleted":{"type":"number"}},"required":["name","tag","state","members","startDate","endDate","offensiveReward","defensiveReward","capitalTotalLoot","totalAttacks","enemyDistrictsDestroyed","raidsCompleted"]},"CapitalRaidMemberDto":{"type":"object","properties":{"name":{"type":"string"},"tag":{"type":"string"},"attacks":{"type":"number"},"attackLimit":{"type":"number"},"bonusAttackLimit":{"type":"number"},"capitalResourcesLooted":{"type":"number"}},"required":["name","tag","attacks","attackLimit","bonusAttackLimit","capitalResourcesLooted"]},"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":{"/clans/{clanTag}/capital-raids":{"get":{"operationId":"getClanCapitalRaids","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":60,"default":5,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapitalRaidsDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List a clan's Capital raid weekends","tags":["Clans"]}}}}
```

## GET /clans/{clanTag}/clan-games

> Get a clan's Clan Games points

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"ClanGamesDto":{"type":"object","properties":{"season":{"type":"string"},"startTime":{"format":"date-time","type":"string"},"endTime":{"format":"date-time","type":"string"},"maxPoints":{"type":"number","description":"Most points one member can earn."},"totalPoints":{"type":"number","description":"Sum of each member's points, capped at `maxPoints`."},"members":{"type":"array","items":{"$ref":"#/components/schemas/ClanGamesMemberDto"}}},"required":["season","startTime","endTime","maxPoints","totalPoints","members"]},"ClanGamesMemberDto":{"type":"object","properties":{"completedAt":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"tag":{"type":"string"},"points":{"type":"number"}},"required":["completedAt","name","tag","points"]},"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":{"/clans/{clanTag}/clan-games":{"get":{"operationId":"getClanGames","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}},{"name":"season","required":false,"in":"query","description":"`YYYY-MM`; defaults to the latest Clan Games (last month's until the 20th).","schema":{"pattern":"^\\d{4}-\\d{2}$","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClanGamesDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"Get a clan's Clan Games points","tags":["Clans"]}}}}
```

## List a clan's members with their Discord links

> Also tells you which of these links you're allowed to remove.

```json
{"openapi":"3.2.0","info":{"title":"ClashPerk Discord Bot API","version":"v2.0.192"},"tags":[{"name":"Clans","description":"Clan details, member activity, links, capital raids and clan games."}],"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":{"ClanLinksDto":{"type":"object","properties":{"name":{"type":"string"},"tag":{"type":"string"},"members":{"type":"number"},"memberList":{"type":"array","items":{"$ref":"#/components/schemas/ClanLinkedMemberDto"}}},"required":["name","tag","members","memberList"]},"ClanLinkedMemberDto":{"type":"object","properties":{"userId":{"type":["string","null"]},"username":{"type":["string","null"]},"displayName":{"type":["string","null"]},"name":{"type":"string"},"tag":{"type":"string"},"role":{"type":"string"},"townHallLevel":{"type":"number"},"verified":{"type":"boolean"},"deletable":{"type":"boolean"}},"required":["name","tag","role","townHallLevel","verified","deletable"]},"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":{"/clans/{clanTag}/links":{"get":{"description":"Also tells you which of these links you're allowed to remove.","operationId":"getClanLinks","parameters":[{"name":"clanTag","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClanLinksDto"}}}},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"summary":"List a clan's members with their Discord links","tags":["Clans"]}}}}
```


---

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