The import format
The JSON file that describes what to import.
An import file is one JSON document. Anything that can write JSON (a script, a spreadsheet export, another system’s API) can produce one. Dates are YYYY-MM-DD (a trailing time is ignored). Unknown fields are ignored, so a file can carry extra information safely.
The shape
{
"format": "carecore-import",
"version": 1,
"source": "Where this came from (shown in the history)",
"teams": [ … ],
"people": [ … ],
"team_places": [ … ],
"key_workers": [ … ]
}
All four lists are optional. Several files can be imported together: people with the same ref in different files are combined.
Refs
Every record should have a ref: a stable identifier from the source system, unique within its kind, such as staff:123 or team:7. Refs do three jobs:
- Link records, even across files: a team place says which
team_refandperson_refit connects. - Make re-runs safe: a record whose ref was imported before is skipped.
- Report problems: warnings and errors name the ref, so you can find the source record.
A ref without a record behind it is simply not found: the link is dropped with a warning. A person can have extra "aliases": ["people:5"] if the same human is known by more than one ref.
teams[]
| Field | Notes |
|---|---|
ref | Required for linking. |
name | Required. |
parent_ref | The team above it. Parents may appear after children. |
kind | For example care, hr. Default care. |
staff_only | true or false. |
active | false closes the team after its history is imported. |
A team with the same name and parent that already exists is matched, not duplicated.
people[]
| Field | Notes |
|---|---|
ref, aliases | See above. |
first_name, last_name | Required. A person without both is an error. |
preferred_name, date_of_birth, email, phone, notes, sex, nhs_number, employment_status, gp_practice, address_line1, address_line2, town, area, postcode | Optional. The structured details only ever fill blanks on someone already in Care Core. An invalid email, phone or date is dropped with a warning. |
profile | An object: address_line1, address_line2, address_city, address_county, address_postcode, address_country, emergency_contact_name, emergency_contact_phone, ni_number, bank_sort_code, bank_account_number, bank_account_name. Each value is checked; a bad one is dropped with a warning. See the field reference. |
photo_file, signature_file, signature_method | A path inside the folder given as --files-from (command line only). signature_method is draw or upload. |
employments[] | See below. |
support[] | Support episodes, below. |
needs[], contacts[] | Below. |
registrations[], supervisions[], appraisals[], learning[] | Below. |
employments[]
| Field | Notes |
|---|---|
ref | Recommended. |
job_title | Missing → “Employee”, with a warning. |
start_date | Required. Without a usable one the employment is skipped. |
end_date | The last day. Before the start → dropped with a warning. |
contract_type, hours_per_week | Hours must be above 0 and no more than 168, otherwise dropped with a warning. |
employee_ref | Must be unique in the organisation; a duplicate is dropped with a warning. |
leaving_reason | Free text. |
line_manager_ref | The manager’s person ref. Resolved after everyone is in, so order does not matter. |
details | An object with sections terms, tupe, wtd, apprentice, visa, leave, each with the fields listed in the field reference. A section with a bad value is left out entirely, with a warning. |
changes[] | History of changes: {"effective_date", "field", "from", "to"} where field is job_title, contract_type, hours_per_week, line_manager or team. |
An employment that overlaps one the person already has is skipped with a warning.
support[]
ref, start_date (required), end_date, reference, nhs_number (an invalid one is dropped), local_authority_ref. Episodes must not overlap.
needs[], contacts[]
- Need:
category,description(both required),severity(low,medium,high),review_date,ended_on. - Contact:
type(phone,email,address,next_of_kin,legal_guardian,social_worker,gp,other; anything else becomesother),value,label,primary.
registrations[], supervisions[], appraisals[], learning[]
The same fields as in Registrations, supervision and learning. For supervisions use supervisor_ref (a person ref) instead of a person; for appraisals, appraiser_ref. Learning record_type values outside the list become other. A record that fails the checks is skipped with a warning.
team_places[]
| Field | Notes |
|---|---|
ref, team_ref, person_ref | Both refs must be in the files or already imported. |
role, primary | primary is applied only to a place that has not ended. |
start_date | Required. |
end_date | Optional. If the person left (or support ended) and this is empty, it is set to their last day. |
The usual team rules apply: no two overlapping stints in a team, staff-only teams refuse people we support. A place that breaks one is skipped with the reason.
key_workers[]
ref, supported_ref, staff_ref, role_label, start_date (default today), end_date. The key worker must have been current staff, and the person supported must have been receiving support, on the start date. A link left open for someone who has since left is closed on their last day.
A complete small example
{
"format": "carecore-import", "version": 1, "source": "Spreadsheet, October 2026",
"teams": [
{ "ref": "t1", "name": "Loch View Care Home", "kind": "care" },
{ "ref": "t2", "name": "Day Team", "parent_ref": "t1" }
],
"people": [
{ "ref": "s1", "first_name": "Fiona", "last_name": "Maclean", "email": "fiona@example.org",
"profile": { "address_city": "Inverness", "address_postcode": "IV2 4SE" },
"employments": [ { "ref": "s1e", "job_title": "Registered Manager", "start_date": "2018-04-02", "hours_per_week": 37.5 } ],
"registrations": [ { "registration_type": "SSSC registered manager", "expiry_date": "2027-01-01" } ] },
{ "ref": "s2", "first_name": "Callum", "last_name": "Reid",
"employments": [ { "ref": "s2e", "job_title": "Support Worker", "start_date": "2022-09-13", "line_manager_ref": "s1" } ] },
{ "ref": "c1", "first_name": "Aileen", "last_name": "Duncan", "date_of_birth": "1952-12-30",
"support": [ { "ref": "c1s", "start_date": "2019-03-04", "nhs_number": "943 476 5919" } ],
"needs": [ { "category": "Falls risk", "description": "Review every six months", "severity": "high" } ] }
],
"team_places": [
{ "ref": "p1", "team_ref": "t2", "person_ref": "s2", "role": "Care worker", "primary": true, "start_date": "2022-09-13" }
],
"key_workers": [
{ "ref": "k1", "supported_ref": "c1", "staff_ref": "s2", "start_date": "2022-10-01" }
]
}
Save it as example.json, then check it: php scripts/import.php --org=your-org example.json.
From a spreadsheet
Export each sheet to CSV and write a short script (in any language) that builds this JSON: one object per row, with the row’s id as the ref. Run it, check the report, fix the spreadsheet, and repeat until the warnings are ones you accept. Because re-running is safe, you can go round this loop as often as you like before importing for real.
Next: Moving from the older Staff, People and Team services.