Skip to main content

Anamnesis (v4)

The v4 Anamnesis API lets you fetch a questionnaire model, render it on your own surface, and submit the patient’s answers back to RxScale. Every submission is validated against the questionnaire model before it is stored, so an invalid payload never creates a record.
This is the v4 Anamnesis API. The legacy /api/v3-1/anamnesis endpoints are still available — see Anamnesis for that reference.

Base Path

Authentication

The read endpoints (questionnaire model, public files) and the standard POST /submissions endpoint are public and require no API key. They are intended to be called directly from storefronts and other client surfaces that render RxScale questionnaires. The external submission endpoint (POST /external/submissions) is authenticated and requires an API key passed in the X-API-Key header, with the anamnesis:external_submit permission. You may only submit on behalf of an external anamnesis provider that belongs to your organisation — the provider_identifier you pass is resolved to a provider owned by the API key’s organisation.
For the public endpoints, because no credentials are sent, only non-sensitive read operations (questionnaire model, public files) and write operations that are validated against the questionnaire model are exposed. Submitted answers are transmitted over HTTPS, and an encrypted copy of each submission is retained at rest.

Endpoint Summary

Get Questionnaire

Fetch the questionnaire model and the metadata you need to render it. This endpoint is public and requires no API key.
string
required
The UID of the questionnaire

Example Request

Response

error
Returned when no questionnaire exists for the given questionnaire_id.

Download Questionnaire File

Download a file referenced by the questionnaire (for example an image or an information PDF). The file is returned as an attachment with its original filename. This endpoint is public and requires no API key.
string
required
The UID of the questionnaire
string
required
The name of the file to download

Example Request

The response is the raw file bytes, served as an attachment (Content-Disposition: attachment; filename="info.pdf").
error
Returned when the questionnaire or the requested file does not exist.

Submit Anamnesis

Submit the patient’s answers for a questionnaire. This endpoint is public and requires no API key. The data payload is validated against the questionnaire model before anything is stored. On success the submission is persisted (with an encrypted copy of the answers retained at rest) and its UID is returned.
string
required
The UID of the questionnaire being answered

Request Body

Example Request

Response

The endpoint responds with 201 Created on success.

Submit External Anamnesis

Submit a questionnaire response on behalf of an external anamnesis provider. The data payload is validated against the questionnaire model in exactly the same way as a regular submission. This endpoint is authenticated: send your API key in the X-API-Key header. The key must have the anamnesis:external_submit permission. Instead of a provider UID, you pass a provider_identifier, which is resolved to an external anamnesis provider owned by the API key’s organisation — you may only submit for a provider that belongs to your organisation.
string
required
The UID of the questionnaire being answered

Request Body

Example Request

Response

The endpoint responds with 201 Created on success.

Submission Validation

Both submission endpoints validate the data payload against the questionnaire model before writing anything to the database. If validation fails, the request is rejected with 400 Bad Request and no record is created. The error body contains the list of validation problems reported against the questionnaire model:
If the request body itself is malformed — for example a missing required field such as data or provider_identifier — the 400 response instead reports the offending field:
If the submission validator is temporarily unreachable, the request fails with 502 Bad Gateway and no record is created. This is a transient upstream failure, not a problem with your payload — retry the request:
Always fetch the latest questionnaire model with Get Questionnaire and render your form from it. Submitting answers that do not match the current model will fail validation and the submission will not be stored.

Error Responses

Typical Integration Flow

1

Fetch the questionnaire model

Call GET /questionnaires/{questionnaire_id} to retrieve the model and theme.
2

Render the questionnaire

Render the model with the SurveyJS renderer (or use the RxScale snippet, which does this for you).
3

Submit the answers

Post the collected data to /submissions (public), or to /external/submissions with your X-API-Key for external providers. RxScale validates the answers against the model.
4

Store the returned UID

Persist the returned uid and use it to link the submission to a Shopify order. See the Questionnaire Integration guide.