Security and authorisation
Learn how we handle security and authorisation for our APIs.
Overview
Many of our APIs give access to sensitive or personal data. This page explains the various techniques or 'patterns' we use to keep them secure.
Security concepts
Systems and users
There are three parties involved in API security:
-
the API itself - more accurately, the system exposing the API
-
the calling application - the system consuming the API
-
the end user - a healthcare worker or a patient, or possibly not present
Assurance
For some of our APIs, we rely on the calling application to handle user authentication and authorisation.
You must do this before we'll allow you to go live. This is part of our onboarding process. We might also ask you to conduct penetration testing to prove your application is secure.
For some of our APIs, we use modern standards to reduce your assurance burden. For example, we use OAuth 2.0 to allow the end user to authenticate directly with us.
Role-based access control (RBAC)
Some of our APIs require you to use role-based access control (RBAC) for user authorisation. RBAC consists of:
-
roles, such as doctor or nurse
-
activities, such as read or update patient demographic details
-
permissions, linking roles to activities
In some cases, we allow you to use your own RBAC system. In other cases, we require you to implement National RBAC - a specific set of roles, activities and permissions defined by us.
For more details, see National RBAC for developers.
Keep your software secure
As a software developer, you will undertake many design activities that build security in each layer of your application. When you connect to NHS England APIs you have a responsibility to:
- keep credentials, keys and secrets secure
- understand the importance of tokens
- rotate your keys and credentials regularly
For more details, see Keep your software secure.
Security patterns
Each API uses a security ‘pattern’ appropriate to its needs. The patterns group into three categories:
-
open-access APIs
-
application-restricted APIs
-
user-restricted APIs
The following sections describe the patterns in more detail.
You can find out which security pattern applies to a particular API in the API and integration catalogue.
Open-access APIs
Some of our APIs are open-access, which means:
- we do not authenticate or authorise the calling application
- we do not authenticate or authorise the end user - they might not even be present
Here's an illustration:
We generally use open-access APIs for public data, where security is not a concern.
Our open-access APIs are generally RESTful APIs. For more details on how to access them, see our open-access REST API tutorial.
Application-restricted APIs
Some of our APIs are application-restricted, which means:
- we authenticate and authorise the calling application
- we do not authenticate or authorise the end user
Although we do not authenticate or authorise the end user, for some APIs we do require the calling application to do it 'locally'. For other APIs we do not require the end user to be authenticated or authorised, or even to be present.
Here's an illustration:
We support the following security patterns for application-restricted APIs:
User-restricted APIs
Some of our APIs are user-restricted, which means:
- we authenticate and authorise the calling application
- we authenticate, but do not authorise, the end user
Although we do not authorise the end user, we do generally require the calling application to do it ‘locally’.
Here's an illustration:
Two types of users can access the user-restricted APIs:
- healthcare workers - authenticated using Care Identity Service (CIS)
- patients - authenticated using NHS login
Healthcare worker access mode
If the end user is a healthcare worker, we support the following user-restricted security patterns:
Some of our APIs need healthcare workers to be authorised by using the national role-based access control (RBAC).
Patient access mode
If the end user is a patient, we support the following user-restricted security patterns:
Last edited: 28 May 2025 12:48 pm