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_cursorascursor. -
An error has a status code and a body with a machine-readable
errorand amessagefor 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.
- Account
The API's account endpoints: you, the terms you accept, and what Forge says about itself publicly. - Organizations
The API's organizations endpoints: organizations, their deletion and restore, support access, data residency and retention. - Members and roles
The API's members and roles endpoints: who belongs to an organization or project, and their roles. - Projects
The API's projects endpoints: an organization's projects, their deletion and restore, residency and status badges. - Runs
The API's runs endpoints: starting runs and following them, their logs, usage, artifacts, debug shells and cancelling. - Flows
The API's flows endpoints: flow files, saved flows and their versions, and flow runs. - Templates
The API's templates endpoints: run templates of an organization or project, their versions and the runs started from them. - Schedules
The API's schedules endpoints: schedules that start a template or flow at set times. - Triggers
The API's triggers endpoints: git triggers that start a template or flow on pushes, tags and pull requests. - Approvals
The API's approvals endpoints: runs waiting for approval, and approving or rejecting them. - Environments
The API's environments endpoints: deployment environments, their protection rules and deployment history. - Variables and secrets
The API's variables and secrets endpoints: variables and secrets of organizations, projects, environments and variable groups. - Registries
The API's registries endpoints: container registry logins for private images. - Caches
The API's caches endpoints: the caches runs save and restore. - Runners
The API's runners endpoints: runners, join tokens, runner groups, autoscaling, machine providers, classes and locations. - Git
The API's git endpoints: connected Git servers and linked repositories. - Webhooks
The API's webhooks endpoints: webhooks that tell your services about runs, and their deliveries. - Service accounts
The API's service accounts endpoints: a project's service accounts and their tokens. - Activity
The API's activity endpoints: overviews' status and activity feeds, and the audit log. - Insights
The API's insights endpoints: how runs went over time, and flaky tests. - Billing
The API's billing endpoints: plans, subscriptions, usage, budgets, quotas and invoices. - Schemas
The bodies the API takes and answers with, field by field.