Demo All names and records here are made up, and the data resets every night. Please do not enter real personal information. ← Back to Find Care Scotland software · All software
Care Core

Documentation › API › API recipes

API recipes

Worked examples: syncing staff, starting and ending employment, compliance, teams, care.

Worked examples for the integrations people build most. Each uses only the calls in the reference.

Keep a rota or payroll system in step with your staff

Scopes: people.read, staff.read (and events.read if you want to react to changes). Without care.read the key can never see people who only receive support.

  1. First load: page through GET /employments?status=current (and status=upcoming for people who start soon). Each employment has the person’s id, employee_ref, job title, contract, hours, line manager, start and end dates. Fetch names and emails with GET /people?kind=staff.
  2. Stay in step: either
    • poll GET /events?types=employment.*&after=LAST_CURSOR every minute and apply each event in order (employment.started, employment.changed, employment.ended), saving the last cursor you processed; or
    • create a webhook for the same events and let Care Core call you.
    Events say what changed and for whom; fetch the employment or person for the details.
  3. Safety net: once a night, reconcile with GET /people?updated_since=YESTERDAY and a fresh list of current employments. Events can be missed if your receiver was down; this catches them.
  4. Leavers: an employment.ended event carries the last day (end_date). Disable the person in your system after that day. Care Core ends their access the same way.

Start someone from a recruitment system

Scopes: staff.write (plus teams.write only if you add team places separately).

POST /employments
Idempotency-Key: candidate-4821
{ "first_name": "Ada", "last_name": "Lovelace", "email": "ada@example.org",
  "job_title": "Support Worker", "start_date": "2026-12-01", "hours_per_week": 37.5,
  "employee_ref": "E4821", "team_id": "…", "line_manager_id": "…" }
  • This is the joiner process: the person, the employment, the team place, and the new starter checklist, all at once. The response includes tasks_created.
  • The idempotency key means a retry after a timeout cannot start the same person twice. (An existing email is refused anyway.)
  • A returner: pass person_id instead of the name fields. The response says rehire: true.
  • Then add what you know: PATCH /people/{id}/profile (address, emergency contact; National Insurance and bank need staff.sensitive), POST /people/{id}/registrations, PATCH /employments/{id}/details/wtd.
  • No login is created. Access is arranged by an administrator or by Entra provisioning.

End someone’s employment from HR

GET  /employments/{id}/leave-preview?last_day=2026-12-18      (changes nothing)
POST /employments/{id}/end   { "last_day": "2026-12-18", "reason": "Resigned" }

The preview says how many team places will end, how many people lose this key worker or line manager, how many logins will stop and how many offboarding tasks will be created. The end call does it all in one transaction and returns the same counts. The API cannot half-end someone.

A compliance dashboard

Scopes: compliance.read, people.read.

  • GET /compliance/due?days=60 returns everything overdue or due in the next 60 days for current staff, with the person’s id, what it is, and the date. Look the people up with GET /people/{id}.
  • For one person: GET /people/{id}/registrations, /supervisions, /appraisals, /learning.
  • Training from a learning system: POST /people/{id}/learning with title, record_type, completion_date, expiry_date, status and is_mandatory. Use the learning system’s record id as the Idempotency-Key.

Who is in this team, now or on any date?

GET /teams                               the structure
GET /teams/{id}/members                  today
GET /teams/{id}/members?on=2026-03-14    on a past date

Each place has a role, primary, start_date and end_date. GET /people/{id}/teams gives one person’s whole history. To move someone, use the mover endpoint (POST /employments/{id}/changes with team_id), which ends the old primary team the day before and starts the new one, rather than editing places by hand.

A care system that needs key workers and teams

Scopes: care.read, teams.read (and care.write to change).

  • GET /people?kind=supported: everyone currently receiving support.
  • GET /people/{id}/key-workers: current key workers first. Called on a member of staff it lists the people they are key worker for.
  • POST /key-workers to assign (the rules about current staff and people currently supported apply). When a key worker leaves, Care Core ends their links and creates a task for each person; read those with GET /tasks?kind=reassign.
  • Listen for keyworker.started and keyworker.ended events.

Close the loop on tasks

Another system (a service desk, a rota) may do the work a task describes. GET /tasks?status=open&kind=leaver lists what is waiting; PATCH /tasks/{id} with {"status":"done"} marks it complete and raises task.completed.

Audit what an integration did

Everything a key does is attributed to it. Read it back with GET /audit?action=employment (or filter by subject_id); entries show the actor system:api:KEYNAME. Sensitive values are never in the log.

Manage webhooks as part of your own deployment

POST /webhooks { "url": "https://hooks.example.org/care", "event_types": ["employment.*", "team_assignment.*"] }
→ { "data": { "id": "…", "secret": "d4f6…" } }      (the secret is shown once)
GET  /webhooks/{id}/deliveries?status=failed             see what is not getting through

See Events and webhooks for how to verify the signature.

Feed events or poll?

ComparedWebhooksEvent feed (GET /events)
LatencyAbout a minuteAs often as you poll
Needs a public addressYes (https)No: you call us
If you are downRetried for about 15 hours, then given upNothing is lost: resume from your last cursor
Best forReacting quicklySystems behind a firewall; guaranteed catch-up

Many integrations use both: webhooks for speed and the feed to catch up.