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_.
curl -s \
-H "Authorization: Bearer odk_..." \
https://api.example.com/v1/workspace/meEndpoints
| Method and path | Scope | Returns |
|---|---|---|
| GET /v1/workspace/me | workspace:read | Key id, name, scopes and workspace name and slug |
| GET /v1/workspace/monitoring | monitoring:read | Project count, deployment and QA activity, recent deployments, pending approvals |
| GET /v1/workspace/compliance | compliance:read | Control states, verified domains, key prefixes, role counts |
| GET / POST /v1/workspace/projects | projects:read / write | List or create a project with its Home page |
| GET /v1/workspace/projects/:id | projects:read | Project and page metadata |
| GET / POST /v1/workspace/projects/:id/pages | projects:read / write | List pages or create one |
| GET / PUT / DELETE .../pages/:pageId | projects:read / write | Read, replace a document with baseVersion, or delete a page |
| GET / POST .../deployments | deployments:read / write | List deployments or queue a build |
| POST .../deployments/:id/promote | deployments:write | Copy a ready preview into a production deployment |
| POST .../deployments/:id/activate | deployments:write | Activate a ready deployment |
| GET / POST .../domains | domains:read / write | List domains or add one |
| POST .../domains/:domainId/verify | domains:write | Resolve the TXT record and verify |
| GET / POST .../qa | qa:read / write | List QA reports or queue a scan |
| GET /v1/workspace/audit | audit:read | Filtered audit events |
Monitoring response
{
"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": "..."
}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.
{
"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
}OpenAPI document
The machine-readable document is served at /openapi.json and describes exactly the three endpoints above.
curl -s https://api.example.com/openapi.json | jq '.paths | keys'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.
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/$PAGEOfficial 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.
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,
});Errors
| Status | Meaning |
|---|---|
| 401 | Missing, invalid or revoked key |
| 403 | The key lacks the scope, or the request network is outside the workspace allowlist |
| 404 | The workspace or resource does not exist |
| 429 | Too many requests from this source |
| 500 | Server error; retry with backoff and keep the request id |
{
"error": {
"code": "forbidden",
"message": "API key is missing the monitoring:read scope",
"requestId": "..."
}
}[ Related ]
Was this page helpful?
