v1
latestOpenAPI 3.1.02026-07-2676123203.9 KBPods
Trigger a pod state transition
Triggers a state transition on a pod. Send a JSON body with a single action field, e.g. { "action": "stop" }.
Valid actions:
- start — boot a stopped pod (EXITED or ERROR) back toward RUNNING.
- stop — stop a running or provisioning pod, releasing GPU/CPU compute while keeping its disk. The pod moves to EXITED.
- restart — restart a RUNNING pod's container in place.
- terminate — permanently delete the pod and release its resources (equivalent to deletePod).
Which actions are valid depends on the pod's current status, and the currently permitted set is published in the pod's actions field: RUNNING allows stop/restart/terminate; EXITED and ERROR allow start/terminate; PROVISIONING and STARTING allow stop/terminate.
start, stop, and restart return 200 with the updated pod. terminate returns 204 with no body. Requesting an action that is not valid for the pod's current status returns 409.
post/v2/pods/{id}/action
Request body
Response
Action applied — returns updated pod
Example response
{
"adjustedCostPerHr": 0.69,
"consumerUserId": "user_2PyTJrLzeuwfZilRZ7JhCQDuSqo",
"containerDiskInGb": 50,
"containerRegistryAuthId": "clzdaifot0001l90809257ynb",
"cpuFlavorId": "cpu3c",
"env": {
"ENV_VAR": "value"
},
"gpu": {
"count": 1
},
"id": "xedezhzb9la3ye",
"image": "runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04",
"lastStartedAt": "2024-07-12T19:14:40.144Z",
"lastStatusChange": "Rented by User: Fri Jul 12 2024 15:14:40 GMT-0400 (Eastern Daylight Time)",
"machine": {
"gpuType": {
"count": 1
}
},
"machineId": "s194cr8pls2z",
"memoryInGb": 62,
"networkVolume": {
"id": "agv6w2qcg7",
"name": "my network volume",
"size": 50,
"dataCenterId": "EU-RO-1"
},
"portMappings": {
"22": 10341
},
"ports": [
"8888/http",
"22/tcp"
],
"publicIp": "100.65.0.119",
"savingsPlans": [
{
"costPerHr": 0.21,
"endTime": "2024-07-12T19:14:40.144Z",
"gpuTypeId": "NVIDIA GeForce RTX 4090",
"id": "clkrb4qci0000mb09c7sualzo",
"podId": "xedezhzb9la3ye",
"startTime": "2024-05-12T19:14:40.144Z"
}
],
"vcpuCount": 24,
"volumeInGb": 20,
"volumeMountPath": "/workspace"
}