Documentation

API reference

The Rebasable REST API - authentication, conventions, errors, pagination and the OpenAPI document.

Everything in the dashboard is available through the REST API at https://api.rebasable.com/v1.

OpenAPI document: api.rebasable.com/v1/openapi.json. Import it into Postman, Insomnia or Bruno, or generate a client.

Authentication

Create a token in Account → API tokens and send it as a bearer token:

curl https://api.rebasable.com/v1/services \
  -H "Authorization: Bearer rb_YOUR_TOKEN"

Tokens belong to one team and have scopes: read, write, deploy, admin. Requests use the token’s team; list endpoints also accept ?teamId= for other teams you belong to.

Conventions

  • JSON with camelCase fields, timestamps in ISO 8601 (UTC), money in integer cents.
  • IDs have a prefix: srv_ services, dep_ deploys, ds_ databases, dom_ domains, prj_ projects, tm_ teams.
  • Creating returns 201 with the object; long operations return 202 with the object in a pending state.
  • Lists are paginated with a cursor: ?limit=20&cursor=... returns { "data": [...], "nextCursor": "..." | null }, newest first.

Errors

Every error has the same shape:

{ "error": { "code": "not_found", "message": "Service not found" } }

Codes: bad_request, validation_failed, unauthorized, payment_required, forbidden, not_found, conflict, gone, payload_too_large, unprocessable, quota_exceeded, spend_cap_reached, rate_limited, internal, not_configured, unavailable.

Common calls

# create a web service from a repo and deploy it
curl -X POST https://api.rebasable.com/v1/services \
  -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
  -d '{"projectId":"prj_xxx","name":"api","type":"web","repoUrl":"https://github.com/acme/api","branch":"main","instanceType":"starter"}'

# trigger a deploy
curl -X POST https://api.rebasable.com/v1/services/srv_xxx/deploys -H "Authorization: Bearer $TOKEN"

# stream logs (Server-Sent Events)
curl -N "https://api.rebasable.com/v1/logs/stream?serviceId=srv_xxx" -H "Authorization: Bearer $TOKEN"

Rate limits

Requests are rate limited per token. When you hit the limit you get 429 with code rate_limited; retry after the time in the retry-after header.

Webhooks

Get notified of events (deploys, crashes, scans, billing) with signed outgoing webhooks: Settings → Notifications → Webhooks. Each request has an x-rebasable-signature: t=<timestamp>,v1=<hex> header, an HMAC-SHA256 of <timestamp>.<body> with your webhook secret.