Skip to content

Using the API

Everything the web application does, it does through the API, and you can call the same API. Every address is under /api on your instance, such as https://forge.example.com/api/models.

With a service account’s API key, kept in your secret store:

Terminal window
curl -s -H "authorization: Bearer $FORGE_API_KEY" \
https://forge.example.com/api/models

As a person, sign in, then send the access token with each call:

Terminal window
# Sign in. The answer carries an access token; keep the cookie jar for renewing it.
curl -s -c cookies.txt -H "content-type: application/json" \
-d '{"email":"someone@example.com","password":"..."}' \
https://forge.example.com/api/auth/sign-in
# Call the API with the token.
curl -s -H "authorization: Bearer <accessToken>" \
https://forge.example.com/api/models

Sign-In, Tokens and API Keys has the details: what a key looks like and why one is refused, the authenticator step, and renewing a session.

  • Answers are JSON, with field names in camel case, such as currentRevision.
  • Identifiers are UUIDs.
  • Times are in UTC, in ISO 8601, such as 2026-11-22T10:15:00+00:00.
  • A refusal or an error is a problem document. See Errors and limits.

The API applies the same rules as the screens: a script sees only what its person, or its service account, may see. A restricted model the person may not see answers 404 Not Found, exactly as an id that does not exist, and is left out of every list.

The reference lists every route, its parameters and its answers. It is generated from the API’s own code: a test in the product’s build fails when the description and the code differ, so the reference matches the release it belongs to.

The help inside your instance is the help of the release it runs, so its reference is the one that matches your instance.

The routes of the platform console (/api/platform/...) answer only on the console’s own host name, with an operator’s token, and the routes of support sessions only in the workspace for an operator entering with a code. They are in the reference under Console sign-in, Platform administration and Support sessions, for the operators of an instance. See The platform console.

The web application also keeps a live connection, at /hubs/workspace, for presence, edit locks and changes made by others. It is not part of the reference and may change without notice; scripts should not depend on it.