Skip to content

Request best-effort cancellation

POST
/commands/{command_id}/cancel
curl --request POST \
--url https://api.flotera.com/api/v1/commands/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel \
--cookie __Host-erm_session=<__Host-erm_session>

Creates a cancel request (command.cancel.requested.v1). Terminal commands return 409 conflict. Cancellation is best-effort; the agent confirms with command.cancelled.

command_id
required

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
Idempotency-Key
string
>= 1 characters <= 128 characters /^[\x21-\x7E]{1,128}$/

Idempotency key, 1–128 ASCII, unique per (tenant_id, operation, key) for at least 24 hours. Retrying with the same body replays the stored response; a different body returns 409 idempotency_conflict.

Cancel requested; current projection returned.

Media typeapplication/json

Command projection with independent delivery and execution axes.

object
command_id
required

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
tenant_id
required

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
server_id
required

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
type
required
string
/^[a-z][a-z0-9_.-]{1,63}$/
schema_version
required
integer
>= 1
params
required
object
requires
required

Execution precondition. Dangerous actions during an active rental default to after_rental.

string
Allowed values: none idle after_rental
delivery_status
required

Delivery axis of the command state.

string
Allowed values: queued routing sent accepted delivery_failed
execution_status
required

Execution axis of the command state.

string
Allowed values: not_started running succeeded failed cancelled expired
queue_reason

Why the command has not been sent yet (02 §8.1). Known values: server_offline, awaiting_retry. Null once delivery is in flight. Consumers must tolerate unknown values.

string | null
<= 64 characters
progress
integer | null
<= 100
result

Terminal success payload.

object | null
error
Any of:

Structured terminal error. Secrets and raw stdout are forbidden.

object
code
required
string
/^[a-z][a-z0-9_]{1,63}$/
message
required
string
<= 1024 characters
retryable
required
boolean
stage
string | null
<= 64 characters
details

Small structured context (e.g. exit_code). Bounded, no secrets.

object
log_ref

Opaque reference to the redacted bounded log (GET /commands/{id}/logs/{log_id}).

string | null
<= 256 characters
issued_by
required
object
type
required
string
Allowed values: user pat agent system
id
Any of:

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
idempotency_key
string | null
<= 128 characters
created_at
required

RFC 3339 UTC with microsecond precision.

string format: date-time
accept_by

RFC 3339 UTC with microsecond precision, or null.

string | null format: date-time
deadline

RFC 3339 UTC with microsecond precision, or null.

string | null format: date-time
sent_at

RFC 3339 UTC with microsecond precision, or null.

string | null format: date-time
accepted_at

RFC 3339 UTC with microsecond precision, or null.

string | null format: date-time
started_at

RFC 3339 UTC with microsecond precision, or null.

string | null format: date-time
finished_at

RFC 3339 UTC with microsecond precision, or null.

string | null format: date-time
cancelled_at

RFC 3339 UTC with microsecond precision, or null.

string | null format: date-time
version
required

Monotonic resource version used for ETag/If-Match.

integer
Example
{
"requires": "none",
"delivery_status": "queued",
"execution_status": "not_started",
"issued_by": {
"type": "user"
},
"created_at": "2026-07-25T10:15:30.123456Z"
}

Missing/invalid credentials (code=unauthorized).

Media typeapplication/problem+json

RFC 9457 problem document with a stable machine code.

object
type
required
string format: uri
title
required
string
<= 256 characters
status
required
integer
>= 100 <= 599
code
required

Stable machine-readable error code (03 §2.4).

string
Allowed values: unauthorized forbidden csrf_rejected not_found conflict idempotency_conflict validation_failed rate_limited payload_too_large unsupported_agent_version temporarily_unavailable offline_queue_full online_queue_full plan_required server_limit_reached feature_not_entitled account_in_grace account_frozen payment_pending payment_expired payment_amount_mismatch change_already_pending change_already_applied change_effective reserve_not_covered direction_changed
detail
string
<= 2048 characters
instance
string
<= 512 characters
request_id

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
errors
Array<object>
<= 100 items
object
path
required

