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 participants, offered intervals and current state of a swap request.

object
id
required
string
rotationId
required
string
requesterUserId
required
string
recipientUserId
required
string
legs
required
Array<object>

An offered duty interval and its accepted assignment identifier, when present.

object
key
required
string
rotationId
required
string
cellId
required
string
holderUserId
required
string
from
required
string format: date-time
to
required
string format: date-time
arrangementId
required
null | string
reason
required
string
revision
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
state
required
string
capability
required

Actions available to this caller. Each action rechecks permissions and duty.

object
canAccept
required
boolean
canDecline
required
boolean
canCancel
required
boolean
reason
required
null | string
rotationName
required
string
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"
}
],
"reason": "example",
"revision": 1,
"state": "example"
},
"capability": {
"canAccept": true,
"canDecline": true,
"canCancel": true,
"reason": "example"
},
"rotationName": "example"
}
],
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"complete": true,
"nextCursor": "example"
}