API
JSON over HTTP. Public endpoints need no account; the organization API reads and changes your own organization with a token.
Public endpoints
No token: the blueprint catalogue and the demo organization.
GET/api/v1/blueprints/matchRank the blueprint catalog against an organization profile, with the reason behind every score.
/api/v1/blueprints/match?industry=banking&country=TR&headcount=3000&ownership=listedGET/api/v1/blueprints/{key}A blueprint sized to your parameters: the change log that builds it and its administrative tree.
/api/v1/blueprints/functional.manufacturing.TR?headcount=400&ownership=family®ions=2GET/api/v1/demo/{perspective}The demo organization through one perspective, as of a date or in a scenario, with its rule checks.
/api/v1/demo/administrative?scenario=restructure-2027
Organization API
Owners and admins create a token under Governance › Settings › API tokens. Every token reads its organization; one with “May record changes” also writes, and costs need “May see and change costs”.
curl https://organizationdatabase.com/api/v1/organization \ -H "Authorization: Bearer odb_…"
GET/api/v1/organizationscope: readThe organization the token belongs to: name, address, time zone, currency, perspectives and scenarios.
GET/api/v1/perspectives/{key}/tree?asOf=&scenario=scope: readThe organization through one perspective as a tree, on a date or in a scenario.
GET/api/v1/nodes?type=&q=&asOf=&scenario=scope: readNodes of one type, or matching a search, in the usual order.
GET/api/v1/nodes/{id}?asOf=&scenario=scope: readOne node with the relations that leave it and arrive at it.
GET/api/v1/violations?asOf=&scenario=scope: readWhat the organization's rules report.
GET/api/v1/changes?since=&scenario=scope: readThe change log in order after a seq, 500 at a time, with the seq of the next page.
POST/api/v1/changesscope: writeRecords a batch of change operations on one effective date, into the organization or a draft scenario: all or none, with the code of the invariant that refused it.
GET/api/v1/scenariosscope: readThe organization's scenarios and their status.
POST/api/v1/scenariosscope: writeStarts a draft scenario; record changes into it with POST /api/v1/changes and its id. Review, approval and applying stay with people on the screens.
GET/api/v1/scenarios/{id}/diff?asOf=scope: readWhat a scenario changes against the organization: nodes and relations added, removed and changed, and the difference in positions, FTE and cost.
Errors are JSON: { error: { code, message } }. 401 without a valid token, 403 without the scope, 402 beyond the plan, 422 when an invariant refuses a change. Changes made through the API are recorded with origin api.
Apps for many organizations (OAuth)
A product used by many organizations asks each one's owner or an admin to allow it, instead of asking for a token. Organization DB speaks OAuth 2.0 with the authorization code and PKCE.
- Register the app on your account's page, under Apps: its redirect addresses and what it may ask for. A server app gets a client secret, shown once.
- Send the person to /oauth/authorize with response_type=code, your client_id, one of your redirect addresses, the scopes, a state, and an S256 code challenge. They choose an organization they manage and allow the app.
- On your redirect address, check the state and exchange the code (valid ten minutes, once) and its code verifier at POST /oauth/token.
- Call the organization API with the access token as Authorization: Bearer. It lasts one hour.
- Before it ends, exchange the refresh token (grant_type=refresh_token) for a new pair. Each refresh token works once: one used twice ends the app's access to that organization.
GET https://organizationdatabase.com/oauth/authorize ?response_type=code&client_id=odb_ci_… &redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback &scope=read%20people%3Alookup&state=… &code_challenge=…&code_challenge_method=S256 curl https://organizationdatabase.com/oauth/token -u "odb_ci_…:odb_cs_…" -d grant_type=authorization_code -d code=odb_ac_… -d redirect_uri=https://app.example.com/callback -d code_verifier=…
- Scopes: read, write, sensitive and people:lookup. An app that asks only for people:lookup cannot read anything else.
- A server app sends its client secret in an Authorization: Basic header or as client_secret in the form, not both. A browser or mobile app sends only its client_id; a browser app may call the token endpoint from the site of one of its redirect addresses.
- Codes last ten minutes and work once; access tokens one hour; refresh tokens 30 days, replaced on every use.
- Errors come back as error and error_description: on your redirect address for a verified app's refused request, and from the token endpoint as JSON (invalid_request, invalid_client, invalid_grant, unsupported_grant_type). Too many calls answer 429 with Retry-After.
- A new app is unverified: together, an account's unverified apps reach at most five organizations, and none can allow them sensitive values. Ask for verification on your account's page.