Skip to content

List swap requests

GET
/v1/rotations/{rotationId}/swap-requests
curl --request GET \
--url 'https://api.roundrobinbot.eu/v1/rotations/example/swap-requests?from=2026-04-15T12%3A00%3A00Z&to=2026-04-15T12%3A00%3A00Z' \
--header 'Authorization: Bearer <token>'

Requires read:oncall and a key whose workspace and rotation selector permit this rotation. Returns requests overlapping the half-open UTC range [from, to), action capabilities and the rotation ETag. API keys have no participant identity, so all participant action capabilities are false. Returns at most 100 matching requests. If complete is false, narrow the range. Participant actions use these routes with a Slack member access token. API keys cannot perform them.

rotationId
required
string
from
required
string format: date-time
to
required
string format: date-time

OK

Media typeapplication/json

Requests overlapping the queried range. When complete is false, narrow the range.

object
items
required
Array<object>

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

object
request
required

The request.

object
id
required

The request identifier.

string
rotationId
required

The rotation identifier.

string
requesterUserId
required

The user who made the request.

string
recipientUserId
required

The user asked to swap.

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
key
required

The key of this leg within the request.

string
rotationId
required

The rotation identifier.

string
cellId
required

The identifier of the lane in a window.

string
holderUserId
required

The user who holds the interval.

string
from
required

The inclusive interval start.

string format: date-time
to
required

The exclusive interval end.

string format: date-time
arrangementId
required

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

null | string
phase
required

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

string
reason
required

The reason given with the request.

string
revision
required

The revision of the request.

integer format: int64
state
required

The lifecycle state of the request.

string
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
capability
required

The actions available to the caller.

object
canAccept
required

Whether the caller may accept the request.

boolean
canDecline
required

Whether the caller may decline the request.

boolean
canCancel
required

Whether the caller may cancel 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
rotationName
required

The name of the rotation.

string
asOfUtc
required

The instant the state, phase and capabilities were evaluated.

string format: date-time
active
required

True while the request is pending or accepted.

boolean
actionable
required

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

boolean
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
from
required
string format: date-time
to
required
string format: date-time
complete
required
boolean
nextCursor
null | string
Examplegenerated
{
"items": [
{
"request": {
"id": "example",
"rotationId": "example",
"requesterUserId": "example",
"recipientUserId": "example",
"legs": [
{
"key": "example",
"rotationId": "example",
"cellId": "example",
"holderUserId": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"arrangementId": "example",
"phase": "example"
}
],
"reason": "example",
"revision": 1,
"state": "example",
"phase": "example"
},
"capability": {
"canAccept": true,
"canDecline": true,
"canCancel": true,
"reason": "example",
"reasonCode": "example"
},
"rotationName": "example",
"asOfUtc": "2026-04-15T12:00:00Z",
"active": true,
"actionable": true,
"changesAtUtc": "2026-04-15T12:00:00Z"
}
],
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"complete": true,
"nextCursor": "example"
}