API Reference
Complete API documentation for OpenAthlete
OpenAthlete provides a RESTful API for programmatic access to your data.
Interactive API Documentation
The complete and interactive API documentation is available via Swagger UI:
Open API Documentation
Explore all endpoints, try requests, and view schemas
Base URL
https://api.openathlete.orgFor self-hosted instances, use your own API URL.
Authentication
All API requests require authentication using JWT tokens.
Getting an Access Token
- Make a POST request to
/auth/login:
curl -X POST https://api.openathlete.org/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "your-password"
}'- The response includes an
access_token:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}- Include the token in subsequent requests:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.openathlete.org/user/meRate Limiting
API requests are rate-limited to ensure fair usage:
- 100 requests per minute per user
- 1000 requests per hour per user
Rate limit headers are included in responses:
X-RateLimit-Limit- Request limitX-RateLimit-Remaining- Remaining requestsX-RateLimit-Reset- Reset time
Error Handling
Errors are returned in a consistent format:
{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Status Codes
200- Success201- Created400- Bad Request401- Unauthorized403- Forbidden404- Not Found500- Internal Server Error
OpenAPI Specification
A complete OpenAPI specification is available at https://api.openathlete.org/docs for the production API, or at /api/docs when running the API server locally.