R2 Developers
R2 Connect API

Quickstart

From zero to your first API response in two minutes: get the key from the business owner and make a request.

Step 1 · Get the access key#

Keys are created by the business owner, not by you. Ask them to open their R2 dashboard and follow this path:

  1. Settings → R2 Connect API
  2. Click New key
  3. Give it a name that identifies your system (for example, your software’s name)
  4. Check only the permissions your integration needs
  5. Copy the key and store it somewhere safe

The key is shown only once

For security, R2 stores only an encrypted fingerprint of the key, never the key itself. If it is lost it cannot be recovered: it must be revoked and a new one created.

Step 2 · Verify the connection#

The /account resource requires no permission and tells you which business the key belongs to and what it may read. It is the fastest way to confirm everything works:

bash
curl -H "Authorization: Bearer TU_LLAVE" \
  "https://api.r2-os.com/api/connect/v1/account"

Response:

json
{
  "data": {
    "id": "k97fa2c8de1b04",
    "name": "Hotel Bahía del Sol",
    "vertical": "hospitality",
    "currency": "MXN",
    "api_version": "v1",
    "scopes": ["read:reservations", "read:payments"],
    "key_prefix": "r2k_a1b2c3d4"
  }
}

Step 3 · Read real data#

With the connection confirmed, request reservations created since a date:

bash
curl -H "Authorization: Bearer TU_LLAVE" \
  "https://api.r2-os.com/api/connect/v1/reservations?created_from=2026-01-01&limit=25"

Every list response carries data with the results and pagination to request the next page. See pagination and filters.

Examples in other languages#

javascript
// Node.js / JavaScript
const res = await fetch(
  "https://api.r2-os.com/api/connect/v1/reservations?limit=25",
  { headers: { Authorization: `Bearer ${process.env.R2_API_KEY}` } }
);
const { data, pagination } = await res.json();
console.log(data.length, "reservations · has more:", pagination.has_more);
python
# Python
import os, requests

r = requests.get(
    "https://api.r2-os.com/api/connect/v1/reservations",
    headers={"Authorization": f"Bearer {os.environ['R2_API_KEY']}"},
    params={"created_from": "2026-01-01", "limit": 25},
)
r.raise_for_status()
payload = r.json()
print(len(payload["data"]), "reservations")