This procedure uses a Test API key on a trusted server. Sign up at Affinity for Platforms to start in Test mode immediately. Affinity approval is required only when your platform is ready for Live access.
Before you start
You need:
- Bun, Node.js, or another HTTP client
- a Test API key from the Affinity platform dashboard
- access to the practice that you will use for development
Send the request
Store the key
Set AFFINITY_API_KEY in your server environment. Do not pass the key as a command argument.
Read the account
Send this request from the trusted server.
curl --request GET \
--url https://api.affinityrx.com/v1/account \
--header "Authorization: Bearer $AFFINITY_API_KEY" \
--header "Affinity-Version: 2026-09-28"Check the mode
Confirm that the response reports Test mode before you send synthetic patient data.
The API returns the account that owns the API key. It also returns the mode and access available to that key.
Next steps
- Read Authentication before you add the key to an application.
- Read Build a headless integration before you build a prescribing workflow.
- Read Manage practice Live access when your platform is approved for Live mode.
- Open the API reference to inspect the current response schema.