Skip to content
Install

Run a one-shot command in a pod (synchronous, non-streaming)

POST
/pods/{podName}/exec
curl --request POST \
--url https://example.com/pods/example/exec \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "command": [ "example" ], "container": "example", "namespace": "example", "timeoutMs": 1 }'

Auth: authenticated (scope: exec)

podName
required
string
Media typeapplication/json
object
command
required

Command to run; a string is wrapped as [‘/bin/sh’, ‘-c’, command]

Any of:
string
container

Container name (defaults to the first container in the pod spec)

string
namespace

Pod namespace; required here or as a ?namespace= query param

string
timeoutMs

Timeout in milliseconds, clamped to 1000..300000 (default 60000)

integer
key
additional properties

Example generated

{
"command": [
"example"
],
"container": "example",
"namespace": "example",
"timeoutMs": 1
}

OK

Media typeapplication/json
object
container
required

The container the command ran in

string
stderr
required
string
stdout
required
string
success
required
boolean
key
additional properties

Example generated

{
"container": "example",
"stderr": "example",
"stdout": "example",
"success": true
}