Skip to content

`POST /api/commands/{word}/invoke` — resolve `word` with the supplied args and, when `ready`, return the structured `ResponsePlan` (text / html / media / affordances) acknowledging the resolved invocation; an under-specified or invalid invocation returns the resolver's `need_param` / `invalid` guidance instead (never a half-run). A resolved word with no handler on this surface is `unsupported` with HTTP 422. An unknown OR role-hidden word is a 404.

POST
/api/commands/{word}/invoke
curl --request POST \
--url https://example.com/api/commands/example/invoke \
--header 'Content-Type: application/json' \
--cookie supacloud_session=<supacloud_session> \
--data '{ "args": { "additionalProperty": "example" }, "client_timezone": "example" }'

POST /api/commands/{word}/invoke — resolve word with the supplied args and, when ready, return the structured ResponsePlan (text / html / media / affordances) acknowledging the resolved invocation; an under-specified or invalid invocation returns the resolver’s need_param / invalid guidance instead (never a half-run). A resolved word with no handler on this surface is unsupported with HTTP 422. An unknown OR role-hidden word is a 404.

word
required
string

Command word or alias

Media typeapplication/json

The body of POST /api/commands/{word}/resolve and .../invoke: the partial arg bindings supplied so far (param name -> value). Absent = a bare invocation; the resolver/invoker fills in / asks for the rest.

object
args

Partial argument bindings keyed by param name.

object
key
additional properties
string
client_timezone

AUD-WIR-037 / SCG-137 — the caller’s IANA timezone (e.g. Europe/Berlin), sent by the web terminal from the browser. Not a command param: it rides beside args, so the descriptors and the positional binders stay unchanged. invoke hands it to the dispatched command (schedule add reads its times in it); an unparseable or absent zone means UTC. Ignored by resolve.

string | null

Example generated

{
"args": {
"additionalProperty": "example"
},
"client_timezone": "example"
}

OK

Media typeapplication/json

The POST /api/commands/{word}/invoke body — executed (with the resolved invocation + the rendered plan) | need_param | invalid | forbidden | unsupported (HTTP 422).

One of:

Fully resolved + acknowledged; plan is the rendered reply.

object
invocation
required

A replayable command invocation (ADR §2.2): word + resolved arg bindings.

object
args
required

Resolved arg bindings (param name -> chosen value).

object
key
additional properties
string
word
required
string
plan
required

A rendered command reply (ADR §2.2). #626 chat-format inversion — text is now NEUTRAL MARKDOWN (**bold**, `code`, …); the old html flag is gone. Each client renders the one markdown source to its own format (the web terminal -> ANSI).

object
affordances
required
Array<object>

A surface-neutral “next action” attached to a reply (ADR §2.2 Affordance).

object
action
required

A replayable command invocation (ADR §2.2): word + resolved arg bindings.

object
args
required

Resolved arg bindings (param name -> chosen value).

object
key
additional properties
string
word
required
string
glyph
string | null
label
required
string
media
required
Array<object>

A media artifact (ADR §2.2 Media) on the wire — source carries url XOR data.

object
alt
string | null
data
string | null
kind
required
string
mime
required
string
name
string | null
url
string | null
text
required

The reply body in neutral markdown.

string
status
required
string
Allowed values: executed

Example

{
"status": "executed"
}

Authentication required

Permission denied

No such command

The word resolved but has no handler on this surface (status: unsupported)

Media typeapplication/json

The POST /api/commands/{word}/invoke body — executed (with the resolved invocation + the rendered plan) | need_param | invalid | forbidden | unsupported (HTTP 422).

One of:

Fully resolved + acknowledged; plan is the rendered reply.

object
invocation
required

A replayable command invocation (ADR §2.2): word + resolved arg bindings.

object
args
required

Resolved arg bindings (param name -> chosen value).

object
key
additional properties
string
word
required
string
plan
required

A rendered command reply (ADR §2.2). #626 chat-format inversion — text is now NEUTRAL MARKDOWN (**bold**, `code`, …); the old html flag is gone. Each client renders the one markdown source to its own format (the web terminal -> ANSI).

object
affordances
required
Array<object>

A surface-neutral “next action” attached to a reply (ADR §2.2 Affordance).

object
action
required

A replayable command invocation (ADR §2.2): word + resolved arg bindings.

object
args
required

Resolved arg bindings (param name -> chosen value).

object
key
additional properties
string
word
required
string
glyph
string | null
label
required
string
media
required
Array<object>

A media artifact (ADR §2.2 Media) on the wire — source carries url XOR data.

object
alt
string | null
data
string | null
kind
required
string
mime
required
string
name
string | null
url
string | null
text
required

The reply body in neutral markdown.

string
status
required
string
Allowed values: executed

Example

{
"status": "executed"
}

Structured server error