Skip to content

API Reference

Stib exposes a REST API that lets you build custom integrations, automate workflows, and interact with your boards, cards, and agents programmatically.

Base URL

By default, the API is available at:

http://localhost:37100/api/

The host and port depend on your Stib server configuration. All endpoint paths in this documentation are relative to /api/.

Response Format

All API responses follow a consistent envelope format.

Success response:

json
{
  "data": {
    "id": "abc123",
    "name": "My Project"
  }
}

Error response:

json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Project not found"
  }
}

TIP

All JSON fields use camelCase naming (e.g., projectId, columnType, isAutoMode).

Authentication

Authentication is optional — it can be enabled or disabled in Stib settings. When enabled, include a Bearer token in the Authorization header:

http
GET /api/projects HTTP/1.1
Authorization: Bearer <token>

You can check whether authentication is active:

http
GET /api/settings/auth-status

When authentication is disabled, all endpoints are accessible without a token.

Server Roles

RoleDescription
userStandard access to own projects and organizations
adminCan manage users via admin panel
super_adminFull server admin — required for auth management, OIDC config, backups, user management

INFO

Server roles (user, admin, super_admin) are separate from organization/project member roles (admin, member). A user can be a server user but an admin within a specific organization.

Organization Context

For multi-organization setups, pass the organization ID in a request header:

http
GET /api/projects HTTP/1.1
X-Organization-Id: org_abc123
  • Without auth: the X-Organization-Id is verified against the database.
  • With auth: membership is checked (super admins bypass this check).

HTTP Status Codes

CodeUsage
200Successful GET, PATCH, or PUT
201Successful POST (resource created)
204Successful DELETE or action with no response body
400Validation error (missing or invalid fields)
401Unauthorized (missing or invalid token)
403Forbidden (insufficient permissions)
404Resource not found
409Conflict (state conflict, e.g., duplicate)
500Internal server error

Pagination

Some list endpoints support pagination via query parameters:

ParameterTypeDescription
limitnumberMaximum number of items to return
sincestringReturn items after this timestamp (ISO 8601)
beforestringReturn items before this timestamp (ISO 8601)

Example:

http
GET /api/projects/{projectId}/cards/{cardId}/agent/messages?limit=50&since=2025-01-01T00:00:00Z

WebSocket

Stib uses a WebSocket connection for real-time updates (card moves, agent progress, notifications).

ws://localhost:37100/api/ws?token=<token>

When authentication is enabled, pass the Bearer token as a token query parameter. Connect to this endpoint to receive server-sent events. All card and agent mutations emit WebSocket events, so connected clients stay in sync automatically.

Quick Example

Create a card via the external flat API:

bash
curl -X POST http://localhost:37100/api/cards \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "projectId": "project_abc123",
    "title": "Fix login bug",
    "prompt": "The login form does not validate email format"
  }'
json
{
  "data": {
    "id": "card_xyz789",
    "title": "Fix login bug",
    "prompt": "The login form does not validate email format",
    "projectId": "project_abc123",
    "columnId": "col_001",
    "position": 0
  }
}

Check the card status:

bash
curl http://localhost:37100/api/cards/card_xyz789/status \
  -H "Authorization: Bearer <token>"
json
{
  "data": {
    "id": "card_xyz789",
    "title": "Fix login bug",
    "columnName": "Backlog",
    "hasActiveAgent": false
  }
}

For the full list of available endpoints, see the Endpoints page.