Start an operation
const url = 'https://api.deploybase.eu/api/v1/api/v1/operations';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"kind":"ship","new_project":{"git_repo_url":"example","name":"example","subdomain":"example"},"project_id":"example","reason":"fix pricing typo","source":{"git":{"commit":"example","ref":"example"},"upload_session_id":"example"},"target":"preview"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.deploybase.eu/api/v1/api/v1/operations \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "ship", "new_project": { "git_repo_url": "example", "name": "example", "subdomain": "example" }, "project_id": "example", "reason": "fix pricing typo", "source": { "git": { "commit": "example", "ref": "example" }, "upload_session_id": "example" }, "target": "preview" }'Starts a long-running operation and returns it at once (202). Only kind “ship” exists: it builds a git ref (or adopts an upload session), publishes it, promotes it when the target is production, and then verifies what is served. Read it back with GET /operations/{id}?wait=25s until status is completed, failed or cancelled. Send an Idempotency-Key header to retry safely: the same key with the same body returns the first operation (200), with a different body 422 IDEMPOTENCY_KEY_REUSED. A ship the pipeline refuses to start (build minutes used up, a held team) is stored as failed and answered with the refusal plus reason, who_acts and next_actions. 404 OPERATIONS_API_DISABLED while the operations API is switched off.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “ Header Parameters ”Up to 255 characters; a repeat with the same body returns the first operation
Request Body
Section titled “ Request Body ”The operation
object
Example
shipobject
ProjectID ships an existing project. Give it or new_project (git), or neither with an upload session, which already names its project.
Reason is carried into the production event, at most 500 characters.
Example
fix pricing typoobject
object
Target is preview or production; empty means what the branch means (production for the default branch).
Responses
Section titled “ Responses ”Idempotent replay
object
object
object
object
object
PollAfterMs is how long a client that does not long-poll should wait before reading again; absent once the operation is terminal.
object
object
object
Component is “static”, “ssr” or “function:
Error says why the component is not ok, when a status code alone does not.
Protected: the site is private and verify could not get past its access gate (DEP-967).
Example
{ "data": { "actor": { "kind": "user" }, "kind": "ship", "reason": "build_failed", "status": "working", "step": "upload", "who_acts": "agent" }}Accepted
object
object
object
object
object
PollAfterMs is how long a client that does not long-poll should wait before reading again; absent once the operation is terminal.
object
object
object
Component is “static”, “ssr” or “function:
Error says why the component is not ok, when a status code alone does not.
Protected: the site is private and verify could not get past its access gate (DEP-967).
Example
{ "data": { "actor": { "kind": "user" }, "kind": "ship", "reason": "build_failed", "status": "working", "step": "upload", "who_acts": "agent" }}Bad Request
object
object
object
The structured outcome (ADR-030, DEP-965). Optional and additive: only the operations endpoints fill them so far, and a client that does not know them reads the rest as before.
Example generated
{ "code": "example", "details": "example", "docs_url": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }, "next_actions": [ { "action": "example", "cli": "example", "description": "example", "http": "example", "tool": "example" } ], "reason": "example", "who_acts": "example"}Plan limit; reason quota_exceeded
object
object
object
The structured outcome (ADR-030, DEP-965). Optional and additive: only the operations endpoints fill them so far, and a client that does not know them reads the rest as before.
Example generated
{ "code": "example", "details": "example", "docs_url": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }, "next_actions": [ { "action": "example", "cli": "example", "description": "example", "http": "example", "tool": "example" } ], "reason": "example", "who_acts": "example"}FORBIDDEN when the role is too low; INSUFFICIENT_SCOPE when an agent connected with read or preview access ships to production, with a WWW-Authenticate insufficient_scope challenge
object
object
object
The structured outcome (ADR-030, DEP-965). Optional and additive: only the operations endpoints fill them so far, and a client that does not know them reads the rest as before.
Example generated
{ "code": "example", "details": "example", "docs_url": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }, "next_actions": [ { "action": "example", "cli": "example", "description": "example", "http": "example", "tool": "example" } ], "reason": "example", "who_acts": "example"}Project or upload session not found, or OPERATIONS_API_DISABLED
object
object
object
The structured outcome (ADR-030, DEP-965). Optional and additive: only the operations endpoints fill them so far, and a client that does not know them reads the rest as before.
Example generated
{ "code": "example", "details": "example", "docs_url": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }, "next_actions": [ { "action": "example", "cli": "example", "description": "example", "http": "example", "tool": "example" } ], "reason": "example", "who_acts": "example"}UPLOAD_SESSION_CLOSED
object
object
object
The structured outcome (ADR-030, DEP-965). Optional and additive: only the operations endpoints fill them so far, and a client that does not know them reads the rest as before.
Example generated
{ "code": "example", "details": "example", "docs_url": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }, "next_actions": [ { "action": "example", "cli": "example", "description": "example", "http": "example", "tool": "example" } ], "reason": "example", "who_acts": "example"}IDEMPOTENCY_KEY_REUSED or SHIP_TARGET_CONFLICT
object
object
object
The structured outcome (ADR-030, DEP-965). Optional and additive: only the operations endpoints fill them so far, and a client that does not know them reads the rest as before.
Example generated
{ "code": "example", "details": "example", "docs_url": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }, "next_actions": [ { "action": "example", "cli": "example", "description": "example", "http": "example", "tool": "example" } ], "reason": "example", "who_acts": "example"}Live 39b0b6ad built