Skip to content

API Overview

Forgexa provides a RESTful API built with FastAPI.

Base URL

EnvironmentURL
Production (Forgexa Cloud)https://api.forgexa.net/api/v1
Self-hostedhttp://<your-server>:8000/api/v1
Local developmenthttp://localhost:8000/api/v1

Authentication

All API endpoints (except /auth/login and /auth/register) require authentication via one of:

  • JWT Bearer Token — obtained from /auth/login, expires after 24 hours
  • Personal Access Token (PAT) — created via /users/me/api-tokens, suitable for CI/CD and scripts
bash
# Login (JWT)
curl -X POST https://api.forgexa.net/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "admin@example.com", "password": "admin123"}'

# Response: { "access_token": "eyJ...", "token_type": "bearer" }

# Use JWT token
curl https://api.forgexa.net/api/v1/workspaces \
  -H "Authorization: Bearer eyJ..."

# Or use PAT
curl https://api.forgexa.net/api/v1/workspaces \
  -H "Authorization: Bearer pat_a1b2c3..."

Interactive Docs

FastAPI provides interactive documentation on self-hosted instances:

  • Swagger UI: http://<your-server>:8000/docs
  • ReDoc: http://<your-server>:8000/redoc

For local development, use http://localhost:8000/docs.

API Sections

Common Response Patterns

Success

json
{
  "id": "uuid",
  "name": "...",
  "status": "...",
  "created_at": "2026-01-01T00:00:00Z"
}

Error

json
{
  "detail": "Error message"
}

Pagination

Most list endpoints return arrays directly. Audit logs and other large datasets use paginated responses:

json
{
  "total": 150,
  "page": 1,
  "page_size": 20,
  "items": [...]
}

Filtering is done via query parameters (page, page_size, action, start_date, etc.).

Forgexa — AI Software Factory