Skip to content

Make your first request

Confirm a Test API key and read the Affinity account.

Updated View as Markdown

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

Navigation

Type to search…

↑↓ navigate↵ selectEsc close