Developers
REST API
Read and update subscriptions, payments and renewals from your own scripts, BI and internal tools. This guide covers keys, conventions and good habits; every endpoint is in the API reference.
Overview
The SysCost API is a JSON REST API over everything in a workspace: subscriptions, the payment ledger, categories, your own providers, the payment calendar and the dashboard figures. Use it to sync renewals into your finance tools, feed a data warehouse or BI, or automate payment records from your own systems.
| Item | Value |
|---|---|
| Base URL | https://syscost.app/api/v1 |
| Format | JSON request and response bodies, UTF-8. Send Content-Type: application/json with every body. |
| Authentication | A workspace API key as a bearer token. |
| Version | v1, in the path. Changes to v1 only ever add things. |
| Machine-readable spec | OpenAPI 3.1 at /api/v1/openapi.json, for client generators, Postman or Insomnia. |
Every request acts in the workspace that owns the key. The API applies the same rules as the app: validation, plan limits, the activity log and notifications all behave exactly as they do when someone uses SysCost in the browser.
Authentication
Create a key
In SysCost, open Settings → Data & API → API keys. Owners and admins of the workspace can create keys; the REST API is part of the Pro and Team plans.
Choose its access
A read-only key can call every
GETendpoint. A read-and-write key can also create, change and delete. Give each integration the least it needs.Copy it once
The full key is shown only when it is created. Store it in your secret manager; SysCost keeps only a fingerprint of it, so it cannot show it again.
Send it with every request
Put it in the
Authorizationheader as a bearer token.
Authorization: Bearer sck_XXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX| Topic | Behaviour |
|---|---|
| Workspace | A key works in its own workspace only. |
| Permissions | A key acts with its creator's permissions, limited by its access: a read-only key never writes, and a key stops writing if its creator loses that right. |
| Activity log | Every change a key makes appears in the activity log as its creator, followed by the key's name, e.g. [email protected] (API key "Finance sync"). |
| Expiry | Optional: 30 days, 90 days or a year. An expired key gets 401. |
| Rotating | Rotate a key you created in Settings to give it a new secret. Its name, access and expiry stay the same; the old secret stops working at once, and the new one is shown once. |
| Revoking | Revoke a key in Settings at any time. It stops working at once. A key also stops when its creator leaves the workspace. |
| Limit | Up to 25 active keys per workspace. |
Keep keys on your servers
API keys are secrets. Never put one in a browser app, a mobile app or a public repository. If a key may have leaked, rotate it (or revoke it). Changing your password does not change your keys.
Your first request
GET /workspace is the simplest call: it returns the workspace the key belongs to and the key's own name and access, so it is a quick way to check that a key works.
curl https://syscost.app/api/v1/workspace \
-H "Authorization: Bearer $SYSCOST_API_KEY"{
"id": "5f0c2a4e-8d1b-4c7a-9e3f-2b6d8a1c4e7f",
"name": "Acme",
"plan": "team",
"timezone": "Europe/Berlin",
"default_currency": "EUR",
"api_key": { "name": "Finance sync", "scope": "read" }
}The same idea in code, listing every subscription:
// Node.js 18+ (built-in fetch)
const base = 'https://syscost.app/api/v1'
const headers = { Authorization: `Bearer ${process.env.SYSCOST_API_KEY}` }
const response = await fetch(`${base}/subscriptions`, { headers })
if (!response.ok) {
const error = await response.json()
throw new Error(`${response.status} ${error.code ?? error.error}: ${error.message}`)
}
const subscriptions = await response.json()
for (const s of subscriptions) console.log(s.name, s.amount, s.currency, s.billing_cycle)# Python 3 with requests
import os
import requests
base = "https://syscost.app/api/v1"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['SYSCOST_API_KEY']}"
response = session.get(f"{base}/subscriptions", timeout=30)
response.raise_for_status()
for s in response.json():
print(s["name"], s["amount"], s["currency"], s["billing_cycle"])Every endpoint, with its fields and examples, is in the API reference.
Errors
Errors use HTTP status codes and a JSON body with a human-readable message and, where it helps, a machine-readable code and the field at fault. Branch on statusCode and code; show message to people.
HTTP/1.1 403 Forbidden
Content-Type: application/json
{
"statusCode": 403,
"error": "Forbidden",
"code": "insufficient_scope",
"message": "This API key is read-only. Create a read-write key to make changes."
}| Status | Meaning | What to do |
|---|---|---|
400 | The request is invalid: a missing field, a wrong type, a bad date. | Fix the request; message and field say what is wrong. |
401 invalid_api_key | The key is missing, malformed, unknown, revoked or expired. | Check the header; create a new key if needed. |
402 plan_required / plan_limit | The workspace's plan doesn't include the API, or a plan limit is reached. | Upgrade the plan, or remove something first. |
403 | The key may not do this: insufficient_scope (read-only key), insufficient_role, email_unverified, or a suspended account or workspace. | Use a read-and-write key, or ask an admin. |
404 | No such record in this workspace. | Check the ID. Records of other workspaces are never visible. |
409 | The change conflicts with existing data, e.g. a category name that exists or a payment moved onto a taken due date. | Read message; change the request. |
429 | Too many requests for this key. | Wait for Retry-After seconds, then retry. |
5xx | Something failed on our side. | Retry with backoff; it is safe for reads. |
Rate limits
Each key may make 60 requests a minute, and all keys of a workspace share a combined budget. Every response says where the key stands, so a client can slow down before it is refused. Whichever limit is reached first answers 429 with retry-after.
| Header | Meaning |
|---|---|
x-ratelimit-limit | Requests allowed per minute for this key. |
x-ratelimit-remaining | Requests left in the current minute. |
x-ratelimit-reset | Seconds until the budget refills. |
retry-after | On a 429 only: how many seconds to wait before retrying. |
// Respect 429 and retry transient failures with backoff.
async function call(url, init = {}, attempt = 1) {
const response = await fetch(url, { ...init, headers: { ...headers, ...init.headers } })
if ((response.status === 429 || response.status >= 500) && attempt < 5) {
const wait = Number(response.headers.get('retry-after') ?? 2 ** attempt)
await new Promise((resolve) => setTimeout(resolve, wait * 1000))
return call(url, init, attempt + 1)
}
return response
}Syncing a lot? Use change webhooks instead of polling, read pages of up to 100 records, and send writes one after another rather than in parallel.
Pagination
GET /payments and a subscription's timeline return pages. Ask for up to 100 items with limit (25 by default); each response has meta.hasNextPage and meta.nextCursor. Pass the cursor back as cursor to get the next page. Cursors are opaque: don't build or change them.
// Every payment record, 100 at a time.
async function allPayments() {
const records = []
let cursor = null
do {
const query = new URLSearchParams({ limit: '100', ...(cursor ? { cursor } : {}) })
const response = await fetch(`https://syscost.app/api/v1/payments?${query}`, { headers })
const page = await response.json()
records.push(...page.data)
cursor = page.meta.hasNextPage ? page.meta.nextCursor : null
} while (cursor)
return records
}Lists of subscriptions, categories and providers return everything in one response.
Dates, money and statuses
| Topic | Rule |
|---|---|
| IDs | UUIDs. Treat them as opaque strings. |
| Dates | Calendar dates are YYYY-MM-DD (due_date, billing_anchor_date); moments are ISO 8601 in UTC (created_at). |
| "Today" | The workspace's own date in its time zone (GET /workspace → timezone). It decides what is upcoming and what is overdue. |
| Money | Amounts are decimal numbers in their own currency, e.g. 20 or 49.99 with currency: "USD". Currencies are ISO 4217 codes. |
| Totals | Amounts in different currencies are never added together. The dashboard converts them into the workspace currency with daily European Central Bank rates and says which day's rate it used. |
| Recorded statuses | paid, due, failed or skipped: what someone recorded for a due date. |
| Derived statuses | upcoming, overdue or untracked (before the subscription was added): computed for due dates nobody has recorded. You never send these. |
| Billing cycles | monthly, quarterly or yearly, counted from billing_anchor_date. Month-end dates stay at the end of shorter months. |
Creating and recording
Create a subscription. It needs a category, so create one first (or list them with GET /categories):
curl https://syscost.app/api/v1/subscriptions \
-H "Authorization: Bearer $SYSCOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Vercel Pro",
"provider_slug": "vercel",
"amount": 20,
"currency": "USD",
"billing_cycle": "monthly",
"billing_anchor_date": "2026-01-05",
"category_id": "5f0c2a4e-8d1b-4c7a-9e3f-2b6d8a1c4e7f"
}'Record what happened to a due date, for example from your card or accounting system:
curl https://syscost.app/api/v1/payments \
-H "Authorization: Bearer $SYSCOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subscription_id": "5f0c2a4e-8d1b-4c7a-9e3f-2b6d8a1c4e7f",
"due_date": "2026-11-05",
"status": "paid",
"amount_paid": 20,
"currency": "USD",
"paid_on_date": "2026-11-05"
}'| Call | Safe to retry? |
|---|---|
Any GET | Yes. |
POST /payments | Yes. Recording a due date that already has a record updates that record, so a retried call never makes a duplicate. |
PATCH and PUT | Yes. They set fields to the values you send. |
DELETE | Yes. A second call returns 404, which means it is already gone. |
POST /subscriptions, /categories, /providers | Check first. A retry after a timeout can create a second record; list and compare before retrying. |
Notifications follow your changes
A payment recorded through the API notifies the channels that subscribe to payment updates, exactly as if someone had clicked the button, and every change can be sent to your systems as a change event.
Versioning and changes
v1 only grows: new endpoints, new optional request fields and new response fields may appear, so ignore fields you don't know. Anything that would break a working client (removing or renaming a field, a stricter rule) comes as v2, announced in the changelog with time to move.
The OpenAPI 3.1 document at https://syscost.app/api/v1/openapi.json always matches what the API does: import it into Postman, Insomnia or a client generator.