API Reference

Complete reference for the BDSF Adventure OS API.

Base URL

https://api.bestdaysofar.net

Authentication

All API requests require authentication via Cloudflare Workers Auth.

Authorization Header

Authorization: Bearer {access_token}

Endpoints

Authentication

POST /auth/login

Authenticate with email and password.

Request:

{
  "email": "user@example.com",
  "password": "secure-password"
}

Response:

{
  "access_token": "eyJ...",
  "user_id": "usr_123"
}

POST /auth/logout

Invalidate the current access token.

{
  "success": true
}

Adventures

GET /adventures

List all adventures for the authenticated user.

Query Parameters:

  • limit – Max results (default: 20)
  • offset – Pagination offset (default: 0)
  • status – Filter by status (active, completed, archived)

Response:

{
  "data": [
    {
      "id": "adv_123",
      "title": "Rocky Mountain Trek",
      "description": "4-day backpacking trip",
      "start_date": "2025-06-15",
      "status": "completed"
    }
  ],
  "total": 42
}

Error Responses

400 Bad Request

{
  "error": "Validation failed",
  "details": {
    "title": "Title is required"
  }
}

401 Unauthorized

{
  "error": "Invalid or missing token"
}

404 Not Found

{
  "error": "Resource not found"
}