Skip to content

Stop every running workspace using this role

POST
/agent-roles/{id}/stop-workspaces
curl --request POST \
--url https://your-org.evershell.ai/v1/agent-roles/example/stop-workspaces \
--header 'Authorization: Bearer <token>'

Permissions: workspace:write (unscoped — bulk lifecycle crosses users, so no :own variant).

Bulk stop — fires POST /workspaces/{id}/stop against every workspace currently using this role. Returns the count of workspaces that transitioned into a stopping state. Idempotent: already-stopped workspaces are skipped silently.

id
required
string

OK

Media type application/json
object
stopping
required

Number of workspaces that received a stop signal.

integer
Example generated
{
"stopping": 1
}

Resource not found in the caller’s org

Media type application/json
object
error
required
object
code
required

Closed-enum slug (e.g. permission_denied, validation_error, workspace_not_found)

string
message
required

Human-readable summary

string
request_id
required

Server-generated request id for correlating logs

string
details

Optional structured context. Validation errors land at details.fields as a per-field map.

object
key
additional properties
any
Example
{
"error": {
"code": "permission_denied",
"message": "caller lacks required scope",
"request_id": "7f3a9c2e"
}
}