Cloud › Logs and shell
Open a shell
POST https://devapi.dispralabs.com/v1/cloud/services/:svc/console
Mints a single-use ticket for a terminal shell in one running replica. Open a WebSocket to ws_url within 5 minutes, without an Origin header: binary frames carry the terminal, a text frame {"t":"resize","cols":120,"rows":30} resizes it. The shell closes after 10 idle minutes, or after an hour.
Needs full access.
Needs a key with full access.
- Authentication: Secret key (send it as
Authorization: Bearer <key>) - Idempotency: Safe to retry. Send an
Idempotency-Keyheader and repeated calls within 24 hours return the first result.
Parameters
svcstring, required: The service's id. Example:svc_01jdk3n2f4g6h8j0k2l4z6x8ca
Returns
- 200 The console session object: The ticket.
Errors
| Status | Code | When |
|---|---|---|
| 404 | not_found | No such object in the key's project (or environment). |
| 409 | not_running | The service has no running replica. |
| 409 | console_unavailable | Shells aren't available in this region yet. |
Request samples
Dispra Cloud CLI
dcloud ssh api
cURL
curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console" \
-H "Authorization: Bearer dsp_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)"
Node
const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console", {
method: "POST",
headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() },
});
console.log(await res.json());
Python
import uuid, requests
res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())})
print(res.json())
Go
req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console", nil)
req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY")
req.Header.Set("Idempotency-Key", uuid.NewString())
res, _ := http.DefaultClient.Do(req)
Responses
200
{
"data": {
"token": "eyJhbGciOiJFZERTQSJ9.eyJzdWIiOi4uLn0.c2ln",
"ws_url": "wss://core.cloud.dispralabs.com/v1/console/connect?token=eyJ...",
"expires_at": "2026-12-05T10:15:02Z",
"idle_timeout_s": 600,
"max_session_s": 3600
}
}
404 not_found
{
"error": {
"code": "not_found",
"message": "No such object in the key's project (or environment).",
"request_id": "req_7f3a9c21d84be056"
}
}
409 not_running
{
"error": {
"code": "not_running",
"message": "The service has no running replica.",
"request_id": "req_7f3a9c21d84be056"
}
}
409 console_unavailable
{
"error": {
"code": "console_unavailable",
"message": "Shells aren't available in this region yet.",
"request_id": "req_7f3a9c21d84be056"
}
}