Skip to content

Getting started

From a developer account to your first API call against the sandbox, in five steps.

Before you start

  • An organisation on the network. Developer accounts belong to an organisation (a facility, an organisation or an NGO, or a software vendor working for one). If yours is not a member yet, it applies through the join application.
  • A developer account. Your organisation’s administrator creates it and enrols your authenticator app. You sign in at /login with your username and a six-digit code.
  • Synthetic data only. The sandbox holds fictional data. Never send real personal data to it.

1. Register an application

In the developer workspace, open My applications and register your application: its name, redirect URIs (for browser sign-in), the scopes it needs and the environment (sandbox). The request goes to OHN-33 (POST /api/ohn/v1/developer/apps).

2. Get sandbox credentials

For a sandbox application, ask for sandbox credentials. You receive a client_id (a UUID), a client_secret and a device_attestation value. The secret is shown once: store it, and the device attestation, in your secret manager. The answer also names the token and introspection endpoints.

3. Get a token

export OHN=https://your-sandbox.example        # the deployment you were given
curl -s -X POST "$OHN/api/ohn/v1/oauth/token" \
  -H 'content-type: application/json' \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"grant_type":"client_credentials","client_id":"<client_id>","client_secret":"<client_secret>","scope":"<scopes>"}'

The answer is { "access_token", "token_type": "Bearer", "expires_in": 3600, "scope", "session_id" }. Every failure is 401 invalid_client, so a wrong secret and an unknown client look the same. See Authentication.

4. Call an API

Send the token as Authorization: Bearer <token> when you call an API. Every write (POST, PUT, PATCH, DELETE) must carry an Idempotency-Key header: retry with the same key and the network returns the original answer instead of doing the work twice.

# Check the token. Sandbox sessions are bound to your device attestation (from step 2):
# without the X-Device-Attestation header, introspection answers 403 device_binding_mismatch.
curl -s "$OHN/api/ohn/v1/sessions/introspect" -X POST \
  -H 'content-type: application/json' \
  -H "X-Device-Attestation: $DEVICE_ATTESTATION" \
  -d "{\"token\":\"$TOKEN\"}"

The answer is { "active": true, "session_id", "principal_id", "expires_at" }.

Errors use application/problem+json (RFC 9457) with type, title, status, detail, a stable error code and a trace_id to quote when you contact support.

5. Pass conformance

Before production access, run the conformance suites (OHN-46) for the flows you use, from the developer workspace. Production access also depends on your organisation’s membership and data-sharing terms.

Next