Documentation menu

Exec service

POSThttps://api.instacloud.com/projects/{projectId}/services/{serviceId}/exec

Token scope: account · org · project — read-only tokens refused (not a GET).

Run a one-shot command inside a compute service's machine (wakes it first if scaled to zero). command is argv — no shell is invoked; use ["sh", "-c", "..."] for shell features. Gated under both deploy and secrets.read.

Parameters

NameInTypeRequiredDescription
projectIdpathstringyes
serviceIdpathstringyes

Request body

application/json

FieldTypeRequiredDescription
commandstring[]yes
timeoutSecintegernodefault 30s

Responses

200

Default Response

FieldTypeRequiredDescription
exitCodeintegeryes
stdoutstringyes
stderrstringyes
truncatedbooleannotrue when stdout or stderr was cut at the 1 MiB cap

202

Default Response

FieldTypeRequiredDescription
status"approval_required"no
approvalIdstringno
actionstringnothe gated action, or a comma-joined compound set — prefer `actions`
actionsstring[]noevery capability this approval covers
messagestringno
urlstringnothe console page where a project admin reviews this request
nextActionsobject[]no
nextActions.opstringyesNeutral logical action id, e.g. "service.add" — NOT an operationId or a CLI/MCP tool name; each client maps it to its own surface.
nextActions.reasonstringyesNatural-language, human/LLM-facing "why do this now".
nextActions.argsobjectnoSuggested, flat named arguments; "<placeholder>"s where a value is unknown.
nextActions.gatedbooleannoTrue if the action passes a governance gate.

400

Default Response

FieldTypeRequiredDescription
errorstringyes

403

Default Response

FieldTypeRequiredDescription
errorstringyes

404

Default Response

FieldTypeRequiredDescription
errorstringyes

502

Default Response

FieldTypeRequiredDescription
errorstringyes

504

the command ran past timeoutSec; not retryable as-is — detach long work or raise timeoutSec

FieldTypeRequiredDescription
errorstringyes
code"exec_timeout"yes
stdoutstringnowhat the command printed before the deadline; absent when the provider did not return it
stderrstringnowhat the command printed to stderr before the deadline; absent when the provider did not return it

View as Markdown