UptimeTea

API Documentation

The UptimeTea API is easy to use and free for all plans.

Get on-call schedule

Returns a single on-call schedule by ID.

GET https://api.uptimetea.com/on_call_schedules/:id

Headers

  • AuthorizationREQUIREDSTRING
    Bearer $TOKEN

Response body

{
  "id": "uuid",
  "name": "Primary",
  "timezone": "Europe/Vilnius",
  "rotation_type": "weekly",
  "rotation_hours": null,
  "handoff_time": "09:00",
  "starts_on": "2024-01-15",
  "participants": [
    {
      "id": "uuid",
      "user_id": "uuid",
      "position": 0,
      "first_name": "Jane",
      "last_name": "Doe",
      "email": "jane@example.com"
    },
    {
      "id": "uuid",
      "user_id": "uuid",
      "position": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com"
    }
  ],
  "created_at": "2024-01-15T10:00:00Z",
  "on_call_user": {
    "id": "uuid",
    "first_name": "Jane",
    "last_name": "Doe",
    "email": "jane@example.com"
  },
  "next_on_call_user": {
    "id": "uuid",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com"
  },
  "next_handoff_at": "2024-01-22T07:00:00Z"
}

Code examples

curl -X GET "https://api.uptimetea.com/on_call_schedules/$ON_CALL_SCHEDULE_ID" \
  -H "Authorization: Bearer $TOKEN"
// Get on-call schedule
const response = await fetch('https://api.uptimetea.com/on_call_schedules/ON_CALL_SCHEDULE_ID', {
  headers: {
    'Authorization': 'Bearer ' + yourToken
  }
});

const data = await response.json();
console.log(data);
# Get on-call schedule
import requests

headers = {'Authorization': f'Bearer {your_token}'}

response = requests.get(
    'https://api.uptimetea.com/on_call_schedules/ON_CALL_SCHEDULE_ID',
    headers=headers
)

print(response.json())
// Get on-call schedule
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.uptimetea.com/on_call_schedules/ON_CALL_SCHEDULE_ID", nil)
    req.Header.Set("Authorization", "Bearer "+yourToken)

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    data, _ := io.ReadAll(resp.Body)
    fmt.Println(resp.Status, string(data))
}
# Get on-call schedule
require 'net/http'
require 'uri'

uri = URI('https://api.uptimetea.com/on_call_schedules/ON_CALL_SCHEDULE_ID')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{your_token}"

response = http.request(request)
puts response.code, response.body
<?php
// Get on-call schedule
$ch = curl_init('https://api.uptimetea.com/on_call_schedules/ON_CALL_SCHEDULE_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $yourToken
]);

$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);