Skip to the content
Forge

API

Everything the console does goes through Forge's REST API at /api/v1. Its full description, every path with its requests and answers, is an OpenAPI 3 file served by Forge itself at /api/v1/openapi.yaml. Load it in any OpenAPI tool to browse it or make a client. The pages below describe the same file, a page per part of the API, every endpoint with its parameters, body and answers.

Authenticating

Send a token as a bearer token:

curl -H "Authorization: Bearer $FORGE_TOKEN" https://forge.example.com/api/v1/me

The token is your personal API key, or a project's service account token (it starts with fs_); see service accounts and API keys. Before you can use the API you accept the terms once, in the console or with POST /api/v1/legal/accept; until then every endpoint but /me and /legal answers 403 terms_required.

Requests and answers

  • Bodies are JSON, at most 1 MiB. Unknown fields are refused.

  • Lists that can be long come in pages: pass the previous page's next_cursor as cursor.

  • An error has a status code and a body with a machine-readable error and a message for people:

    { "error": "not_found", "message": "no such endpoint" }
    

Rate limits

Every caller is limited, starting runs more strictly. Over the limit, Forge answers 429 rate_limited with a Retry-After header in seconds: wait that long and try again.

Maintenance

While the platform is being maintained, the API answers 503 maintenance with Retry-After and a message.

Stability

/api/v1 only changes in ways that keep working clients working: new endpoints and new fields. Anything else would come as /api/v2.