Introduction
GZCTF provides a comprehensive REST API for interacting with the platform programmatically. The API allows you to manage games, challenges, teams, users, and more.Base URL
The API is accessible at:API Versioning
The current API version is embedded in the endpoint paths. GZCTF follows a controller-based routing structure:/api/account/*- Account management/api/game/*- Game operations/api/team/*- Team management/api/admin/*- Administrative functions/api/edit/*- Content editing (admin)/api/tokens/*- API token management
Request Format
All requests should use:- Content-Type:
application/json - Method: Standard HTTP methods (GET, POST, PUT, DELETE)
- Body: JSON-formatted data for POST/PUT requests
Example Request
Response Format
All API responses use JSON format with consistent structures:Success Response
Error Response
Common Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content |
| 304 | Not Modified (cached) |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Conflict |
| 500 | Internal Server Error |
Response Headers
GZCTF uses standard HTTP headers for caching and content negotiation:ETag- Entity tag for cache validationLast-Modified- Last modification timeContent-Type- Alwaysapplication/jsonunless downloading files
Rate Limiting
Certain endpoints are rate-limited to prevent abuse:- Registration: Limited by
RateLimiter.LimitPolicy.Register - Login: Limited by
RateLimiter.LimitPolicy.Register - Submissions: Limited by
RateLimiter.LimitPolicy.Submit - Queries: Limited by
RateLimiter.LimitPolicy.Query
429 Too Many Requests response.
Pagination
List endpoints support pagination using query parameters:Number of items to return (max varies by endpoint)
Number of items to skip
Paginated Response
Caching
Many endpoints support HTTP caching withETag and Last-Modified headers. Include these headers in subsequent requests for efficient data retrieval:
304 Not Modified response indicates cached data is still valid.
Data Encryption
Sensitive data like passwords may require client-side encryption before transmission when theApiEncryption feature is enabled. Check the platform configuration for encryption requirements.
Next Steps
Authentication
Learn about authentication methods
Game API
Explore game management endpoints
Team API
Team operations and management
Account API
User account management