Skip to content

Get a swap request

GET
/v1/rotations/{rotationId}/swap-requests/{requestId}
curl --request GET \
--url https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example \
--header 'Authorization: Bearer <token>'

Requires read:oncall and a key whose workspace and rotation selector permit this rotation. Returns the request, read-only action capabilities and rotation ETag. Closed requests remain readable. An inaccessible request returns 404.

rotationId
required
string
requestId
required
string

OK

Media typeapplication/json

A swap request, its rotation name and the actions available to this caller.

object
actionable
required

True when the caller may accept, decline or cancel the request.

boolean
active
required

True while the request is pending or accepted.

boolean
asOfUtc
required

The instant the state, phase and capabilities were evaluated.

string format: date-time
capability
required

The actions available to the caller.

object
canAccept
required

Whether the caller may accept the request.

boolean
canCancel
required

Whether the caller may cancel the request.

boolean
canDecline
required

Whether the caller may decline the request.

boolean
reason
required

The reason the actions are unavailable. Absent when they are available.

null | string
reasonCode
required

The same word as reason, or null when the actions are available.

null | string
changesAtUtc
required

The earliest later instant at which the state, a phase, active or actionable changes by the clock alone. Null when none will.

null | string format: date-time
request
required

The request.

object
id
required

The request identifier.

string
legs
required

The offered intervals.

Array<object>

An offered duty interval and its accepted assignment identifier, when present. phase is upcoming, running or ended for this leg at the time the response is built.

object
arrangementId
required

The accepted assignment identifier. Absent until the request is accepted.

null | string
cellId
required

The cell identifier.

string
from
required

The inclusive interval start.

string format: date-time
holderUserId
required

The user who holds the interval.

string
key
required

The key of this leg within the request.

string
phase
required

upcoming, running or ended for this leg at the instant the response is built.

string
rotationId
required

The rotation identifier.

string
to
required

The exclusive interval end.

string format: date-time
phase
required

upcoming before the earliest leg starts, ended once the latest leg has ended, running between, at the instant the response is built.

string
reason
required

The reason given with the request.

string
recipientUserId
required

The user asked to swap.

string
requesterUserId
required

The user who made the request.

string
revision
required

The revision of the request.

integer format: int64
rotationId
required

The rotation identifier.

string
state
required

The lifecycle state of the request.

string
rotationName
required

The name of the rotation.

string
Examplegenerated
{
"actionable": true,
"active": true,
"asOfUtc": "2026-04-15T12:00:00Z",
"capability": {
"canAccept": true,
"canCancel": true,
"canDecline": true,
"reason": "example",
"reasonCode": "example"
},
"changesAtUtc": "2026-04-15T12:00:00Z",
"request": {
"id": "example",
"legs": [
{
"arrangementId": "example",
"cellId": "example",
"from": "2026-04-15T12:00:00Z",
"holderUserId": "example",
"key": "example",
"phase": "example",
"rotationId": "example",
"to": "2026-04-15T12:00:00Z"
}
],
"phase": "example",
"reason": "example",
"recipientUserId": "example",
"requesterUserId": "example",
"revision": 1,
"rotationId": "example",
"state": "example"
},
"rotationName": "example"
}