Complete endpoint reference with curl examples.
http://127.0.0.1:8000
All v1 routes prefixed with /api/v1.
Most endpoints require:
Authorization: Bearer <access_token>
Get token via login (see below).
Liveness probe — no auth.
curl http://127.0.0.1:8000/api/v1/healthResponse 200:
{
"status": "ok",
"app": "Task API",
"version": "1.0.0",
"environment": "development"
}Readiness probe — checks database.
curl http://127.0.0.1:8000/api/v1/readyResponse 200:
{
"status": "ready",
"database": "connected",
"app": "Task API",
"version": "1.0.0"
}Create account. Rate limited.
curl -X POST http://127.0.0.1:8000/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "new@example.com",
"password": "secret123",
"full_name": "New User"
}'Response 201: User object (no password).
OAuth2 form login. Rate limited.
curl -X POST http://127.0.0.1:8000/api/v1/auth/login \
-d "username=user@example.com&password=user123"Response 200:
{
"access_token": "eyJ...",
"refresh_token": "eyJ...",
"token_type": "bearer"
}curl -X POST http://127.0.0.1:8000/api/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refresh_token": "<refresh_token>"}'Requires auth.
curl http://127.0.0.1:8000/api/v1/auth/me \
-H "Authorization: Bearer $TOKEN"All task endpoints require auth.
List tasks with pagination.
| Query param | Type | Description |
|---|---|---|
status |
string | pending, in_progress, done |
skip |
int | Offset (default 0) |
limit |
int | Page size (default 100, max 500) |
curl "http://127.0.0.1:8000/api/v1/tasks?status=pending&skip=0&limit=10" \
-H "Authorization: Bearer $TOKEN"Response 200:
{
"items": [...],
"total": 5,
"skip": 0,
"limit": 10
}curl -X POST http://127.0.0.1:8000/api/v1/tasks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Learn FastAPI",
"description": "Complete the learning guide",
"status": "pending"
}'Response 201: Created task with id, created_at, updated_at.
curl http://127.0.0.1:8000/api/v1/tasks/1 \
-H "Authorization: Bearer $TOKEN"Partial update — only send fields to change.
curl -X PATCH http://127.0.0.1:8000/api/v1/tasks/1 \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "in_progress"}'curl -X DELETE http://127.0.0.1:8000/api/v1/tasks/1 \
-H "Authorization: Bearer $TOKEN"Response 204: Empty body.
curl http://127.0.0.1:8000/api/v1/users \
-H "Authorization: Bearer $ADMIN_TOKEN"curl http://127.0.0.1:8000/api/v1/users/1 \
-H "Authorization: Bearer $ADMIN_TOKEN"All errors return:
{"detail": "Human readable message"}Validation errors (422) return array in detail.
Interactive docs: http://127.0.0.1:8000/docs
Use Authorize button with Bearer <token>.