Skip to content

Getting started with the Scrivio API ​

An API-koppeling (API integration) lets a practice give another system (its own application, or a supplier's software) read access to its data in Scrivio and a limited set of writes. This page is for the developer building one. The operations, with their parameters and responses, are in the API reference. For a code generator the reference is also available as an OpenAPI document: /openapi.json or /openapi.yaml.

In preparation

The API is being built. The API-koppelingen screen and the token server on auth.scrivio.nl are not yet available to practices. This page describes how it works once they are. If you want to think along or build early, write to support@scrivio.nl.

How an integration works ​

  • The practice creates the integration, not Scrivio and not the supplier. It does so under Organisatie → Integraties → API-koppelingen, as someone holding the integrations.manage permission.
  • The practice chooses its roles. An integration may do exactly what those roles allow, and never more than the person creating it may do themselves. Everything it does is recorded in the practice's audit log under the integration's name.
  • An integration calls the public API only. Every other operation refuses it with 403, whatever its roles allow.
  • The secret is shown once. On creation the practice receives a client id and a client secret. Scrivio does not store the secret and cannot show it again.
  • A secret expires after at most twelve months. When it is rotated, the old secret stays valid for 24 hours so you can replace it without interruption. Revoking stops the integration within five minutes: the lifetime of a token. Only someone who may do at least what the integration may do can rotate its secret.
  • The practice makes the arrangements with the supplier. Whoever is behind an integration receives data on the practice's instruction. The practice makes its own agreement with that party, including a data processing agreement where one is required, and updates its own DPIA where needed. Scrivio is not a party to it (Overeenkomst article 5.8 and Bijlage A article 2.7, edition 2026-12).

Requesting a token ​

Scrivio uses OAuth 2.0 with the client_credentials grant. Request a token from Scrivio's token server:

sh
curl -s https://auth.scrivio.nl/realms/scrivio/protocol/openid-connect/token \
  -d grant_type=client_credentials \
  -d client_id="$SCRIVIO_CLIENT_ID" \
  -d client_secret="$SCRIVIO_CLIENT_SECRET"

The response holds an access_token and expires_in (seconds). A token is valid for five minutes and there is no refresh token: when it expires, request a new one with the same secret. Keep the secret as you would a password, and never in a browser or a mobile app.

Calling the API ​

Send the token as a bearer token to https://api.scrivio.nl:

sh
curl -s https://api.scrivio.nl/api/v1/clients?size=20 \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Accept-Language: en"

An integration belongs to one organisation, so you never choose one: every response is about the practice that created the integration.

Pagination ​

Lists come back a page at a time. You send:

ParameterMeaning
pagePage number, from 0
sizeItems per page, 1 to 100, default 20
sortfield,direction, for example lastName,asc. The reference lists the fields each operation accepts

The response carries the items in content, plus page, size, totalElements and totalPages to page on. Request pages until page equals totalPages - 1.

Searching for a cliënt ​

GET /api/v1/clients?search=… is the same search as the cliënt search field in Scrivio itself. It matches name, e-mail address, BSN, address, external reference and patiëntnummer, case-insensitively, and a date of birth written as yyyy-mm-dd or dd-mm-yyyy. The exact rules are on listClients.

Filling in forms ​

An integration can prepare a form for a cliënt: create a submission with createFormSubmission and fill in its answers with saveFormSubmissionAnswers. Such a submission is always a draft. Only a behandelaar marks it reviewed, in Scrivio; the API cannot.

A document you upload is scanned for malware first, as in the app. When that scan cannot be done for the moment, Scrivio refuses the document with 503; try again later.

Errors ​

An error comes back as Problem Details (RFC 7807), with media type application/problem+json:

json
{
  "type": "https://api.scrivio.nl/problems/integration-rate-limited",
  "code": "integration-rate-limited",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "This API integration has made too many requests. …"
}

Program against status, and against code where there is one; title and detail are written for people and may change. They follow Accept-Language (nl or en). On invalid input, errors says per field what is wrong.

StatuscodeWhat is going on
401integration-token-refusedThe token is expired or invalid, or the integration has been revoked or has expired. Request a new token; if that fails, contact the practice
403operation-not-publicThe operation is not part of the public API
403The integration's roles do not allow this
429integration-rate-limitedToo many requests, see below

Limits ​

Each integration may make 600 requests per minute, measured over the last minute. Every response tells you where you stand:

HeaderMeaning
X-RateLimit-LimitRequests allowed per minute
X-RateLimit-RemainingHow many are left right now
X-RateLimit-ResetSeconds until another request becomes available

Go over it and you receive 429 with a Retry-After header in seconds. Wait that long before trying again.

Changes to the API ​

What the reference documents does not change in a way that breaks your integration. A check in Scrivio's own build pipeline stops every change that would. A new shape is added beside the old one. If something must go, it is first marked Deprecated in the reference, with the date after which it is removed, at least 180 days after the announcement. New operations and new optional fields can always appear: ignore fields you do not know.

Trying it out ​

There is no separate test environment. When a practice wants to try an integration first, it signs up for a second organisation and asks support@scrivio.nl to mark it as a test organisation. A test organisation runs in production and is not invoiced. It holds only invented cliënten, never real cliënt data.

Scrivio Documentatie