Skip to main content

Overview

Teams are groups of users that participate in CTF games together. The Team API provides endpoints for creating teams, managing members, and handling invitations.

Team Operations

Get Team Info

Retrieve public information about a team.

GET /api/team/

id
integer
required
Team ID
{
  "id": 42,
  "name": "Team Alpha",
  "bio": "We are competitive CTF players",
  "avatar": "/assets/avatars/team42.jpg",
  "captain": {
    "id": "user-guid",
    "userName": "captain123"
  },
  "members": [
    {
      "id": "user-guid-1",
      "userName": "player1",
      "avatar": "/assets/avatars/user1.jpg"
    },
    {
      "id": "user-guid-2",
      "userName": "player2",
      "avatar": "/assets/avatars/user2.jpg"
    }
  ],
  "locked": false
}

Get User Teams

Retrieve all teams the current user is a member of.

GET /api/team

Requires User authentication.
[
  {
    "id": 42,
    "name": "Team Alpha",
    "bio": "Competition team",
    "captain": { "id": "...", "userName": "captain123" },
    "members": [...]
  },
  {
    "id": 43,
    "name": "Team Beta",
    "captain": { "id": "...", "userName": "leader456" },
    "members": [...]
  }
]

Create Team

Create a new team with the current user as captain.

POST /api/team

Each user can create up to 3 teams. Rate limited.
name
string
required
Team name (must be unique)
bio
string
Team bio/description (optional)
{
  "name": "New Team",
  "bio": "We are learning CTF together"
}

Update Team

Update team information.

PUT /api/team/

Only the team captain can update team information.
id
integer
required
Team ID
name
string
New team name
bio
string
New team bio
{
  "name": "Updated Team Name",
  "bio": "Updated description"
}

Delete Team

Delete a team permanently.

DELETE /api/team/

Only the captain can delete teams. Teams participating in active games cannot be deleted.
id
integer
required
Team ID

Team Membership

Transfer Ownership

Transfer team captain role to another member.

PUT /api/team//transfer

Only the current captain can transfer ownership.
id
integer
required
Team ID
newCaptainId
string
required
User ID of the new captain (must be a team member)
{
  "newCaptainId": "user-guid-2"
}
The new captain must not exceed the team creation limit (3 teams).

Kick Member

Remove a member from the team.

POST /api/team//kick/

Only the captain can kick members. Cannot kick from locked teams in active games.
id
integer
required
Team ID
userId
string
required
User ID to remove

Leave Team

Leave a team as a member.

POST /api/team//leave

Cannot leave teams that are locked and participating in active games.
id
integer
required
Team ID

Invitations

Get Invite Code

Retrieve the team’s invitation code.

GET /api/team//invite

Only the captain can view the invite code.
id
integer
required
Team ID
"Team Alpha:42:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
The invite code format is: TeamName:TeamId:InviteToken

Regenerate Invite Code

Generate a new invitation token for the team.

PUT /api/team//invite

Only the captain can regenerate invite codes. Previous codes become invalid.
id
integer
required
Team ID
"Team Alpha:42:z9y8x7w6v5u4t3s2r1q0p9o8n7m6l5k4"

Accept Invitation

Join a team using an invitation code.

POST /api/team/accept

code
string
required
Full invitation code from team captain
"Team Alpha:42:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"

Team Avatar

Update Avatar

Upload a new team avatar image.

PUT /api/team//avatar

Only the captain can update the avatar. Max file size: 3MB.
id
integer
required
Team ID
file
file
required
Image file (JPEG, PNG, etc.)
"/assets/avatars/abc123def456.jpg"
The image will be automatically resized to 300x300 pixels.

Signature Verification

Verify Team Signature

Verify a team’s cryptographic signature.

POST /api/team/verify

teamToken
string
required
Team token in format teamId:signature
publicKey
string
required
Base64-encoded Ed25519 public key (32 bytes)
{
  "teamToken": "42:a1b2c3d4e5f6...",
  "publicKey": "SGVsbG8gV29ybGQhIFRoaXMgaXMgYSB0ZXN0"
}
Team signatures use Ed25519 and verify against the data GZCTF_TEAM_{teamId}.

Team Locking

Teams become locked when they join an active game. While locked:
  • Members cannot leave
  • Captain cannot kick members
  • Team cannot be deleted
Locking prevents roster changes during competition.

Next Steps

Game API

Join games with your team

Account API

Manage your user account

Build docs developers (and LLMs) love