Skip to main content

Authentication

Every VitaRelay API request is authenticated with an API key passed as a bearer token in the Authorization header. Keys are issued to your organization by a VitaRelay administrator and shared with you directly — there is no OAuth flow, no token exchange, and no self-serve key creation. The key you receive is the credential you send.
Requests without a valid key are rejected before any work is done.

Live and test keys

Each key belongs to exactly one environment, encoded in its prefix: Both use the same base URLhttps://vitarelay.com/api/public/v1. There is no separate sandbox host. See Sandbox for how test keys behave, and API Keys for how keys are issued.

Scopes

A key only grants the scopes VitaRelay selected when it was issued. A request whose endpoint requires a scope the key does not carry is rejected with 403 insufficient_scope.
Follow the principle of least privilege. Ask VitaRelay for a separate key per integration, carrying only the scopes that integration needs, so one key can be revoked without affecting anything else.

Write endpoints require a Vita Clinic

The three write endpoints have an additional requirement beyond scope: the organization that owns the key must be an active Vita Clinic. A key held by any other organization type is rejected with 403 not_vita_clinic, even if the :write scope is present.

Keeping keys secure

  • Never commit API keys to source control. Use environment variables.
  • One key per integration, so one can be revoked without downtime elsewhere.
  • Ask VitaRelay to rotate periodically, and immediately after any suspected compromise — rotation and revocation are requests to VitaRelay, not self-serve actions. See API Keys.
  • Develop against vr_test_ keys so mistakes never touch production data.

Error responses

Authentication and authorization failures use the standard error envelope.
See Errors for the full code table.