Skip to main content

Reference

API reference

Plain JSON over HTTPS, Bearer-token auth, OpenAPI 3.1 spec. Nearly everything the dashboard does, you can do over the API — and the spec describes all of it.

Authentication

Generate a token from Settings → API tokens → New token. The plaintext is shown once at creation; only the SHA-256 hash is stored on our side. Send it as a Bearer header on every request:

Authorization: Bearer coag_<id>_<secret>

Tokens are scoped to your workspace and inherit the owner's permissions. Rotate from the same screen at any time — the new token is recognised on the next request, no API restart needed.

Base URL

Production    https://api.coagentic.work
Local dev     http://localhost:4000

Every JSON endpoint accepts and returns application/json. 4xx responses include a { error: string } body; 5xx returns a generic message and a request id you can quote on a support email.

Common calls

List your projects

curl -H 'Authorization: Bearer coag_xxx_xxx' \
     https://api.coagentic.work/projects

Create a project

curl -X POST https://api.coagentic.work/projects \
     -H 'Authorization: Bearer coag_xxx_xxx' \
     -H 'Content-Type: application/json' \
     -d '{ "name": "My site", "type": "landing" }'

Insert a row into a table

curl -X POST 'https://api.coagentic.work/rows?tableId=tbl_…' \
     -H 'Authorization: Bearer coag_xxx_xxx' \
     -H 'Content-Type: application/json' \
     -d '{ "data": { "email": "[email protected]" } }'

Trigger an external webhook into a workflow

# :workflowId is shown in the workflow editor.
# If the workflow has a secret, sign the raw body and send the
# hex digest in the X-Coagentic-Signature header.
curl -X POST 'https://api.coagentic.work/webhooks/wf_…' \
     -H 'X-Coagentic-Signature: <hmac-sha256-hex>' \
     -H 'Content-Type: application/json' \
     -d '{ "order_id": 42, "amount_cents": 4900 }'

Endpoint groups

Projects

GET/projects
List projects in the workspace.
POST/projects
Create a project. Body: { name, type? }.
GET/projects/:id
Get one project.
PATCH/projects/:id
Update name, status, slug.
DELETE/projects/:id
Delete project + all its data (irreversible).

Database

POST/databases
Provision a database. Body: { projectId }.
GET/databases/:id/tables
List tables in a database.
POST/databases/:id/tables
Create a table. Body: { name, columns }.
PATCH/tables/:id
Rename a table or update its columns.
DELETE/tables/:id
Delete a table.
GET/rows?tableId=…
List rows in a table. Supports `limit` (max 200).
POST/rows?tableId=…
Insert a row. Body: { data }.
PATCH/rows/:id
Update a row. Body: { data }.
DELETE/rows/:id
Delete a row.
GET/rows/export?tableId=…
CSV export of every row in a table.

Files

GET/files?projectId=…
List files in a project.
POST/files?projectId=…
Create or update a text file. Body: { path, content, contentType? }.
POST/files/upload?projectId=…
Binary upload. multipart/form-data with `file` field. Cap 10 MB.
GET/files/:id
Read a file with content.
PATCH/files/:id/seo
Update SEO metadata only. Body: { title?, description?, ogImage?, noIndex? }.
DELETE/files/:id
Delete a file.

Workflows

POST/workflows
Create a workflow. Body: { projectId, name, trigger, actions }.
GET/workflows/:id
Get a workflow with its full definition.
POST/workflow-runs/:workflowId/run
Trigger a manual run.
GET/workflow-runs?workflowId=...
List run history.

Public endpoints

POST/webhooks/:workflowId
External webhook into a webhook-triggered workflow. Body becomes the trigger payload; if a secret is set on the workflow, send X-Coagentic-Signature.
POST/forms/:subdomain
Public site form-submit handler. Captures into form_submissions and fires matching form_submit workflows.

Outbound webhooks

The other direction: Coagentic POSTs to your endpoint when something happens in your workspace. Add one under Settings → Outbound webhooks, choose the events, and keep the signing secret it gives you.

EventSent when
project.createdA project is created.
project.updatedA project's settings change.
project.deletedA project is deleted.
form.submittedA visitor submits a form on your site.
workflow.runA workflow finishes successfully.
workflow.errorA workflow run fails.
row.createdA row is inserted into a project table.

Verifying a delivery. Every request carries three headers: X-Coagentic-Timestamp (unix seconds), X-Coagentic-Signature-V2 — HMAC-SHA256 of `${timestamp}.${rawBody}` with your signing secret — and X-Coagentic-Signature, the older form over the body alone. Prefer V2 and reject timestamps outside a few minutes; that is what makes a captured request useless later. Compare with a constant-time equality check.

Retries. Anything other than a 2xx — including a timeout past 10 seconds — is retried up to five times with exponential backoff starting at 5 seconds. Redirects are not followed. Endpoints on private or link-local addresses are refused outright, so a webhook cannot be pointed at our own internals.

Make it idempotent. A retry can deliver the same event twice, and a delivery that timed out may already have been processed. Key on the event's own id.

Full spec

The complete machine-readable reference is at /openapi.json (OpenAPI 3.1) — every group on this page, thirty-two paths. Pipe it into openapi-typescript for a typed TS client, or load it in any Postman / Insomnia / Bruno workspace.

Swagger UI lives at /docs on the API host — interactive reference with try-it-now buttons once you paste a Bearer token.

Next
Troubleshooting →

Common stuck points and how to unstick.