JSON Pointer to the offending field.

string
<= 512 characters
code
required
string
<= 64 characters
Example
{
"type": "https://ermeon.com/problems/validation",
"code": "unauthorized"
}

Authenticated but not permitted. code=forbidden — role/scope mismatch; code=feature_not_entitled — the plan does not include the capability; code=account_frozen — the account is frozen and this operation is declared x-ermeon-frozen: deny. The three are deliberately distinct: only the last one is fixed by a top-up (13 §5.6).

Media typeapplication/problem+json

RFC 9457 problem document with a stable machine code.

object
type
required
string format: uri
title
required
string
<= 256 characters
status
required
integer
>= 100 <= 599
code
required

Stable machine-readable error code (03 §2.4).

string
Allowed values: unauthorized forbidden csrf_rejected not_found conflict idempotency_conflict validation_failed rate_limited payload_too_large unsupported_agent_version temporarily_unavailable offline_queue_full online_queue_full plan_required server_limit_reached feature_not_entitled account_in_grace account_frozen payment_pending payment_expired payment_amount_mismatch change_already_pending change_already_applied change_effective reserve_not_covered direction_changed
detail
string
<= 2048 characters
instance
string
<= 512 characters
request_id

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
errors
Array<object>
<= 100 items
object
path
required

JSON Pointer to the offending field.

string
<= 512 characters
code
required
string
<= 64 characters
Example
{
"type": "https://ermeon.com/problems/validation",
"code": "unauthorized"
}

Resource does not exist in this tenant. Foreign identifiers also return 404 (anti-enumeration).

Media typeapplication/problem+json

RFC 9457 problem document with a stable machine code.

object
type
required
string format: uri
title
required
string
<= 256 characters
status
required
integer
>= 100 <= 599
code
required

Stable machine-readable error code (03 §2.4).

string
Allowed values: unauthorized forbidden csrf_rejected not_found conflict idempotency_conflict validation_failed rate_limited payload_too_large unsupported_agent_version temporarily_unavailable offline_queue_full online_queue_full plan_required server_limit_reached feature_not_entitled account_in_grace account_frozen payment_pending payment_expired payment_amount_mismatch change_already_pending change_already_applied change_effective reserve_not_covered direction_changed
detail
string
<= 2048 characters
instance
string
<= 512 characters
request_id

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
errors
Array<object>
<= 100 items
object
path
required

JSON Pointer to the offending field.

string
<= 512 characters
code
required
string
<= 64 characters
Example
{
"type": "https://ermeon.com/problems/validation",
"code": "unauthorized"
}

State conflict (code=conflict, idempotency_conflict, offline_queue_full or online_queue_full).

Media typeapplication/problem+json

RFC 9457 problem document with a stable machine code.

object
type
required
string format: uri
title
required
string
<= 256 characters
status
required
integer
>= 100 <= 599
code
required

Stable machine-readable error code (03 §2.4).

string
Allowed values: unauthorized forbidden csrf_rejected not_found conflict idempotency_conflict validation_failed rate_limited payload_too_large unsupported_agent_version temporarily_unavailable offline_queue_full online_queue_full plan_required server_limit_reached feature_not_entitled account_in_grace account_frozen payment_pending payment_expired payment_amount_mismatch change_already_pending change_already_applied change_effective reserve_not_covered direction_changed
detail
string
<= 2048 characters
instance
string
<= 512 characters
request_id

UUID (v7 for new entities; v4 accepted during migration).

string format: uuid
errors
Array<object>
<= 100 items
object
path
required

JSON Pointer to the offending field.

string
<= 512 characters
code
required
string
<= 64 characters
Example
{
"type": "https://ermeon.com/problems/validation",
"code": "unauthorized"
}