Platform API

Where to start: who you are, your organizations, every product and what an organization subscribes to.

Address
https://sparkyli.com/api/v1
Plan
Any plan, with API access switched on for the organization

Endpoints

GET /

The directory of every API, how to sign in and where each specification is. No sign-in needed.

Answer: (top level)

NameTypeWhat it is
name, versiontextThe directory's name and API version (v1).
authobjectissuer (the sign-in address), openid_configuration (where OAuth clients find the sign-in endpoints), flows (person, program) and a note about plans and the API switch.
apislistOne row per API: slug, name, status (live or planned), summary, access (read or read and write, null if not live), requires_paid_plan, sign_in (person, program), base_url and openapi (where its specification is).

GET /products

Every product, where it lives and whether it has an API. No sign-in needed.

Answer: products (a list)

NameTypeWhat it is
slug, name, short_nametextThe product's id and names.
urltextWhere the product lives.
apilive, planned or noneWhether it has an API yet.

GET /me

You, your organizations, your role in each product and whether each organization has switched API access on.

Call this first. The organization ids it returns are what you send as x-sparky-org to every other API when you belong to several.

Answer: (top level)

NameTypeWhat it is
userobjectid, email and name.
organizationslistEach has id, name, personal (true for your own), api_access_enabled and roles (your role per product slug).
apislistThe live APIs with their base_url.

Errors (besides the common ones)

  • 401 unauthorized: No token, or it is invalid or has expired.

GET /subscriptions

Plan, status and seats per product, and whether the plan includes the API.

Owners and admins only. Never payment details.

Inputs

NameTypeWhat it is
org_idtextOne of the ids from /me. Needed only if you belong to several organizations.

Answer: (top level)

NameTypeWhat it is
organizationobjectid, name and api_access_enabled.
subscriptionslistPer product: product, name, plan, plan_name, status, seats and api (status, and included_in_plan: whether the plan includes the API).

Errors (besides the common ones)

  • 400 org_required: You belong to several organizations; pass org_id.
  • 403 forbidden: Only an owner or admin can see subscriptions.
  • 404 not_found: That is not one of your organizations.

Example

curl -s -H "authorization: Bearer $TOKEN" https://sparkyli.com/api/v1/me

New here? Start with the three things first, then sign in. Errors are explained under errors and limits.