Skip to content
AvailableUpdated 2026-11-28

Workspace API reference

Authenticate with a scoped key, read workspace data and write projects, pages and deployments.

The key-authenticated API reads workspace data and writes projects, pages and deployments. Members, billing and workspace settings stay in the web app. An official TypeScript SDK wraps the same endpoints.

Before you start

  • An owner or admin creates a key in Settings → API keys.
  • Give the key only the scopes the service needs.
  • Store the key in the service's secret manager. It is shown once.
  • If the workspace enforces an IP allowlist, the service must call from an allowed network.

Base URL and authentication

Send the key as a bearer credential on every request. Keys start with odk_.

bash
curl -s \
  -H "Authorization: Bearer odk_..." \
  https://api.example.com/v1/workspace/me
Introspect a key

Endpoints

Method and pathScopeReturns
GET /v1/workspace/meworkspace:readKey id, name, scopes and workspace name and slug
GET /v1/workspace/monitoringmonitoring:readProject count, deployment and QA activity, recent deployments, pending approvals
GET /v1/workspace/compliancecompliance:readControl states, verified domains, key prefixes, role counts
GET / POST /v1/workspace/projectsprojects:read / writeList or create a project with its Home page
GET /v1/workspace/projects/:idprojects:readProject and page metadata
GET / POST /v1/workspace/projects/:id/pagesprojects:read / writeList pages or create one
GET / PUT / DELETE .../pages/:pageIdprojects:read / writeRead, replace a document with baseVersion, or delete a page
GET / POST .../deploymentsdeployments:read / writeList deployments or queue a build
POST .../deployments/:id/promotedeployments:writeCopy a ready preview into a production deployment
POST .../deployments/:id/activatedeployments:writeActivate a ready deployment
GET / POST .../domainsdomains:read / writeList domains or add one
POST .../domains/:domainId/verifydomains:writeResolve the TXT record and verify
GET / POST .../qaqa:read / writeList QA reports or queue a scan
GET /v1/workspace/auditaudit:readFiltered audit events

Monitoring response

json
{
  "workspace": { "id": "...", "name": "Acme" },
  "projects": 4,
  "deployments": {
    "last7d": 3, "ready": 2, "failed": 1,
    "recent": [{ "id": "...", "projectName": "Site", "environment": "production", "status": "ready", "version": 7, "createdAt": "..." }]
  },
  "qa": { "last7d": 2, "failed": 0 },
  "approvals": { "pending": 1 },
  "generatedAt": "..."
}
Trimmed example

Compliance response

The inventory proves configuration, not certification. certifications is empty until an audit exists, and dataResidency is null because region selection is not implemented.

json
{
  "controls": {
    "sso": { "enabled": true, "issuer": "https://idp.example.com" },
    "scim": { "tokenActive": true },
    "ipAllowlist": { "enabled": false, "entries": 0 },
    "publishingApprovals": { "required": false, "approvers": 2 },
    "apiKeys": { "active": 1, "prefixes": ["odk_ab12cd34"] },
    "verifiedDomains": ["example.com"],
    "auditEvents30d": 42
  },
  "members": { "total": 5, "owners": 1, "admins": 1, "editors": 2, "viewers": 1 },
  "certifications": [],
  "dataResidency": null
}
Trimmed example

OpenAPI document

The machine-readable document is served at /openapi.json and describes exactly the three endpoints above.

bash
curl -s https://api.example.com/openapi.json | jq '.paths | keys'
List the documented paths

Write a page

Writes use optimistic concurrency. Send the version you read; a mismatch returns 409 with the current version. A whole-document replace bumps the version and records an api_key page version.

bash
curl -s -X PUT \
  -H "Authorization: Bearer odk_..." \
  -H "Content-Type: application/json" \
  -d '{"baseVersion":3,"document":{...}}' \
  https://api.example.com/v1/workspace/projects/$PROJECT/pages/$PAGE
Replace a page document

Official SDK

The TypeScript SDK lives in the repository at packages/sdk and wraps every endpoint on this page. It is not published to npm yet.

ts
import { OrdeployClient } from "@ordeploy/sdk";

const client = new OrdeployClient({
  apiKey: process.env.ORDEPLOY_API_KEY!,
  baseUrl: "https://api.example.com",
});

const { project } = await client.createProject({ name: "Docs site" });
const home = (await client.getProject(project.id)).pages[0]!;
const page = await client.getPage(project.id, home.id);

await client.replacePageDocument(project.id, home.id, {
  baseVersion: page.meta.version,
  document: page.document,
});
Create, edit and read through the SDK

Errors

StatusMeaning
401Missing, invalid or revoked key
403The key lacks the scope, or the request network is outside the workspace allowlist
404The workspace or resource does not exist
429Too many requests from this source
500Server error; retry with backoff and keep the request id
json
{
  "error": {
    "code": "forbidden",
    "message": "API key is missing the monitoring:read scope",
    "requestId": "..."
  }
}
Error body

Was this page helpful?