DevelopersOpenAPIOpen StandardSuite

Build on StandardSuite

Let people sign in to your Standard Works project with their Standard ID, and read accounts, plans and teams from your server with the StandardSuite API.

Standard ID

Standard ID is the account people already use for StandardSuite. Your project can use it to sign people in. It’s standard OpenID Connect, so most sign-in libraries work out of the box: point them at the discovery document and give them your client ID.

# issuer

# discovery
/.well-known/openid-configuration
Every person gets a Standard ID number (the sub claim): 32 hex characters, never changing, and the same in every Standard Works project. Use it, not the email address, to recognise someone. Emails change.

1. Register your project

An admin registers it in Admin → Standard ID → Register an app, giving:

2. Sign someone in (authorization code flow with PKCE)

Send the person to the authorize endpoint. Always send a random state and check it when they come back. For apps without a secret, PKCE is required; it’s recommended for everyone.

// Node 18+, on your server
import crypto from 'node:crypto';
const ISSUER = '';
const verifier = crypto.randomBytes(32).toString('base64url');
const challenge = crypto.createHash('sha256').update(verifier).digest('base64url');
const state = crypto.randomBytes(16).toString('base64url');
// keep verifier and state in the person's session, then redirect them to:
const url = `${ISSUER}/oauth/authorize?` + new URLSearchParams({
  client_id: 'sw_…', redirect_uri: 'https://project.standardworks.studio/callback',
  response_type: 'code', scope: 'openid profile email', state,
  code_challenge: challenge, code_challenge_method: 'S256',
});

If they aren’t signed in to Standard ID, they sign in first. If your app hasn’t been allowed yet, they see what it’s asking for and choose Allow or Cancel. Then they come back to your redirect address with ?code=…&state=…&iss=…, or ?error=access_denied if they said no.

Swap the code for tokens within two minutes:

const r = await fetch(`${ISSUER}/oauth/token`, {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded',
            Authorization: 'Basic ' + Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString('base64')},
  body: new URLSearchParams({grant_type: 'authorization_code', code, redirect_uri, code_verifier: verifier}),
});
const {access_token, id_token, refresh_token, expires_in} = await r.json();

Check the ID token before trusting it. Your OpenID Connect library does this: the RS256 signature against /oauth/jwks.json, iss, aud (your client ID), exp, and the nonce if you sent one. Or skip the ID token and call /oauth/userinfo with the access token.

Use prompt=none to sign someone in silently: you get error=login_required or consent_required instead of a page. Use prompt=consent to ask again.

3. Tokens

TokenLastsNotes
Authorization code2 minutesWorks once. Using it twice revokes everything it gave.
Access token1 hourSend as Authorization: Bearer …. Opaque: don’t parse it.
ID token1 hourA signed JWT saying who signed in. Only with the openid scope.
Refresh token30 daysOnly with the offline_access scope. A new one comes with every refresh, so keep the newest. Using an old one again revokes the whole chain.
body: new URLSearchParams({grant_type: 'refresh_token', refresh_token})   // optional: scope=… to ask for fewer

Tokens stop working when the person disconnects your app on their account page, when their account is suspended, or when an admin turns your app off. Your app gets 401 invalid_token; send them through sign-in again.

4. Scopes and claims

ScopeGives
openidsub: the Standard ID number. Always needed.
profilename
emailemail, email_verified
planplan (free, pro, team) and plan_name; on /api/id/v1/me, also the plan’s limits and the apps the person has through a team
offline_accessA refresh token

5. Signing out

Sign the person out of your project yourself. To sign them out of Standard ID too, send them to /oauth/logout?id_token_hint=…&post_logout_redirect_uri=…&state=…. The return address must be one of your registered sign-out (or redirect) addresses; without a valid id_token_hint nobody is signed out. Revoke your refresh token with POST /oauth/revoke as well.

Standard ID endpoints

GET/.well-known/openid-configurationDiscovery
GET/oauth/authorizeStart sign-in (a page the person visits)
POST/oauth/tokenCode or refresh token → tokens (form-encoded)
GET/oauth/userinfoClaims for the access token
GET/api/id/v1/meThe person as JSON, with plan details (scope plan)
GET/oauth/jwks.jsonSigning keys (they rotate; cache for minutes, not days)
POST/oauth/revokeRevoke a token (RFC 7009)
POST/oauth/introspectIs a token live? (RFC 7662; apps with a secret)
GET/oauth/logoutSign out of Standard ID

The token, userinfo, revoke, JWKS and /api/id/v1/me endpoints allow cross-origin requests, so single-page apps can call them directly. Never put a client secret in a web page or a phone app.

Server API

For your project’s server to read and manage StandardSuite: look up accounts and teams, read plans, and manage billing. Base address: /api/v1. Everything is JSON. The full description is /api/v1/openapi.json.

Keys and scopes

An admin makes a key in Admin → API keys and picks what it can do. The key is shown once. Send it as Authorization: Bearer mwk_…, and keep it on your server: anyone with it can do what its scopes allow.

ScopeAllows
users:readLook up accounts: name, email, Standard ID number, plan, teams
teams:readTeams, their apps, seats and members
pricing:readPlans: prices, limits, names and perks; price history
pricing:writeChange Pro and Team prices
billing:readCustomers, subscriptions, invoices and revenue
billing:writeGrant plans, cancel or resume subscriptions, checkout and billing portal links

Endpoints

EndpointScopeWhat
GET/api/v1anyThis key and its scopes
GET/api/v1/users?email=&q=&limit=&offset=users:readFind accounts
GET/api/v1/users/{number, email or Standard ID}users:readOne account. Pass the sub from sign-in to see who it is.
GET/api/v1/teams, /api/v1/teams/{id}teams:readTeams, and one team with its members
GET/api/v1/planspricing:readPlans with prices, limits and perks
PUT/api/v1/plans/{plan}/prices/{cycle}pricing:writeSet a price (send an Idempotency-Key header)
GET/api/v1/customers, /api/v1/customers/{ref}billing:readCustomers and their subscriptions
POST/api/v1/customers/{ref}/grant|cancel|resume|sync|checkout|portalbilling:writeBilling actions
GET/api/v1/statsbilling:readAccounts, subscriptions and estimated monthly revenue
curl -H "Authorization: Bearer $STANDARD_API_KEY" /api/v1/users/0f4c…e91a

Errors and limits

Errors come back as {"error": "what went wrong", "code": "machine_readable"} with a matching status: 401 no or bad key, 403 missing scope, 404 not found, 429 too many requests (300 a minute per key). Standard ID’s OAuth endpoints use OAuth’s own shape: {"error": "invalid_grant", "error_description": "…"}. Everything a key changes is in the admin audit log under its name.

Apps using Standard ID or the API also agree to the developer terms, and must publish their own privacy policy.

Admins can list your project in every app’s launcher, under Standard Works projects: Admin → Standard ID → Linked projects. Choose who sees it (everyone, signed-in people, or staff while it’s being built) and which Standard ID app it signs in with. People then see an ID badge and know their account works there.