Get a swap request
GET
/v1/rotations/{rotationId}/swap-requests/{requestId}
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example"), Headers = { { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'GET', url: 'https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example', headers: {Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”rotationId
required
string
requestId
required
string
Responses
Section titled “Responses”OK
Media typeapplication/json
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
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
Examplegenerated
{ "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"}