Introduction
The GenLayer Points API is a Django REST Framework (DRF) based API that provides comprehensive access to the GenLayer Testnet Program’s contribution tracking system. The API allows you to manage users, contributions, leaderboards, and more.Base URLs
API Versioning
The API is versioned through the URL path. The current version is v1. All endpoints are prefixed with/api/v1/ except authentication endpoints which use /api/auth/.
Response Format
All API responses are returned in JSON format with consistent structure:Success Response
List Response (Paginated)
Error Response
Status Codes
The API uses standard HTTP status codes:| Code | Meaning |
|---|---|
| 200 | OK - Request succeeded |
| 201 | Created - Resource created successfully |
| 400 | Bad Request - Invalid request data |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource not found |
| 500 | Internal Server Error - Server error |
Pagination
List endpoints support pagination with the following query parameters:Page number to retrieve
Number of items per page (max 100)
Alternative to page_size for limiting results
Filtering and Ordering
Many endpoints support filtering and ordering:Filtering
Ordering
- prefix for descending order.
Searching
Rate Limiting
Currently, there are no strict rate limits, but excessive requests may be throttled. Best practices:- Cache responses when appropriate
- Use pagination for large datasets
- Batch requests when possible
CORS
The API supports CORS for browser-based applications. The following headers are included in responses:Access-Control-Allow-OriginAccess-Control-Allow-CredentialsAccess-Control-Allow-MethodsAccess-Control-Allow-Headers
Development vs Production
Development:- Debug mode enabled
- Detailed error messages
- CORS allows localhost origins
- Test reCAPTCHA keys accepted
- Debug mode disabled
- Generic error messages
- CORS restricted to specific origins
- Real reCAPTCHA validation required
Next Steps
Authentication
Learn about SIWE authentication flow
Users API
Manage user accounts and profiles
Contributions API
Track and submit contributions
Leaderboard API
Access rankings and statistics