Hi Tony!
Thanks for looking into this; your SDS Gateway lead was spot on. We’ve worked through the identifier issue on our side and can now see a clear change in behaviour. Summary below for your dev/ITOC.
What we were seeing
Application: FDSAPPLICATIONAUTHONLY
Application ID: cf907a72-9d48-4bcf-b3b3-bf6f48b97fee
Environment: Integration test (int.api.service.nhs.uk)
With application-restricted client-credentials auth, token acquisition succeeded (HTTP 200) but every e-RS call failed with HTTP 500 and REC_SERVER_ERROR OperationOutcomes (or empty body on STU3). This matched your observation that the SDS Gateway was erroring when searching for the UUID we had configured.
Steps we took (and what each proved)
1. Original app-restricted-user-id: 555249469106
This value came from our own live CIS2 INT logins — it is the Role Profile ID (URPID / person_roleid) for a “General Medical Practitioner @ D81045” role held by test user Mr SUPPORT THIRTYTHREE, captured during CIS2 role selection in our application (INT logs, 2–3 July 2026). So it is an INT identifier, but it belongs to a different test user than the one we are using now.
Probe result: identical 500 REC_SERVER_ERROR on all calls.
2. First change — swapped to 555398427107 (Joe Four)
We believed this was Joe Four’s INT identity from our triage audit table. Re-ran probes three times over ~7 minutes (18:06–18:13 UTC, 8 July).
Probe result: still 500 REC_SERVER_ERROR — no change.
Later finding: 555398427107 is not Joe Four’s D81045 identity. It is his Consultant @ E7R3G role profile from an earlier service-provider session — wrong org/role pairing for our app config (app-restricted-ods-code = D81045).
3. Second change — 555398419104 (Joe Four @ D81045 role URPID)
After Joe Four logged into INT today as Referring clinician @ ERS API GPP 39 (ODS D81045), we extracted his role list and set the hub to his D81045 Referring clinician Role Profile ID: 555398419104.
Probe result: still 500 REC_SERVER_ERROR.
This suggested the SDS lookup may not be keyed on role profile IDs (URPIDs) at all.
4. Final change — 555398387103 (Joe Four user-level UUID) ✓
From the same live CIS2 INT login (Joe Four, Referring clinician, D81045), we extracted his user-level UUID from the CIS2 token (uid / sub / nhsid_useruid): 555398387103.
We updated app-restricted-user-id to this value and re-ran the probe at 18:43 UTC, 8 July 2026.
Probe result — behaviour changed:
| Call |
Endpoint |
HTTP |
Outcome |
| A005 (control) |
GET /referrals/FHIR/STU3/ReferralRequest/9000000009 |
404 |
Request reached e-RS; unknown UBRN correctly not found |
| A033 |
GET /referrals/FHIR/R4/HealthcareService/6710419 |
403 |
REC_FORBIDDEN — “Endpoint not authorised for Business Function (PROVIDER_AUTHORISED_APPLICATION)” |
| A035 |
GET /referrals/FHIR/R4/HealthcareService?_id=6710419 |
403 |
Same as A033 |
Correlation IDs (18:43 UTC run):
- A005: X-Correlation-ID
d7d54eb0-e6c2-4867-83b9-4c4b5ab62c66 · X-Request-ID acc6fd5a-943d-4651-9fd1-dd6b9070fac7-1
- A033: X-Correlation-ID
1d1a15ce-996d-4e7b-9fa3-2d6bf5762e65 · X-Request-ID 7a04c429-e4cf-4dda-9474-05583eaa7ce2-1
- A035: X-Correlation-ID
c6154582-c10e-4a7b-ae83-71c290f4d623 · X-Request-ID 505250f3-e058-45ed-85da-7424758d1a35-1
We interpret this as: the SDS lookup issue is resolved (no more 500s). The remaining 403s look like a permissions / business-function step rather than SDS failure.
The URID / UUID distinction (likely root cause)
All values we initially supplied were CIS2 Role Profile IDs (URPIDs) from nhsid_nrbac_roles[].person_roleid — i.e. a role at an organisation, not the user themselves.
| Value |
Type |
Who / what |
555249469106 |
URPID |
SUPPORT THIRTYTHREE — GMP @ D81045 |
555398427107 |
URPID |
Joe Four — Consultant @ E7R3G (wrong org for our config) |
555398419104 |
URPID |
Joe Four — Referring clinician @ D81045 |
555398387103 |
User UUID |
Joe Four — user-level identity |
Only the user-level UUID (555398387103) cleared the SDS gateway error. Could you confirm that app-restricted-user-id must carry the user UUID (nhsid_useruid / uid), not a role profile ID? If so, it would help to document that clearly for application-restricted onboarding — we had assumed a URID from CIS2 login was the correct value.
Final hub configuration (current)
| Custom attribute |
Value |
Notes |
asid |
200000002295 |
Unchanged |
app-restricted-ods-code |
D81045 |
Matches Joe Four’s Referring clinician login (ERS API GPP 39) — we have not changed this |
app-restricted-user-id |
555398387103 |
Joe Four user-level UUID from live CIS2 INT login today |
Application ID: cf907a72-9d48-4bcf-b3b3-bf6f48b97fee — unchanged.
We are not planning to change ODS or Application ID unless you advise otherwise.
What we need from you / ITOC
- Confirm
app-restricted-user-id should be the user UUID, not a URPID.
- Associate Joe Four (user UUID
555398387103) with the test organisation for application-restricted access at D81045, so A033/A035 are authorised (or advise the correct business function for HealthcareService lookup under application-restricted auth — we currently see PROVIDER_AUTHORISED_APPLICATION rejected).
- Once association is done, we’ll re-probe and share fresh correlation IDs.
Sorry for the lengthy email but wanted to share the steps we had taken - even if many of them were in the wrong direction!
Thanks as always for your help
Iain