Skip to content

Start an operation

POST
/api/v1/operations
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.

Idempotency-Key
string

Up to 255 characters; a repeat with the same body returns the first operation

The operation

Media type application/json
object
kind
required
string

Example

ship
new_project
object
git_repo_url
string
name
string
subdomain
string
project_id

ProjectID ships an existing project. Give it or new_project (git), or neither with an upload session, which already names its project.

string
reason

Reason is carried into the production event, at most 500 characters.

string

Example

fix pricing typo
source
object
git
object
commit
string
ref
string
upload_session_id
string
target

Target is preview or production; empty means what the branch means (production for the default branch).

string
Allowed values: preview production

Idempotent replay

Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
actor
object
client_name
string
kind
string
Allowed values: user agent api_key push system
completed_at
string
created_at
string
deployment_id
string
docs_url
string
id
string
kind
string
Allowed values: ship
message
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
poll_after_ms

PollAfterMs is how long a client that does not long-poll should wait before reading again; absent once the operation is terminal.

integer
project_id
string
reason
string
Allowed values: build_failed upload_incomplete quota_exceeded promotion_conflict verify_failed ssr_start_failed cancelled_by_user internal invalid_request
result
object
deployment_id
string
url
string
verify
object
checked_at
string
components
Array<object>
object
cold_ms
integer
component

Component is “static”, “ssr” or “function:”.

string
error

Error says why the component is not ok, when a status code alone does not.

string
ok
boolean
protected

Protected: the site is private and verify could not get past its access gate (DEP-967).

boolean
served_deployment_id
string
status_code
integer
ttfb_ms
integer
url
string
verdict
string
status
string
Allowed values: working input_required completed failed cancelled
step
string
Allowed values: upload build publish promote verify
updated_at
string
who_acts
string
Allowed values: agent human platform

Example

{
"data": {
"actor": {
"kind": "user"
},
"kind": "ship",
"reason": "build_failed",
"status": "working",
"step": "upload",
"who_acts": "agent"
}
}

Accepted

Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
actor
object
client_name
string
kind
string
Allowed values: user agent api_key push system
completed_at
string
created_at
string
deployment_id
string
docs_url
string
id
string
kind
string
Allowed values: ship
message
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
poll_after_ms

PollAfterMs is how long a client that does not long-poll should wait before reading again; absent once the operation is terminal.

integer
project_id
string
reason
string
Allowed values: build_failed upload_incomplete quota_exceeded promotion_conflict verify_failed ssr_start_failed cancelled_by_user internal invalid_request
result
object
deployment_id
string
url
string
verify
object
checked_at
string
components
Array<object>
object
cold_ms
integer
component

Component is “static”, “ssr” or “function:”.

string
error

Error says why the component is not ok, when a status code alone does not.

string
ok
boolean
protected

Protected: the site is private and verify could not get past its access gate (DEP-967).

boolean
served_deployment_id
string
status_code
integer
ttfb_ms
integer
url
string
verdict
string
status
string
Allowed values: working input_required completed failed cancelled
step
string
Allowed values: upload build publish promote verify
updated_at
string
who_acts
string
Allowed values: agent human platform

Example

{
"data": {
"actor": {
"kind": "user"
},
"kind": "ship",
"reason": "build_failed",
"status": "working",
"step": "upload",
"who_acts": "agent"
}
}

Bad Request

Media type application/json
object
code
string
details
docs_url
string
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
reason

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.

string
who_acts
string

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

Media type application/json
object
code
string
details
docs_url
string
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
reason

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.

string
who_acts
string

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

Media type application/json
object
code
string
details
docs_url
string
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
reason

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.

string
who_acts
string

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

Media type application/json
object
code
string
details
docs_url
string
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
reason

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.

string
who_acts
string

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

Media type application/json
object
code
string
details
docs_url
string
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
reason

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.

string
who_acts
string

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

Media type application/json
object
code
string
details
docs_url
string
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
next_actions
Array<object>
object
action
string
cli
string
description
string
http
string
tool
string
reason

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.

string
who_acts
string

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