TeaLab API (0.1.0)

Download OpenAPI specification:

Multi-tenant job orchestration API with JWT auth and SSE telemetry.

auth

Log in and receive a JWT

Request Body schema: application/json
required

Login request

email
string
password
string
tenant_name
string

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string",
  • "tenant_name": "string"
}

Response samples

Content type
application/json
{
  • "is_superuser": true,
  • "roles": [
    ],
  • "tenant": {
    },
  • "token": "string",
  • "user": {
    }
}

Current session details

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "is_superuser": true,
  • "roles": [
    ],
  • "tenant": {
    },
  • "token": "string",
  • "user": {
    }
}

Create a tenant and admin account

Request Body schema: application/json
required

Signup request

email
string
password
string
tenant_name
string

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string",
  • "tenant_name": "string"
}

Response samples

Content type
application/json
{
  • "is_superuser": true,
  • "roles": [
    ],
  • "tenant": {
    },
  • "token": "string",
  • "user": {
    }
}

health

Aggregated health rollup

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "checked_at": "string",
  • "ok": true,
  • "rollup": "string",
  • "services": [
    ]
}

API metrics summary

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "avg_duration_ms": 0,
  • "completed_last_hour": 0,
  • "duration_p50_ms": 0,
  • "duration_p95_ms": 0,
  • "failed_last_hour": 0,
  • "queue_lag_seconds": 0,
  • "queued_jobs": 0,
  • "rbac_denials_24h": 0,
  • "running_jobs": 0,
  • "succeeded_last_hour": 0,
  • "success_rate_percent": 0
}

Liveness probe

Responses

Response samples

Content type
application/json
{
  • "property1": true,
  • "property2": true
}

jobs

List jobs for the tenant

Authorizations:
BearerAuth
query Parameters
limit
integer

Limit results (1-200)

state
string

Filter by state

type
string

Job type

q
string

Free text search

before
string

Return jobs created before ISO timestamp

Responses

Response samples

Content type
application/json
{
  • "jobs": [
    ]
}

Create a job

Authorizations:
BearerAuth
Request Body schema: application/json
required

Job request

idempotency_key
string
job_type
string
max_attempts
integer
params
Array of integers
trace_id
string

Responses

Request samples

Content type
application/json
{
  • "idempotency_key": "string",
  • "job_type": "string",
  • "max_attempts": 0,
  • "params": [
    ],
  • "trace_id": "string"
}

Response samples

Content type
application/json
{
  • "attempt": 0,
  • "created_at": "string",
  • "created_by": "string",
  • "finished_at": "string",
  • "heartbeat_at": "string",
  • "id": "string",
  • "idempotency_key": "string",
  • "max_attempts": 0,
  • "params": null,
  • "result": null,
  • "started_at": "string",
  • "state": "string",
  • "tenant_id": "string",
  • "trace_id": "string",
  • "type": "string"
}

Stream tenant job events (SSE)

Authorizations:
BearerAuth

Responses

List configured job types

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "types": [
    ]
}

Fetch a job

Authorizations:
BearerAuth
path Parameters
jobID
required
string

Job ID

Responses

Response samples

Content type
application/json
{
  • "attempt": 0,
  • "created_at": "string",
  • "created_by": "string",
  • "finished_at": "string",
  • "heartbeat_at": "string",
  • "id": "string",
  • "idempotency_key": "string",
  • "max_attempts": 0,
  • "params": null,
  • "result": null,
  • "started_at": "string",
  • "state": "string",
  • "tenant_id": "string",
  • "trace_id": "string",
  • "type": "string"
}

Cancel a job

Authorizations:
BearerAuth
path Parameters
jobID
required
string

Job ID

Responses

Response samples

Content type
application/json
{
  • "attempt": 0,
  • "created_at": "string",
  • "created_by": "string",
  • "finished_at": "string",
  • "heartbeat_at": "string",
  • "id": "string",
  • "idempotency_key": "string",
  • "max_attempts": 0,
  • "params": null,
  • "result": null,
  • "started_at": "string",
  • "state": "string",
  • "tenant_id": "string",
  • "trace_id": "string",
  • "type": "string"
}

Stream job events (SSE)

Authorizations:
BearerAuth
path Parameters
jobID
required
string

Job ID

Responses