Skip to content

API Reference

This reference covers Stib's project-scoped automation API under /api/external/projects/.... The web and desktop clients also call many /api/... routes, but those are internal client/server contracts and are not documented as a stable third-party API.

Base URL

Use the server origin, without the desktop/web-client origin unless they are the same:

text
https://stib.example.com

For a local native server, the preferred origin is http://localhost:50505; use the actual bound port if it changed.

API keys

Create a dedicated key from the appropriate API Keys settings scope: server, organization, or project. Choose its expiration and only the permissions required by the integration. Use a separate owner/key for each trust boundary rather than reusing an administrator's key.

The full key starts with stib_ak_ and is displayed only once. Send it as a Bearer token:

http
Authorization: Bearer stib_ak_…

Do not put the key in a URL or commit it to a repository. API keys are rate-limited to 100 requests per minute per key, can expire, and are checked against route permissions and the access of their owning account.

Permissions

The external endpoints use these permissions:

PermissionAllows
cards.readList/read cards, boards, and project statistics
cards.create or pipelines.triggerCreate a card and initialize its pipeline configuration; creation does not activate the agent
cards.moveMove a card to another column
agents.cancelCancel the active agent on a card
agents.archiveArchive a card

Other permissions exist for project-scoped client routes, but granting one does not make an undocumented internal route a stable integration contract.

Response format

Successful responses are wrapped in data:

json
{
  "data": {
    "id": 42,
    "status": "idle"
  }
}

Errors use a stable envelope with a machine-readable code:

json
{
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "API key does not have the required permission"
  }
}

Common status codes are 400, 401, 403, 404, 409, 429, 500, and 503. Back off and honor Retry-After when it is returned for rate limiting or database contention.

Quick example

bash
export STIB_ORIGIN='https://stib.example.com'
export STIB_API_KEY='stib_ak_…'
export STIB_PROJECT_ID='12'

curl --fail-with-body \
  -H "Authorization: Bearer $STIB_API_KEY" \
  "$STIB_ORIGIN/api/external/projects/$STIB_PROJECT_ID/cards?limit=20"

Use a secret manager for real automation instead of an interactive shell variable.

Next: Endpoints.