Authentication
Every call to the Partner API carries an OAuth2 client-credentials access token issued by Auth0 for your organisation, sent as Authorization: Bearer <token>. There are no API keys, no key prefixes and no per-endpoint secrets: one credential pair, exchanged for a bearer token, on every request.
Where the API lives
| Environment | Base URL |
|---|---|
| Production | https://agentic-ps.playspace.health |
| Development | https://agentic-ps-dev.playspace.health |
Every path sits under /v1/partner, so the patient list in production is https://agentic-ps.playspace.health/v1/partner/patients.
There is no sandbox environment. The development host is a real deployment with its own data rather than a synthetic one, and a credential is bound to the environment it was issued for: a development credential is not accepted by production and the reverse is also true. Apply separately on each host you intend to use, and apply on development before you build.
What PlaySpace hands you
You apply at /partner-register on the host you want a credential for. PlaySpace reviews the application, and on approval provisions a machine-to-machine application for your organisation and emails you a one-time link to the credential. The whole path, step by step, is get your credentials.
The credential page shows four values, once:
- a client identifier
- a client secret, shown once and not recoverable through the product afterwards
- the audience the token is bound to,
https://playspace-ehr-api - the base URL of the PlaySpace host the credential is for
It does not show the token endpoint. Each environment has its own, and both are listed in step 5 of get your credentials; the development one is what the interactive reference on this site declares. Every example on this page uses the development endpoint, so swap the host when you move to production.
Store the secret in your secret manager before you leave the page. The link opens once and expires 72 hours after approval. If it expired before you retrieved the credential, reply to the approval email: PlaySpace can reveal the same secret again while that window is still open, and can rotate it for a fresh one afterwards. Rotation invalidates the previous secret at the authorisation server, so plan a short cutover rather than assuming two secrets can be live at once.
Getting an access token
curl --request POST \
--url "https://dev-hcp1velit44csg3n.us.auth0.com/oauth/token" \
--header 'content-type: application/json' \
--data '{
"client_id": "<client id>",
"client_secret": "<client secret>",
"audience": "https://playspace-ehr-api",
"grant_type": "client_credentials"
}'
The response is a standard OAuth2 token response; take access_token and present it on every request.
GET /v1/partner/patients HTTP/1.1
Host: agentic-ps-dev.playspace.health
Authorization: Bearer eyJhbGciOiJSUzI1NiIs…
An access token lives 24 hours. Cache and reuse one until it is close to expiry rather than minting per request.
Check the credential before you build against it. GET /v1/partner/health needs no scopes and answers 200 with your organisation identifier and a server timestamp whenever the token is accepted, so it separates "my credential is wrong" from "my request is wrong" in one call.
Trying a call before you write code
The interactive reference on this site renders the specification faithfully, but it sends no requests and offers no field to paste a credential into. That is deliberate, and for three independent reasons:
- A browser would refuse the call anyway. This documentation site and the API are different origins, and the Partner API sends no cross-origin resource sharing headers. A request issued from a page on this domain is blocked by your browser before it ever reaches PlaySpace. That rule is enforced by browsers, on browsers — it has no bearing on a call your backend makes, which is why a server integration is completely unaffected by it.
- Neither credential belongs in a browser. A client-credentials access token carries your organisation's whole grant and lives for hours, and the client secret that mints it is password-equivalent. Typing either into a page on a public documentation domain is the wrong habit to build, and this site declines to teach it.
- This host serves no Partner API and never forwards your credential. Making the console send requests would mean forwarding your credential either through this domain or through a third party's. A documentation site should do neither.
So the reference here is for reading. There are three ways to make a call that actually runs.
1. curl
Take the token from getting an access token above and probe the health endpoint. It needs no scopes, so it separates "my credential is wrong" from "my request is wrong":
curl -i "https://agentic-ps-dev.playspace.health/v1/partner/health" \
--header "authorization: Bearer <access token>"
2. The hosted console, on the API host itself
The same reference is served by the API's own deployment, where the page and the endpoints share an origin — so its console does issue real requests.
| Console | |
|---|---|
| Development | https://agentic-ps-dev.playspace.health/docs |
| Production | https://agentic-ps.playspace.health/docs |
The practitioner surface has its own console alongside it, at /docs/practitioner on the same hosts.
Use the development console unless you mean to touch real clinical data — a credential is bound to its environment, so a development credential simply will not authenticate against the production one.
Mint the token in a terminal and paste it in — do not try to authorize from the panel. The authentication panel offers a Bearer Token field for exactly this, and that is the field to use. It also documents the OAuth2 client-credentials exchange, but the console cannot perform it: Auth0 returns no cross-origin resource sharing headers on its token endpoint for a client-secret grant, deliberately, because a client secret must never live in a browser. Pressing Authorize produces a blocked request whose failure surfaces as a bare console error, and it looks exactly like an authentication problem with your credential when it is nothing of the kind.
So the loop is:
- Get a token from getting an access token. The same organisation token works for every operation on the page.
- Paste it into the Bearer Token field once. It applies to every operation on the page.
- Open an operation, press Test Request, fill in any path or query parameters, then Send Request.
Do not add scopes in the panel. Your grant is fixed on the credential and travels inside the token; requesting one you do not hold fails the exchange with 403 access_denied before the API is reached at all.
3. Your own client
Import openapi.json or openapi.yaml into Postman, Insomnia, Bruno or an equivalent. Those are applications rather than web pages, so the cross-origin rule above does not apply to them either, and you get request history and environment switching for free.
Trying the frame
None of the above puts PlaySpace in a browser. That takes a sign-in code minted by your backend and a page on one of your frame_origins, which the quickstart sets up end to end. This documentation site frames nothing.
Scopes
Your granted scopes are fixed on the credential at approval and are carried inside the token; you never send them. The vocabulary is one scope per resource and verb, plus one for signing clinicians in.
| Resource | Read | Write | Delete |
|---|---|---|---|
| Clinics | clinics:read |
clinics:write |
clinics:delete |
| Practitioners | practitioners:read |
practitioners:write |
practitioners:delete |
| Patients | patients:read |
patients:write |
patients:delete |
| Appointments | appointments:read |
appointments:write |
appointments:delete |
| Sign-in codes | sessions:write |
Nothing outside this table is a scope. Your organisation's settings are read with practitioners:read and changed with practitioners:write. Every access level on the application form above Read-only includes sessions:write, because embedding PlaySpace means signing clinicians in. Each operation in the reference names the exact scope it requires.
appointments:delete exists in the vocabulary but no endpoint consumes it — cancelling an appointment is PATCH /v1/partner/appointments/{id} with status: "cancelled", which needs appointments:write.
A call outside your granted scopes returns 403 with problem type forbidden, carrying both required_scopes and granted_scopes in full, so the diagnosis is in the response rather than in a support conversation. To change what you hold, ask PlaySpace; scopes are edited on the credential rather than requested per call.
One token, the whole organisation
Every call uses the same organisation token. It sees every clinic, practitioner, patient and appointment your organisation owns, and nothing of any other organisation's. There is no per-clinician token: acting as one clinician is what a sign-in code does, inside the frame.
Request the token with the four fields shown in getting an access token and nothing else. A token request that adds a practitioner_id yields a token that names that practitioner, and every call made with it is refused with 403 and problem type delegation-not-enabled.
Suspending one clinician's access
Set a practitioner's status to disabled with PATCH /v1/partner/practitioners/{id}. Their open session in the frame ends the next time the dashboard checks who is signed in, and a sign-in code for them is refused with 409 practitioner-unavailable until you set status back to active. Disabling is reversible and keeps every record, which makes it the right tool for suspending access; DELETE is for off-boarding.
What a browser may hold
Your client credentials and your access token never reach a browser. Both carry your organisation's whole grant, and anything in a page can be read by script, logged, cached or leaked through browser history. Two narrower credentials exist for the browser, and your server requests both.
Sign-in codes
POST /v1/partner/practitioners/{id}/sign-in-codes, with sessions:write, mints a code that signs that one practitioner in to PlaySpace inside your frame.
curl --request POST \
--url "https://agentic-ps-dev.playspace.health/v1/partner/practitioners/<practitioner id>/sign-in-codes" \
--header "authorization: Bearer <access token>" \
--header 'content-type: application/json' \
--data '{ "path": "/dashboard/clients" }'
{
"data": {
"code": "<single-use code>",
"start_url": "https://agentic-ps-dev.playspace.health/frame/start?token=<single-use code>",
"expires_at": "2026-10-22T15:31:00.000Z"
}
}
A code is deliberately weak as a credential:
- It works once, and stops working 60 seconds after it was minted.
- It names one practitioner, resolved on your organisation's records, so it cannot sign in anyone else.
- It opens only inside your origins. It carries your organisation's
frame_origins, which become theframe-ancestorspolicy of every page in the session, and/frame/startaccepts it only as a frame's first address. - It goes to one place: the frame's first address, or one message addressed to the PlaySpace origin.
@playspace-health/embedputs it there.
It takes no Idempotency-Key: every call mints a new code. It is refused with 409 frame-origins-not-set until your organisation has at least one frame origin, and with 409 practitioner-unavailable for a practitioner who is disabled or cannot sign in yet. What happens in the frame afterwards is Frame the PlaySpace dashboard.
Patient links
POST /v1/partner/appointments/{id}/session-links, with appointments:read and an Idempotency-Key, returns patient_url, the link a patient joins that appointment's session with, and its expires_at. The link is a short https://<host>/join/<code> address, and the code in it is the credential: deliver it to the patient over a secure channel, keep it out of your logs, and keep it out of email click tracking. There is no clinician link: the clinician starts the session inside your frame. See hand the patient their link.
Restricting where a credential may be used
An address allowlist can be attached to your organisation, so a leaked secret is useless off your network. Both IPv4 and IPv6 ranges are supported. It is configured by PlaySpace rather than self-serve — send us the ranges your backend calls from.
What to do when something is refused
| Status | Type | Cause | Fix |
|---|---|---|---|
| 401 | unauthorized |
Missing, malformed or expired token, or a revoked organisation | Re-fetch the token. Check you sent the literal Bearer prefix |
| 403 | forbidden |
Scope not granted | Compare the two lists in the problem document |
| 403 | partner-suspended |
Organisation suspended | Contact PlaySpace; this is never a code problem |
| 403 | delegation-not-enabled |
The token names a practitioner | Request the token without practitioner_id |
| 404 | not-found |
Absent, deleted, or another organisation's | Deliberately indistinguishable — check the identifier |
| 422 | validation-error |
Well-formed but not acceptable | The problem document names the fields |
| 429 | rate-limited |
Too many requests | Honour Retry-After |
Every response, success or failure, carries an X-Request-Id header. Log it. Quoting one to PlaySpace addresses a single request in our audit history and turns a day of diagnosis into a few minutes.
Full catalogue: the error reference. Everything true of every endpoint: conventions.