UptimeTea

API Documentation

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

Get billing

Returns your plan and, with an active subscription, when the current period ends and whether it cancels then.

GET https://api.uptimetea.com/billing

Headers

  • AuthorizationREQUIREDSTRING
    Bearer $TOKEN

Response body

{
  "current_plan": "team",
  "stripe_customer_id": "cus_123",
  "stripe_subscription_id": "sub_123",
  "current_period_end": "2024-02-15T10:00:00Z",
  "cancel_at_period_end": false
}

Code examples

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

const data = await response.json();
console.log(data);
# Get billing
import requests

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

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

print(response.json())
// Get billing
package main

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

func main() {
    req, _ := http.NewRequest("GET", "https://api.uptimetea.com/billing", 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 billing
require 'net/http'
require 'uri'

uri = URI('https://api.uptimetea.com/billing')
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 billing
$ch = curl_init('https://api.uptimetea.com/billing');
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);