Skip to content

Approve a pending shell session (peer approval)

POST
/api/sessions/{session_id}/approve
curl --request POST \
--url 'https://example.com/api/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/approve?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "reason": "example" }'

Approve a pending shell session approval request.

The caller must hold device.shell.approve in this organisation. Self-approval (approver == requestor) is always rejected.

Errors

400 — self-approval attempt. 403 — caller lacks device.shell.approve. 404 — no pending approval for this session in this org. 409 — approval already decided. 422 — validation error.

session_id
required
Session Id
string format: uuid
organization_id
required
Organization Id
string format: uuid
Media type application/json
ApproveBody

Request body for POST /sessions/{id}/approve.

object
reason
Any of:
string
<= 1000 characters
Example generated
{
"reason": "example"
}

Successful Response

Media type application/json
ApprovalResponse

Public representation of an approval decision (S19-002).

Returned by POST /sessions/{id}/approve and POST /sessions/{id}/deny.

object
approver_id
required
Any of:
string format: uuid
decided_at
required
Any of:
string format: date-time
decision
required
Decision
string
id
required
Id
string format: uuid
Example generated
{
"approver_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"decided_at": "2026-04-15T12:00:00Z",
"decision": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}