{"openapi":"3.1.0","info":{"title":"Care Core API","version":"1.0.0","description":"The Care Core API lets other systems read and change the people, staff, teams and care records in Care Core, with the same rules, audit trail and events as the web interface.\n\nAuthenticate with an API key: `Authorization: Bearer cc_…`. Keys are created by an administrator under Admin › Integrations and carry scopes. Full guide: https://core.example.com/docs/api"},"servers":[{"url":"https://core.example.com/api/v1"}],"tags":[{"name":"People"},{"name":"Staff"},{"name":"Compliance"},{"name":"Teams"},{"name":"Care"},{"name":"Recruitment"},{"name":"Referrals"},{"name":"Tasks"},{"name":"Events and webhooks"},{"name":"Audit and administration"},{"name":"Meta"}],"paths":{"/applications/{id}":{"get":{"tags":["Recruitment"],"summary":"Get an application","operationId":"gETApplicationsId","security":[{"bearerAuth":["recruitment.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Application"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Includes its checks.\n\nRequires the `recruitment.read` scope."},"patch":{"tags":["Recruitment"],"summary":"Update a candidate’s details","operationId":"pATCHApplicationsId","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Application"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Not once they have been hired.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","maxLength":100},"last_name":{"type":"string","maxLength":100},"email":{"type":["string","null"],"maxLength":190},"phone":{"type":["string","null"],"maxLength":40},"date_of_birth":{"type":["string","null"],"format":"date"},"source":{"type":["string","null"],"maxLength":100},"notes":{"type":["string","null"],"maxLength":5000},"interview_notes":{"type":["string","null"],"maxLength":10000}},"additionalProperties":false,"required":["first_name","last_name"]}}}}}},"/applications/{id}/accept-offer":{"post":{"tags":["Recruitment"],"summary":"Record that the offer was accepted","operationId":"pOSTApplicationsIdAcceptOffer","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Application"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accepted_on":{"type":"string","format":"date","description":"Default today."}},"additionalProperties":false}}}}}},"/applications/{id}/checks/{check}":{"post":{"tags":["Recruitment"],"summary":"Mark a check done or not done","operationId":"pOSTApplicationsIdChecksCheck","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"check","in":"path","required":true,"schema":{"type":"string"},"description":"Path value."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Application"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"done_on":{"type":["string","null"],"format":"date","description":"The day it was done; null clears it. Default today."},"notes":{"type":["string","null"],"maxLength":500}},"additionalProperties":false}}}}}},"/applications/{id}/hire":{"post":{"tags":["Recruitment"],"summary":"Hire the candidate","operationId":"pOSTApplicationsIdHire","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Hired"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Needs an accepted offer and every required check done. Starts them through the ordinary joiner process: a person, an employment, their team and the onboarding checklist, and the employment.started event. Creating a login is not done here.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start_date":{"type":"string","format":"date","description":"Defaults to the offer’s proposed start date."},"job_title":{"type":"string","maxLength":150,"description":"Defaults to the vacancy’s title."},"employee_ref":{"type":["string","null"],"maxLength":50},"line_manager_id":{"type":["string","null"],"format":"uuid","description":"Defaults to the vacancy’s."},"team_id":{"type":["string","null"],"format":"uuid","description":"Defaults to the vacancy’s."},"contract_type":{"type":"string","enum":["permanent","fixed_term","zero_hours","bank","apprenticeship","agency"]},"hours_per_week":{"type":"number","minimum":0.5}},"additionalProperties":false}}}}}},"/applications/{id}/stage":{"post":{"tags":["Recruitment"],"summary":"Move an application to another stage","operationId":"pOSTApplicationsIdStage","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Application"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"applied → shortlisted → interview → offer, or out as rejected or withdrawn; a rejected or withdrawn one can be reopened.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string","enum":["applied","shortlisted","interview","offer","rejected","withdrawn"],"description":"Hired is only reached by POST /applications/{id}/hire."},"interview_date":{"type":["string","null"],"format":"date"},"offer_date":{"type":["string","null"],"format":"date"},"proposed_start_date":{"type":"string","format":"date","description":"Required for the offer stage."},"reason":{"type":["string","null"],"maxLength":500}},"additionalProperties":false,"required":["stage"]}}}}}},"/audit":{"get":{"tags":["Audit and administration"],"summary":"Read the activity log","operationId":"gETAudit","security":[{"bearerAuth":["audit.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"Same as cursor.","schema":{"type":"string"}},{"name":"subject_id","in":"query","required":false,"description":"Only entries about this person, team or key.","schema":{"type":"string","format":"uuid"}},{"name":"action","in":"query","required":false,"description":"An action name or prefix such as employment.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEntry"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Oldest first, so a system can keep a cursor and read only what is new. Sensitive values are never in the log.\n\nRequires the `audit.read` scope."}},"/compliance/due":{"get":{"tags":["Compliance"],"summary":"What is overdue or due soon","operationId":"gETComplianceDue","security":[{"bearerAuth":["compliance.read"]}],"parameters":[{"name":"days","in":"query","required":false,"description":"Look this many days ahead, 1 to 365. Default 60.","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DueItem"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Current staff only. Registrations and learning by expiry; supervisions and appraisals by their most recent next-due date.\n\nRequires the `compliance.read` scope."}},"/consistency":{"get":{"tags":["Audit and administration"],"summary":"Run the consistency checks","operationId":"gETConsistency","security":[{"bearerAuth":["admin.read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConsistencyFinding"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Finds anything that disagrees with itself: a leaver still in a team, a login or a key worker link. Read only.\n\nRequires the `admin.read` scope."}},"/contacts/{id}":{"delete":{"tags":["Care"],"summary":"Remove a contact","operationId":"dELETEContactsId","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"204":{"description":"No content"},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `care.write` scope."}},"/employments":{"get":{"tags":["Staff"],"summary":"List employments","operationId":"gETEmployments","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"current, upcoming or ended.","schema":{"type":"string"}},{"name":"person_id","in":"query","required":false,"description":"Only this person’s employments.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Employment"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `staff.read` scope."},"post":{"tags":["Staff"],"summary":"Start someone (joiner)","operationId":"pOSTEmployments","security":[{"bearerAuth":["staff.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Employment"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Runs the joiner process in one transaction: the person (or a rehire), the employment, an optional team place, the new-starter checklist, the audit entry and the events. Logins are not created by the API.\n\nRequires the `staff.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"person_id":{"type":"string","format":"uuid","description":"An existing person (a rehire). Leave out to create a new person from the fields below."},"first_name":{"type":"string","maxLength":100,"description":"Required for a new person."},"last_name":{"type":"string","maxLength":100,"description":"Required for a new person."},"preferred_name":{"type":["string","null"],"maxLength":100},"date_of_birth":{"type":["string","null"],"format":"date"},"email":{"type":["string","null"],"maxLength":190},"phone":{"type":["string","null"],"maxLength":40},"job_title":{"type":"string","maxLength":150},"start_date":{"type":"string","format":"date","description":"May be in the future."},"contract_type":{"type":["string","null"],"maxLength":40,"description":"For example permanent, fixed_term, bank. Default permanent."},"hours_per_week":{"type":["number","null"],"maximum":168,"minimum":0.01},"employee_ref":{"type":["string","null"],"maxLength":50,"description":"Unique within the organisation."},"line_manager_id":{"type":["string","null"],"format":"uuid","description":"A person who is current staff."},"team_id":{"type":["string","null"],"format":"uuid","description":"Their primary team from the start date."},"team_role":{"type":["string","null"],"maxLength":80}},"additionalProperties":false,"required":["job_title","start_date"]}}}}}},"/employments/{id}":{"get":{"tags":["Staff"],"summary":"Get an employment","operationId":"gETEmploymentsId","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Employment"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `staff.read` scope."}},"/employments/{id}/changes":{"get":{"tags":["Staff"],"summary":"History of changes to an employment","operationId":"gETEmploymentsIdChanges","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmploymentChange"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `staff.read` scope."},"post":{"tags":["Staff"],"summary":"Change role, hours, line manager or team (mover)","operationId":"pOSTEmploymentsIdChanges","security":[{"bearerAuth":["staff.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Employment"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Runs the mover process. The effective date cannot be in the future. A team change ends the old primary team the day before and starts the new one on the effective date.\n\nRequires the `staff.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"effective_date":{"type":"string","format":"date","description":"Today or earlier. Default today."},"job_title":{"type":"string","maxLength":150},"contract_type":{"type":"string","maxLength":40},"hours_per_week":{"type":"number","maximum":168,"minimum":0.01},"line_manager_id":{"type":"string","format":"uuid"},"team_id":{"type":"string","format":"uuid","description":"Their new primary team."},"team_role":{"type":["string","null"],"maxLength":80}},"additionalProperties":false}}}}}},"/employments/{id}/details":{"get":{"tags":["Staff"],"summary":"Get employment terms","operationId":"gETEmploymentsIdDetails","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmploymentDetails"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Sections: terms, tupe, wtd, apprentice, visa, leave.\n\nRequires the `staff.read` scope."}},"/employments/{id}/details/{section}":{"patch":{"tags":["Staff"],"summary":"Update one section of employment terms","operationId":"pATCHEmploymentsIdDetailsSection","security":[{"bearerAuth":["staff.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"section","in":"path","required":true,"schema":{"type":"string"},"description":"Path value."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmploymentDetails"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"section is one of: terms, tupe, wtd, apprentice, visa, leave. Send only the fields to change; see the schema for each section.\n\nRequires the `staff.write` scope."}},"/employments/{id}/end":{"post":{"tags":["Staff"],"summary":"Record someone leaving (leaver)","operationId":"pOSTEmploymentsIdEnd","security":[{"bearerAuth":["staff.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeaveResult"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Ends the employment, team places and key worker links, creates reassign and offboarding tasks, and stops the login after the last day, all in one transaction.\n\nRequires the `staff.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"last_day":{"type":"string","format":"date","description":"Their last day of work. Access ends the day after."},"reason":{"type":["string","null"],"maxLength":80}},"additionalProperties":false,"required":["last_day"]}}}}}},"/employments/{id}/leave-preview":{"get":{"tags":["Staff"],"summary":"Preview what ending an employment will do","operationId":"gETEmploymentsIdLeavePreview","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"last_day","in":"query","required":false,"description":"The proposed last day. Required.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeavePreview"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Changes nothing.\n\nRequires the `staff.read` scope."}},"/events":{"get":{"tags":["Events and webhooks"],"summary":"Read the event feed","operationId":"gETEvents","security":[{"bearerAuth":["events.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"Same as cursor: return events after this one.","schema":{"type":"string"}},{"name":"types","in":"query","required":false,"description":"Comma-separated event types or prefixes, for example employment.*,team_assignment.ended.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"The same events that webhooks deliver, oldest first, for systems that prefer to poll. Keep the last cursor you processed and pass it as after. Identifiers and dates only.\n\nRequires the `events.read` scope."}},"/events/{id}":{"get":{"tags":["Events and webhooks"],"summary":"Get one event","operationId":"gETEventsId","security":[{"bearerAuth":["events.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Event"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `events.read` scope."}},"/key-workers":{"post":{"tags":["Care"],"summary":"Assign a key worker","operationId":"pOSTKeyWorkers","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KeyWorker"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"The key worker must be current staff, the person must be receiving support, and nobody can be their own key worker.\n\nRequires the `care.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supported_person_id":{"type":"string","format":"uuid","description":"Must be receiving support."},"staff_person_id":{"type":"string","format":"uuid","description":"Must be current staff."},"role_label":{"type":["string","null"],"maxLength":100},"start_date":{"type":"string","format":"date","description":"Default today. Not before support started."}},"additionalProperties":false,"required":["supported_person_id","staff_person_id"]}}}}}},"/key-workers/{id}/end":{"post":{"tags":["Care"],"summary":"End a key worker link","operationId":"pOSTKeyWorkersIdEnd","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KeyWorker"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `care.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"end_date":{"type":"string","format":"date","description":"Default today."}},"additionalProperties":false}}}}}},"/needs/{id}/end":{"post":{"tags":["Care"],"summary":"End a care need","operationId":"pOSTNeedsIdEnd","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CareNeed"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `care.write` scope.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/people":{"get":{"tags":["People"],"summary":"List people","operationId":"gETPeople","security":[{"bearerAuth":["people.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Match on first name, last name, full name or email.","schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"description":"staff (employed today), supported (receiving support today; needs care.read), leavers (former staff).","schema":{"type":"string"}},{"name":"employed_on","in":"query","required":false,"description":"Only people with an employment active on this date.","schema":{"type":"string","format":"date"}},{"name":"updated_since","in":"query","required":false,"description":"Only people changed on or after this UTC time (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ). For syncing.","schema":{"type":"string","format":"date-time"}},{"name":"email","in":"query","required":false,"description":"Exact email address.","schema":{"type":"string"}},{"name":"nhs_number","in":"query","required":false,"description":"Exact NHS/CHI number. Needs care.read.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Person"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Without the care.read scope, people who only receive support (never staff) are not listed and is_supported is null. Ordered by when the person was created.\n\nRequires the `people.read` scope."},"post":{"tags":["People"],"summary":"Create a person","operationId":"pOSTPeople","security":[{"bearerAuth":["people.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Creates the person record only. To make them staff use POST /employments.\n\nRequires the `people.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","maxLength":100,"description":"Required."},"last_name":{"type":"string","maxLength":100,"description":"Required."},"preferred_name":{"type":["string","null"],"maxLength":100,"description":"Known as."},"date_of_birth":{"type":["string","null"],"format":"date","description":"Not in the future."},"email":{"type":["string","null"],"maxLength":190},"phone":{"type":["string","null"],"maxLength":40},"sex":{"type":["string","null"],"enum":["M","F","X"],"description":"M, F, or X for another or not stated. Care data: needs care.read to see."},"nhs_number":{"type":["string","null"],"maxLength":20,"description":"The NHS/CHI number: 10 digits with a valid check digit (spaces are removed). One per person. Needs care.read to see."},"employment_status":{"type":["string","null"],"maxLength":100,"description":"For example Employed, Unemployed, Retired. Needs care.read to see."},"gp_practice":{"type":["string","null"],"maxLength":255,"description":"The name of their GP practice. Needs care.read to see."},"address_line1":{"type":["string","null"],"maxLength":190,"description":"Home address, first line. The address fields need care.read to see."},"address_line2":{"type":["string","null"],"maxLength":190},"town":{"type":["string","null"],"maxLength":100},"area":{"type":["string","null"],"maxLength":100,"description":"The locality or council area."},"postcode":{"type":["string","null"],"maxLength":12},"notes":{"type":["string","null"],"maxLength":5000}},"additionalProperties":false,"required":["first_name","last_name"]}}}}}},"/people/{id}":{"get":{"tags":["People"],"summary":"Get a person","operationId":"gETPeopleId","security":[{"bearerAuth":["people.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `people.read` scope."},"patch":{"tags":["People"],"summary":"Update a person","operationId":"pATCHPeopleId","security":[{"bearerAuth":["people.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Send only the fields to change.\n\nRequires the `people.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","maxLength":100,"description":"Required."},"last_name":{"type":"string","maxLength":100,"description":"Required."},"preferred_name":{"type":["string","null"],"maxLength":100,"description":"Known as."},"date_of_birth":{"type":["string","null"],"format":"date","description":"Not in the future."},"email":{"type":["string","null"],"maxLength":190},"phone":{"type":["string","null"],"maxLength":40},"sex":{"type":["string","null"],"enum":["M","F","X"],"description":"M, F, or X for another or not stated. Care data: needs care.read to see."},"nhs_number":{"type":["string","null"],"maxLength":20,"description":"The NHS/CHI number: 10 digits with a valid check digit (spaces are removed). One per person. Needs care.read to see."},"employment_status":{"type":["string","null"],"maxLength":100,"description":"For example Employed, Unemployed, Retired. Needs care.read to see."},"gp_practice":{"type":["string","null"],"maxLength":255,"description":"The name of their GP practice. Needs care.read to see."},"address_line1":{"type":["string","null"],"maxLength":190,"description":"Home address, first line. The address fields need care.read to see."},"address_line2":{"type":["string","null"],"maxLength":190},"town":{"type":["string","null"],"maxLength":100},"area":{"type":["string","null"],"maxLength":100,"description":"The locality or council area."},"postcode":{"type":["string","null"],"maxLength":12},"notes":{"type":["string","null"],"maxLength":5000}},"additionalProperties":false,"required":["first_name","last_name"]}}}}}},"/people/{id}/appraisals":{"get":{"tags":["Compliance"],"summary":"List appraisals","operationId":"gETPeopleIdAppraisals","security":[{"bearerAuth":["compliance.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Appraisal"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first.\n\nRequires the `compliance.read` scope."},"post":{"tags":["Compliance"],"summary":"Add a appraisal record","operationId":"pOSTPeopleIdAppraisals","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Appraisal"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `compliance.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appraisal_date":{"type":"string","format":"date","description":"Date"},"appraiser_person_id":{"type":["string","null"],"format":"uuid","description":"Appraiser (a person id)"},"appraisal_type":{"type":"string","enum":["annual","probationary","interim","return_to_work","other"],"description":"Type"},"outcome":{"type":"string","enum":["pending","outstanding","exceeds_expectations","meets_expectations","requires_improvement","unsatisfactory","not_completed"],"description":"Outcome"},"next_due_date":{"type":["string","null"],"format":"date","description":"Next due"},"notes":{"type":["string","null"],"maxLength":5000,"description":"Notes"}},"additionalProperties":false,"required":["appraisal_date","appraisal_type","outcome"]}}}}}},"/people/{id}/appraisals/{record}":{"delete":{"tags":["Compliance"],"summary":"Remove a appraisal record","operationId":"dELETEPeopleIdAppraisalsRecord","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"record","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"204":{"description":"No content"},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Compliance records can be added and removed, not edited. Remove and add the corrected one.\n\nRequires the `compliance.write` scope."}},"/people/{id}/contacts":{"get":{"tags":["Care"],"summary":"List contacts","operationId":"gETPeopleIdContacts","security":[{"bearerAuth":["care.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `care.read` scope."},"post":{"tags":["Care"],"summary":"Add a contact","operationId":"pOSTPeopleIdContacts","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `care.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["phone","email","address","next_of_kin","legal_guardian","social_worker","gp","other"]},"value":{"type":"string","maxLength":500},"label":{"type":["string","null"],"maxLength":100},"primary":{"type":"boolean"}},"additionalProperties":false,"required":["type","value"]}}}}}},"/people/{id}/employments":{"get":{"tags":["Staff"],"summary":"List a person’s employments","operationId":"gETPeopleIdEmployments","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Employment"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first. A rehire is a second employment.\n\nRequires the `staff.read` scope."}},"/people/{id}/key-workers":{"get":{"tags":["Care"],"summary":"Key worker links for a person","operationId":"gETPeopleIdKeyWorkers","security":[{"bearerAuth":["care.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/KeyWorker"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Links where the person is the one supported, and links where the person is the key worker. Current first.\n\nRequires the `care.read` scope."}},"/people/{id}/learning":{"get":{"tags":["Compliance"],"summary":"List learning","operationId":"gETPeopleIdLearning","security":[{"bearerAuth":["compliance.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Learning"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first.\n\nRequires the `compliance.read` scope."},"post":{"tags":["Compliance"],"summary":"Add a learning record","operationId":"pOSTPeopleIdLearning","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Learning"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `compliance.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":190,"description":"Title"},"record_type":{"type":"string","enum":["training","qualification","course","certification","induction","other"],"description":"Kind"},"provider":{"type":["string","null"],"maxLength":190,"description":"Provider"},"qualification_level":{"type":["string","null"],"maxLength":190,"description":"Level"},"completion_date":{"type":["string","null"],"format":"date","description":"Completed"},"expiry_date":{"type":["string","null"],"format":"date","description":"Expires"},"certificate_number":{"type":["string","null"],"maxLength":190,"description":"Certificate number"},"status":{"type":"string","enum":["completed","in_progress","pending","expired"],"description":"Status"},"is_mandatory":{"type":["boolean","null"],"description":"Mandatory training"},"notes":{"type":["string","null"],"maxLength":5000,"description":"Notes"}},"additionalProperties":false,"required":["title","record_type","status"]}}}}}},"/people/{id}/learning/{record}":{"delete":{"tags":["Compliance"],"summary":"Remove a learning record","operationId":"dELETEPeopleIdLearningRecord","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"record","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"204":{"description":"No content"},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Compliance records can be added and removed, not edited. Remove and add the corrected one.\n\nRequires the `compliance.write` scope."}},"/people/{id}/needs":{"get":{"tags":["Care"],"summary":"List care needs","operationId":"gETPeopleIdNeeds","security":[{"bearerAuth":["care.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"include_ended","in":"query","required":false,"description":"Include needs that have ended.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CareNeed"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `care.read` scope."},"post":{"tags":["Care"],"summary":"Add a care need","operationId":"pOSTPeopleIdNeeds","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CareNeed"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `care.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","maxLength":100},"description":{"type":"string","maxLength":5000},"severity":{"type":["string","null"],"enum":["low","medium","high"]},"review_date":{"type":["string","null"],"format":"date"}},"additionalProperties":false,"required":["category","description"]}}}}}},"/people/{id}/photo":{"get":{"tags":["Staff"],"summary":"Get a staff member’s profile photo","operationId":"gETPeopleIdPhoto","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"The picture itself (PNG, JPEG, WebP or GIF), not JSON. 404 if they have none. Use has_photo on the profile to know first. Photos waiting for approval are not returned: only the approved one.\n\nRequires the `staff.read` scope."}},"/people/{id}/profile":{"get":{"tags":["Staff"],"summary":"Get a staff member’s personal profile","operationId":"gETPeopleIdProfile","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Profile"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"National Insurance and bank fields are included only for keys with the staff.sensitive scope.\n\nRequires the `staff.read` scope."},"patch":{"tags":["Staff"],"summary":"Update a staff member’s personal profile","operationId":"pATCHPeopleIdProfile","security":[{"bearerAuth":["staff.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Profile"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Changing National Insurance or bank fields needs the staff.sensitive scope. Values are checked and encrypted at rest.\n\nRequires the `staff.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address_line1":{"type":["string","null"],"maxLength":190},"address_line2":{"type":["string","null"],"maxLength":190},"address_city":{"type":["string","null"],"maxLength":190},"address_county":{"type":["string","null"],"maxLength":190},"address_postcode":{"type":["string","null"],"maxLength":12,"description":"A UK postcode."},"address_country":{"type":["string","null"],"maxLength":190},"emergency_contact_name":{"type":["string","null"],"maxLength":190},"emergency_contact_phone":{"type":["string","null"],"maxLength":40},"ni_number":{"type":["string","null"],"maxLength":20,"description":"Needs the staff.sensitive scope."},"bank_account_name":{"type":["string","null"],"maxLength":190,"description":"Needs the staff.sensitive scope."},"bank_sort_code":{"type":["string","null"],"maxLength":12,"description":"Needs the staff.sensitive scope."},"bank_account_number":{"type":["string","null"],"maxLength":12,"description":"Needs the staff.sensitive scope."}},"additionalProperties":false}}}}}},"/people/{id}/registrations":{"get":{"tags":["Compliance"],"summary":"List registrations","operationId":"gETPeopleIdRegistrations","security":[{"bearerAuth":["compliance.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Registration"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first.\n\nRequires the `compliance.read` scope."},"post":{"tags":["Compliance"],"summary":"Add a registration record","operationId":"pOSTPeopleIdRegistrations","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Registration"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `compliance.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"registration_type":{"type":"string","maxLength":190,"description":"Registration"},"registration_body":{"type":["string","null"],"maxLength":190,"description":"Body (for example SSSC)"},"registration_number":{"type":["string","null"],"maxLength":190,"description":"Number"},"issue_date":{"type":["string","null"],"format":"date","description":"Issued"},"expiry_date":{"type":"string","format":"date","description":"Expires"},"is_required_for_role":{"type":["boolean","null"],"description":"Needed for the role"},"notes":{"type":["string","null"],"maxLength":5000,"description":"Notes"}},"additionalProperties":false,"required":["registration_type","expiry_date"]}}}}}},"/people/{id}/registrations/{record}":{"delete":{"tags":["Compliance"],"summary":"Remove a registration record","operationId":"dELETEPeopleIdRegistrationsRecord","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"record","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"204":{"description":"No content"},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Compliance records can be added and removed, not edited. Remove and add the corrected one.\n\nRequires the `compliance.write` scope."}},"/people/{id}/signature":{"get":{"tags":["Staff"],"summary":"Get a staff member’s signature image","operationId":"gETPeopleIdSignature","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"The picture itself (PNG), not JSON. 404 if they have not added one.\n\nRequires the `staff.read` scope."}},"/people/{id}/supervisions":{"get":{"tags":["Compliance"],"summary":"List supervisions","operationId":"gETPeopleIdSupervisions","security":[{"bearerAuth":["compliance.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Supervision"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first.\n\nRequires the `compliance.read` scope."},"post":{"tags":["Compliance"],"summary":"Add a supervision record","operationId":"pOSTPeopleIdSupervisions","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Supervision"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `compliance.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supervision_date":{"type":"string","format":"date","description":"Date held"},"supervisor_person_id":{"type":["string","null"],"format":"uuid","description":"Supervisor (a person id)"},"supervision_type":{"type":"string","enum":["individual","group","peer","other"],"description":"Type"},"duration_minutes":{"type":["integer","null"],"maximum":1440,"minimum":0,"description":"Minutes"},"outcome":{"type":["string","null"],"maxLength":5000,"description":"Outcome"},"next_due_date":{"type":["string","null"],"format":"date","description":"Next due"},"notes":{"type":["string","null"],"maxLength":5000,"description":"Notes"}},"additionalProperties":false,"required":["supervision_date","supervision_type"]}}}}}},"/people/{id}/supervisions/{record}":{"delete":{"tags":["Compliance"],"summary":"Remove a supervision record","operationId":"dELETEPeopleIdSupervisionsRecord","security":[{"bearerAuth":["compliance.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"record","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"204":{"description":"No content"},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Compliance records can be added and removed, not edited. Remove and add the corrected one.\n\nRequires the `compliance.write` scope."}},"/people/{id}/support":{"get":{"tags":["Care"],"summary":"List a person’s support episodes","operationId":"gETPeopleIdSupport","security":[{"bearerAuth":["care.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SupportEpisode"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first.\n\nRequires the `care.read` scope."},"post":{"tags":["Care"],"summary":"Start support","operationId":"pOSTPeopleIdSupport","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportEpisode"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"A person has one episode at a time.\n\nRequires the `care.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start_date":{"type":"string","format":"date","description":"Default today."},"reference":{"type":["string","null"],"maxLength":50},"nhs_number":{"type":["string","null"],"maxLength":20,"description":"10 digits with a valid check digit."},"local_authority_ref":{"type":["string","null"],"maxLength":50}},"additionalProperties":false}}}}}},"/people/{id}/support/end":{"post":{"tags":["Care"],"summary":"End support","operationId":"pOSTPeopleIdSupportEnd","security":[{"bearerAuth":["care.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportEnded"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Also ends their key worker links and team places on that day.\n\nRequires the `care.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"end_date":{"type":"string","format":"date","description":"Their last day of support. Default today."}},"additionalProperties":false}}}}}},"/people/{id}/teams":{"get":{"tags":["Teams"],"summary":"A person’s team history","operationId":"gETPeopleIdTeams","security":[{"bearerAuth":["teams.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TeamPlace"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Current places first.\n\nRequires the `teams.read` scope."}},"/ping":{"get":{"tags":["Meta"],"summary":"Check your key","operationId":"gETPing","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Ping"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Needs any valid key. Returns the organisation, the key’s scopes and limits, and the server time. Good for a health check."}},"/profile-changes":{"get":{"tags":["Staff"],"summary":"List self-service change requests","operationId":"gETProfileChanges","security":[{"bearerAuth":["staff.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"pending, approved, rejected or withdrawn.","schema":{"type":"string"}},{"name":"person_id","in":"query","required":false,"description":"Only this person’s requests.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProfileChange"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Read-only. Values of sensitive fields are omitted unless the key has the staff.sensitive scope.\n\nRequires the `staff.read` scope."}},"/referrals":{"get":{"tags":["Referrals"],"summary":"List referrals","operationId":"gETReferrals","security":[{"bearerAuth":["referrals.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"received, assessing, accepted, declined or withdrawn.","schema":{"type":"string"}},{"name":"person_id","in":"query","required":false,"description":"Only the referral linked to this person.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Referral"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first.\n\nRequires the `referrals.read` scope."},"post":{"tags":["Referrals"],"summary":"Record a referral","operationId":"pOSTReferrals","security":[{"bearerAuth":["referrals.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Referral"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Raises a referral.received event (identifiers only).\n\nRequires the `referrals.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["council","nhs","family","self","provider","other"],"description":"Who the referral came from."},"person_name":{"type":"string","maxLength":150,"description":"The person referred. They may not be a person in Care Core yet."},"date_of_birth":{"type":["string","null"],"format":"date","description":"Carried to the person record when one is started from the referral."},"nhs_number":{"type":["string","null"],"maxLength":12,"description":"CHI or NHS number."},"reason":{"type":"string","maxLength":600},"received_on":{"type":"string","format":"date","description":"Defaults to today. Cannot be in the future."},"referrer":{"type":["string","null"],"maxLength":200},"needs_summary":{"type":["string","null"],"maxLength":1000},"risks":{"type":["string","null"],"maxLength":600},"what_matters":{"type":["string","null"],"maxLength":600},"plan_types":{"type":"array","items":{"type":"string"},"description":"Any of dementia, behaviour, recovery, home."},"wanted_from":{"type":["string","null"],"format":"date"},"skills":{"type":"array","items":{"type":"string"},"description":"Specialist skills the support will need, as a list of names."}},"additionalProperties":false,"required":["source","person_name","reason"]}}}}}},"/referrals/{id}":{"get":{"tags":["Referrals"],"summary":"Get a referral","operationId":"gETReferralsId","security":[{"bearerAuth":["referrals.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Referral"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Includes the needs, risks, what matters to the person, the plans it calls for and the specialist skills.\n\nRequires the `referrals.read` scope."},"patch":{"tags":["Referrals"],"summary":"Change a referral","operationId":"pATCHReferralsId","security":[{"bearerAuth":["referrals.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Referral"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Only a referral that is received or being assessed can change.\n\nRequires the `referrals.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["council","nhs","family","self","provider","other"],"description":"Who the referral came from."},"person_name":{"type":"string","maxLength":150,"description":"The person referred. They may not be a person in Care Core yet."},"date_of_birth":{"type":["string","null"],"format":"date","description":"Carried to the person record when one is started from the referral."},"nhs_number":{"type":["string","null"],"maxLength":12,"description":"CHI or NHS number."},"reason":{"type":"string","maxLength":600},"received_on":{"type":"string","format":"date","description":"Defaults to today. Cannot be in the future."},"referrer":{"type":["string","null"],"maxLength":200},"needs_summary":{"type":["string","null"],"maxLength":1000},"risks":{"type":["string","null"],"maxLength":600},"what_matters":{"type":["string","null"],"maxLength":600},"plan_types":{"type":"array","items":{"type":"string"},"description":"Any of dementia, behaviour, recovery, home."},"wanted_from":{"type":["string","null"],"format":"date"},"skills":{"type":"array","items":{"type":"string"},"description":"Specialist skills the support will need, as a list of names."}},"additionalProperties":false,"required":["source","person_name","reason"]}}}}}},"/referrals/{id}/link":{"post":{"tags":["Referrals"],"summary":"Link an accepted referral to a person","operationId":"pOSTReferralsIdLink","security":[{"bearerAuth":["referrals.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Referral"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Raises referral.linked.\n\nRequires the `referrals.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"person_id":{"type":["string","null"],"format":"uuid","description":"The person to link. Leave out with create_person true to start a person from the name on the referral."},"create_person":{"type":"boolean","description":"Start a new person from the name on the referral (needs a first and last name)."}},"additionalProperties":false}}}}}},"/referrals/{id}/status":{"post":{"tags":["Referrals"],"summary":"Assess, accept, decline or withdraw a referral","operationId":"pOSTReferralsIdStatus","security":[{"bearerAuth":["referrals.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Referral"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Raises referral.status_changed.\n\nRequires the `referrals.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["assessing","accepted","declined","withdrawn"]},"reason":{"type":["string","null"],"maxLength":400,"description":"Required to decline or withdraw."}},"additionalProperties":false,"required":["status"]}}}}}},"/roles":{"get":{"tags":["Recruitment"],"summary":"List job roles","operationId":"gETRoles","security":[{"bearerAuth":["recruitment.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"active","in":"query","required":false,"description":"true (default) for roles in use only, false to include retired ones.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/JobRole"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.read` scope."},"post":{"tags":["Recruitment"],"summary":"Create a job role","operationId":"pOSTRoles","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JobRole"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":150},"code":{"type":["string","null"],"maxLength":30,"description":"Optional, unique within the organisation."},"description":{"type":["string","null"],"maxLength":10000,"description":"The job description."},"person_specification":{"type":["string","null"],"maxLength":10000},"reports_to_role_id":{"type":["string","null"],"format":"uuid","description":"The role this one reports to. Loops are refused."},"default_team_id":{"type":["string","null"],"format":"uuid","description":"The team the role normally sits in."},"contract_type":{"type":"string","enum":["permanent","fixed_term","zero_hours","bank","apprenticeship","agency"]},"hours_per_week":{"type":["number","null"],"minimum":0.5},"grade":{"type":["string","null"],"maxLength":60}},"additionalProperties":false,"required":["title"]}}}}}},"/roles/{id}":{"get":{"tags":["Recruitment"],"summary":"Get a job role","operationId":"gETRolesId","security":[{"bearerAuth":["recruitment.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JobRole"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Includes the checks someone needs before they can start.\n\nRequires the `recruitment.read` scope."},"patch":{"tags":["Recruitment"],"summary":"Update a job role","operationId":"pATCHRolesId","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JobRole"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Send only the fields to change.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":150},"code":{"type":["string","null"],"maxLength":30,"description":"Optional, unique within the organisation."},"description":{"type":["string","null"],"maxLength":10000,"description":"The job description."},"person_specification":{"type":["string","null"],"maxLength":10000},"reports_to_role_id":{"type":["string","null"],"format":"uuid","description":"The role this one reports to. Loops are refused."},"default_team_id":{"type":["string","null"],"format":"uuid","description":"The team the role normally sits in."},"contract_type":{"type":"string","enum":["permanent","fixed_term","zero_hours","bank","apprenticeship","agency"]},"hours_per_week":{"type":["number","null"],"minimum":0.5},"grade":{"type":["string","null"],"maxLength":60}},"additionalProperties":false,"required":["title"]}}}}}},"/roles/{id}/checks":{"post":{"tags":["Recruitment"],"summary":"Add a check to a role","operationId":"pOSTRolesIdChecks","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JobRole"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Applies to candidates added afterwards.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":150},"description":{"type":["string","null"],"maxLength":500},"required":{"type":"boolean","description":"Whether it must be done before someone can start. Default true."}},"additionalProperties":false,"required":["title"]}}}}}},"/roles/{id}/retire":{"post":{"tags":["Recruitment"],"summary":"Retire a job role","operationId":"pOSTRolesIdRetire","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JobRole"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Existing vacancies keep it; no new vacancy can use it.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/scopes":{"get":{"tags":["Meta"],"summary":"List all scopes","operationId":"gETScopes","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Needs any valid key."}},"/tasks":{"get":{"tags":["Tasks"],"summary":"List tasks","operationId":"gETTasks","security":[{"bearerAuth":["tasks.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"open (default), done, skipped or all.","schema":{"type":"string"}},{"name":"person_id","in":"query","required":false,"description":"Tasks about this person.","schema":{"type":"string","format":"uuid"}},{"name":"kind","in":"query","required":false,"description":"joiner, mover, leaver, reassign or manual.","schema":{"type":"string"}},{"name":"due_before","in":"query","required":false,"description":"Due on or before this date.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `tasks.read` scope."},"post":{"tags":["Tasks"],"summary":"Create a task about a person","operationId":"pOSTTasks","security":[{"bearerAuth":["tasks.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Always a manual task. Keep the title and description free of health information: tasks are seen by every manager. Send an Idempotency-Key so a retry cannot create it twice.\n\nRequires the `tasks.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"person_id":{"type":"string","format":"uuid"},"title":{"type":"string","maxLength":200},"description":{"type":["string","null"],"maxLength":500},"due_date":{"type":["string","null"],"format":"date"},"owner_role":{"type":"string","enum":["admin","manager","staff"]}},"additionalProperties":false,"required":["person_id","title"]}}}}}},"/tasks/{id}":{"get":{"tags":["Tasks"],"summary":"Get a task","operationId":"gETTasksId","security":[{"bearerAuth":["tasks.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `tasks.read` scope."},"patch":{"tags":["Tasks"],"summary":"Mark a task done, skipped or open","operationId":"pATCHTasksId","security":[{"bearerAuth":["tasks.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Marking a task done raises a task.completed event.\n\nRequires the `tasks.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","done","skipped"]}},"additionalProperties":false,"required":["status"]}}}}}},"/teams":{"get":{"tags":["Teams"],"summary":"List teams","operationId":"gETTeams","security":[{"bearerAuth":["teams.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"active","in":"query","required":false,"description":"true (default) for open teams only, false to include closed ones.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Team"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `teams.read` scope."},"post":{"tags":["Teams"],"summary":"Create a team","operationId":"pOSTTeams","security":[{"bearerAuth":["teams.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Team"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `teams.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":150},"parent_id":{"type":["string","null"],"format":"uuid","description":"The team this one sits under. Loops are refused."},"kind":{"type":"string","maxLength":40,"description":"For example care, support, hr. Default care."},"staff_only":{"type":"boolean","description":"Refuse people who are only supported."}},"additionalProperties":false,"required":["name"]}}}}}},"/teams/{id}":{"get":{"tags":["Teams"],"summary":"Get a team","operationId":"gETTeamsId","security":[{"bearerAuth":["teams.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Team"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `teams.read` scope."},"patch":{"tags":["Teams"],"summary":"Update a team","operationId":"pATCHTeamsId","security":[{"bearerAuth":["teams.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Team"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Send only the fields to change.\n\nRequires the `teams.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":150},"parent_id":{"type":["string","null"],"format":"uuid","description":"The team this one sits under. Loops are refused."},"kind":{"type":"string","maxLength":40,"description":"For example care, support, hr. Default care."},"staff_only":{"type":"boolean","description":"Refuse people who are only supported."}},"additionalProperties":false,"required":["name"]}}}}}},"/teams/{id}/close":{"post":{"tags":["Teams"],"summary":"Close a team","operationId":"pOSTTeamsIdClose","security":[{"bearerAuth":["teams.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Team"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Ends every current place in it. Refused while it has active sub-teams.\n\nRequires the `teams.write` scope.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/teams/{id}/members":{"get":{"tags":["Teams"],"summary":"List who is in a team","operationId":"gETTeamsIdMembers","security":[{"bearerAuth":["teams.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"on","in":"query","required":false,"description":"Who was in the team on this date. Default today.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TeamPlace"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `teams.read` scope."},"post":{"tags":["Teams"],"summary":"Add someone to a team","operationId":"pOSTTeamsIdMembers","security":[{"bearerAuth":["teams.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TeamPlace"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Staff-only teams refuse people who are only supported. One active place per person per team; one primary team per staff member.\n\nRequires the `teams.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"person_id":{"type":"string","format":"uuid"},"role":{"type":["string","null"],"maxLength":80,"description":"Their role in the team."},"primary":{"type":"boolean","description":"Make this their primary team."},"start_date":{"type":"string","format":"date","description":"Default today. Not before they last left this team."}},"additionalProperties":false,"required":["person_id"]}}}}}},"/teams/{id}/members/{person}/end":{"post":{"tags":["Teams"],"summary":"End someone’s place in a team","operationId":"pOSTTeamsIdMembersPersonEnd","security":[{"bearerAuth":["teams.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"person","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TeamPlace"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `teams.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"end_date":{"type":"string","format":"date","description":"Their last day in the team. Default today."}},"additionalProperties":false}}}}}},"/users":{"get":{"tags":["Audit and administration"],"summary":"List logins","operationId":"gETUsers","security":[{"bearerAuth":["admin.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Read only: logins are created through the joiner process, Entra provisioning or the administration pages.\n\nRequires the `admin.read` scope."}},"/vacancies":{"get":{"tags":["Recruitment"],"summary":"List vacancies","operationId":"gETVacancies","security":[{"bearerAuth":["recruitment.read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"draft, open, filled or closed.","schema":{"type":"string"}},{"name":"role_id","in":"query","required":false,"description":"Only vacancies for this role.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Vacancy"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.read` scope."},"post":{"tags":["Recruitment"],"summary":"Create a vacancy","operationId":"pOSTVacancies","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Vacancy"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Starts as a draft.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role_id":{"type":"string","format":"uuid","description":"The job role this is a post in."},"title":{"type":"string","maxLength":150,"description":"Defaults to the role’s title."},"team_id":{"type":["string","null"],"format":"uuid","description":"Defaults to the role’s usual team."},"line_manager_id":{"type":["string","null"],"format":"uuid","description":"The person they will report to (a person id)."},"posts":{"type":"integer","minimum":1,"description":"How many posts to fill. Default 1."},"contract_type":{"type":"string","enum":["permanent","fixed_term","zero_hours","bank","apprenticeship","agency"],"description":"Defaults to the role’s."},"hours_per_week":{"type":["number","null"],"minimum":0.5},"closing_date":{"type":["string","null"],"format":"date"},"notes":{"type":["string","null"],"maxLength":5000}},"additionalProperties":false,"required":["role_id"]}}}}}},"/vacancies/{id}":{"get":{"tags":["Recruitment"],"summary":"Get a vacancy","operationId":"gETVacanciesId","security":[{"bearerAuth":["recruitment.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Vacancy"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.read` scope."},"patch":{"tags":["Recruitment"],"summary":"Update a vacancy","operationId":"pATCHVacanciesId","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Vacancy"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Only a draft or open vacancy can change. Send only the fields to change.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role_id":{"type":"string","format":"uuid","description":"The job role this is a post in."},"title":{"type":"string","maxLength":150,"description":"Defaults to the role’s title."},"team_id":{"type":["string","null"],"format":"uuid","description":"Defaults to the role’s usual team."},"line_manager_id":{"type":["string","null"],"format":"uuid","description":"The person they will report to (a person id)."},"posts":{"type":"integer","minimum":1,"description":"How many posts to fill. Default 1."},"contract_type":{"type":"string","enum":["permanent","fixed_term","zero_hours","bank","apprenticeship","agency"],"description":"Defaults to the role’s."},"hours_per_week":{"type":["number","null"],"minimum":0.5},"closing_date":{"type":["string","null"],"format":"date"},"notes":{"type":["string","null"],"maxLength":5000}},"additionalProperties":false,"required":["role_id"]}}}}}},"/vacancies/{id}/applications":{"get":{"tags":["Recruitment"],"summary":"List a vacancy’s candidates","operationId":"gETVacanciesIdApplications","security":[{"bearerAuth":["recruitment.read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"stage","in":"query","required":false,"description":"applied, shortlisted, interview, offer, hired, rejected or withdrawn.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Application"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.read` scope."},"post":{"tags":["Recruitment"],"summary":"Add a candidate","operationId":"pOSTVacanciesIdApplications","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Application"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"The vacancy must be open. The role’s checks are copied to the application.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","maxLength":100},"last_name":{"type":"string","maxLength":100},"email":{"type":["string","null"],"maxLength":190},"phone":{"type":["string","null"],"maxLength":40},"date_of_birth":{"type":["string","null"],"format":"date"},"source":{"type":["string","null"],"maxLength":100},"notes":{"type":["string","null"],"maxLength":5000}},"additionalProperties":false,"required":["first_name","last_name"]}}}}}},"/vacancies/{id}/close":{"post":{"tags":["Recruitment"],"summary":"Close a vacancy without filling it","operationId":"pOSTVacanciesIdClose","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Vacancy"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `recruitment.write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reject_remaining":{"type":"boolean","description":"Also close candidates still in progress."}},"additionalProperties":false}}}}}},"/vacancies/{id}/open":{"post":{"tags":["Recruitment"],"summary":"Open a vacancy","operationId":"pOSTVacanciesIdOpen","security":[{"bearerAuth":["recruitment.write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Vacancy"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Candidates can then be added.\n\nRequires the `recruitment.write` scope.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/webhooks":{"get":{"tags":["Events and webhooks"],"summary":"List webhook endpoints","operationId":"gETWebhooks","security":[{"bearerAuth":["webhooks.manage"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `webhooks.manage` scope."},"post":{"tags":["Events and webhooks"],"summary":"Create a webhook endpoint","operationId":"pOSTWebhooks","security":[{"bearerAuth":["webhooks.manage"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Makes a retry safe: the same key with the same body returns the first response instead of doing it twice."}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Webhook"}}}}},"headers":{"Location":{"schema":{"type":"string"},"description":"Where the new resource lives."}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"The response includes the signing secret once. Store it: it is never shown again.\n\nRequires the `webhooks.manage` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":500,"description":"An https:// address (http only for localhost)."},"event_types":{"type":"array","items":{"type":"string"},"description":"Event types to receive: exact names or prefixes such as \"employment.*\". Default [\"*\"] (everything)."},"active":{"type":"boolean","description":"Pause or resume deliveries."}},"additionalProperties":false,"required":["url"]}}}}}},"/webhooks/{id}":{"get":{"tags":["Events and webhooks"],"summary":"Get a webhook endpoint","operationId":"gETWebhooksId","security":[{"bearerAuth":["webhooks.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `webhooks.manage` scope."},"patch":{"tags":["Events and webhooks"],"summary":"Change a webhook endpoint","operationId":"pATCHWebhooksId","security":[{"bearerAuth":["webhooks.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `webhooks.manage` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":500,"description":"An https:// address (http only for localhost)."},"event_types":{"type":"array","items":{"type":"string"},"description":"Event types to receive: exact names or prefixes such as \"employment.*\". Default [\"*\"] (everything)."},"active":{"type":"boolean","description":"Pause or resume deliveries."}},"additionalProperties":false,"required":["url"]}}}}},"delete":{"tags":["Events and webhooks"],"summary":"Delete a webhook endpoint","operationId":"dELETEWebhooksId","security":[{"bearerAuth":["webhooks.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."}],"responses":{"204":{"description":"No content"},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Requires the `webhooks.manage` scope."}},"/webhooks/{id}/deliveries":{"get":{"tags":["Events and webhooks"],"summary":"Recent deliveries to an endpoint","operationId":"gETWebhooksIdDeliveries","security":[{"bearerAuth":["webhooks.manage"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id (UUID)."},{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Default 50.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The next_cursor from the previous page.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"pending, delivered or failed.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"400":{"description":"Bad request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid, revoked or expired key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks the scope, or may not be used from this address","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"A rule was broken or a field is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"description":"Newest first.\n\nRequires the `webhooks.manage` scope."}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key from Admin › Integrations › API keys."}},"schemas":{"Problem":{"type":"object","description":"An RFC 9457 problem document.","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string"},"detail":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":["string","null"]},"message":{"type":"string"}}}},"request_id":{"type":"string"}}},"Page":{"type":"object","properties":{"limit":{"type":"integer"},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}},"Person":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"first_name":{"type":"string"},"last_name":{"type":"string"},"preferred_name":{"type":["string","null"]},"date_of_birth":{"type":["string","null"],"format":"date"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"notes":{"type":["string","null"]},"sex":{"type":["string","null"],"enum":["M","F","X",null],"description":"Care data: empty without care.read."},"nhs_number":{"type":["string","null"]},"employment_status":{"type":["string","null"]},"gp_practice":{"type":["string","null"]},"address_line1":{"type":["string","null"]},"address_line2":{"type":["string","null"]},"town":{"type":["string","null"]},"area":{"type":["string","null"]},"postcode":{"type":["string","null"]},"is_staff":{"type":"boolean"},"is_supported":{"type":["boolean","null"]},"current_employment":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"job_title":{"type":"string"},"start_date":{"type":"string","format":"date"},"end_date":{"type":["string","null"],"format":"date"}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Employment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"employee_ref":{"type":["string","null"]},"job_title":{"type":"string"},"contract_type":{"type":"string"},"hours_per_week":{"type":["number","null"]},"start_date":{"type":"string","format":"date"},"end_date":{"type":["string","null"],"format":"date"},"leaving_reason":{"type":["string","null"]},"line_manager_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string","enum":["upcoming","current","ended"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"EmploymentChange":{"type":"object","properties":{"effective_date":{"type":"string","format":"date"},"field":{"type":"string"},"from":{"type":["string","null"]},"to":{"type":["string","null"]}}},"LeavePreview":{"type":"object","properties":{"last_day":{"type":"string","format":"date"},"team_places_that_will_end":{"type":"array","items":{"type":"string"}},"people_who_lose_this_key_worker":{"type":"integer"},"people_who_lose_this_line_manager":{"type":"integer"},"logins_that_will_stop":{"type":"integer"},"offboarding_tasks_that_will_be_created":{"type":"integer"}}},"LeaveResult":{"type":"object","properties":{"employment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"employee_ref":{"type":["string","null"]},"job_title":{"type":"string"},"contract_type":{"type":"string"},"hours_per_week":{"type":["number","null"]},"start_date":{"type":"string","format":"date"},"end_date":{"type":["string","null"],"format":"date"},"leaving_reason":{"type":["string","null"]},"line_manager_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string","enum":["upcoming","current","ended"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"team_places_ended":{"type":"integer"},"key_worker_links_ended":{"type":"integer"},"reassign_tasks_for_reports":{"type":"integer"},"logins_set_to_end":{"type":"integer"},"offboarding_tasks_created":{"type":"integer"}}},"EmploymentDetails":{"type":"object","description":"One object per section (terms, tupe, wtd, apprentice, visa, leave), each with its fields.","additionalProperties":{"type":"object"}},"Profile":{"type":"object","description":"Address, emergency contact, has_photo, has_signature and (with staff.sensitive) National Insurance and bank fields.","additionalProperties":true},"ProfileChange":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"field":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","withdrawn"]},"current_value":{"type":["string","null"]},"proposed_value":{"type":["string","null"]},"rejection_reason":{"type":["string","null"]},"submitted_at":{"type":["string","null"],"format":"date-time"},"reviewed_at":{"type":["string","null"],"format":"date-time"}}},"Registration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"registration_type":{"type":"string"},"registration_body":{"type":["string","null"]},"registration_number":{"type":["string","null"]},"issue_date":{"type":["string","null"],"format":"date"},"expiry_date":{"type":"string","format":"date"},"is_required_for_role":{"type":"boolean"},"notes":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"Supervision":{"type":"object","additionalProperties":true,"description":"id, person_id, supervision_date, supervisor_person_id, supervision_type, duration_minutes, outcome, next_due_date, notes, created_at."},"Appraisal":{"type":"object","additionalProperties":true,"description":"id, person_id, appraisal_date, appraiser_person_id, appraisal_type, outcome, next_due_date, notes, created_at."},"Learning":{"type":"object","additionalProperties":true,"description":"id, person_id, title, record_type, provider, qualification_level, completion_date, expiry_date, certificate_number, status, is_mandatory, notes, created_at."},"DueItem":{"type":"object","properties":{"person_id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["registration","learning","supervision","appraisal"]},"what":{"type":"string"},"label":{"type":["string","null"]},"due":{"type":"string","format":"date"},"overdue":{"type":"boolean"}}},"Team":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"parent_id":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string"},"staff_only":{"type":"boolean"},"active":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"}}},"TeamPlace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"team_id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"role":{"type":["string","null"]},"primary":{"type":"boolean"},"start_date":{"type":"string","format":"date"},"end_date":{"type":["string","null"],"format":"date"}}},"SupportEpisode":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"start_date":{"type":"string","format":"date"},"end_date":{"type":["string","null"],"format":"date"},"reference":{"type":["string","null"]},"nhs_number":{"type":["string","null"]},"local_authority_ref":{"type":["string","null"]}}},"SupportEnded":{"type":"object","properties":{"key_worker_links_ended":{"type":"integer"},"team_places_ended":{"type":"integer"}}},"CareNeed":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"category":{"type":"string"},"description":{"type":"string"},"severity":{"type":["string","null"]},"review_date":{"type":["string","null"],"format":"date"},"ended_on":{"type":["string","null"],"format":"date"}}},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"type":{"type":"string"},"label":{"type":["string","null"]},"value":{"type":"string"},"primary":{"type":"boolean"}}},"KeyWorker":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"supported_person_id":{"type":"string","format":"uuid"},"staff_person_id":{"type":"string","format":"uuid"},"role_label":{"type":["string","null"]},"start_date":{"type":"string","format":"date"},"end_date":{"type":["string","null"],"format":"date"}}},"JobRole":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"code":{"type":["string","null"]},"description":{"type":["string","null"]},"person_specification":{"type":["string","null"]},"reports_to_role_id":{"type":["string","null"],"format":"uuid"},"default_team_id":{"type":["string","null"],"format":"uuid"},"contract_type":{"type":"string"},"hours_per_week":{"type":["number","null"]},"grade":{"type":["string","null"]},"active":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"},"checks":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":["string","null"]},"required":{"type":"boolean"}}}}}},"Vacancy":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reference":{"type":"string"},"role_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"team_id":{"type":["string","null"],"format":"uuid"},"line_manager_id":{"type":["string","null"],"format":"uuid"},"posts":{"type":"integer"},"filled":{"type":"integer"},"status":{"type":"string","enum":["draft","open","filled","closed"]},"contract_type":{"type":"string"},"hours_per_week":{"type":["number","null"]},"opened_on":{"type":["string","null"],"format":"date"},"closing_date":{"type":["string","null"],"format":"date"},"closed_on":{"type":["string","null"],"format":"date"},"notes":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"Referral":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reference":{"type":"string"},"status":{"type":"string","enum":["received","assessing","accepted","declined","withdrawn"]},"source":{"type":"string"},"referrer":{"type":["string","null"]},"person_name":{"type":"string"},"date_of_birth":{"type":["string","null"],"format":"date"},"nhs_number":{"type":["string","null"]},"person_id":{"type":["string","null"],"format":"uuid"},"received_on":{"type":"string","format":"date"},"wanted_from":{"type":["string","null"],"format":"date"},"reason":{"type":"string"},"needs_summary":{"type":["string","null"]},"risks":{"type":["string","null"]},"what_matters":{"type":["string","null"]},"plan_types":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"decided_at":{"type":["string","null"],"format":"date-time"},"decision_reason":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"Application":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"vacancy_id":{"type":"string","format":"uuid"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"date_of_birth":{"type":["string","null"],"format":"date"},"source":{"type":["string","null"]},"stage":{"type":"string","enum":["applied","shortlisted","interview","offer","hired","rejected","withdrawn"]},"stage_changed_on":{"type":"string","format":"date"},"interview_date":{"type":["string","null"],"format":"date"},"interview_notes":{"type":["string","null"]},"offer_date":{"type":["string","null"],"format":"date"},"offer_accepted_on":{"type":["string","null"],"format":"date"},"proposed_start_date":{"type":["string","null"],"format":"date"},"reason":{"type":["string","null"]},"notes":{"type":["string","null"]},"person_id":{"type":["string","null"],"format":"uuid"},"employment_id":{"type":["string","null"],"format":"uuid"},"created_at":{"type":["string","null"],"format":"date-time"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":["string","null"]},"required":{"type":"boolean"},"done_on":{"type":["string","null"],"format":"date"},"notes":{"type":["string","null"]}}}}}},"Hired":{"type":"object","properties":{"application":{"$ref":"#/components/schemas/Application"},"person_id":{"type":"string","format":"uuid"},"employment_id":{"type":"string","format":"uuid"},"onboarding_tasks_created":{"type":"integer"},"rehire":{"type":"boolean"},"vacancy_filled":{"type":"boolean"}}},"Task":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["joiner","mover","leaver","reassign","manual"]},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["open","done","skipped"]},"due_date":{"type":["string","null"],"format":"date"},"owner_role":{"type":"string"},"completed_at":{"type":["string","null"],"format":"date-time"}}},"Event":{"type":"object","properties":{"cursor":{"type":"string"},"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"subject":{"type":["string","null"],"format":"uuid"},"data":{"type":"object","additionalProperties":true}}},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"},"secret":{"type":"string","description":"Only in the response that creates the endpoint."}}},"WebhookDelivery":{"type":"object","properties":{"event_id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer"},"http_status":{"type":["integer","null"]},"error":{"type":["string","null"]},"next_attempt_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}}},"AuditEntry":{"type":"object","properties":{"cursor":{"type":"string"},"when":{"type":["string","null"],"format":"date-time"},"action":{"type":"string"},"actor":{"type":["string","null"]},"subject_type":{"type":"string"},"subject_id":{"type":["string","null"],"format":"uuid"},"summary":{"type":"string"},"detail":{"type":["object","null"],"additionalProperties":true}}},"User":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","manager","staff"]},"status":{"type":"string","enum":["active","invited","disabled"]},"access_ends_on":{"type":["string","null"],"format":"date"},"person_id":{"type":["string","null"],"format":"uuid"},"last_login_at":{"type":["string","null"],"format":"date-time"}}},"ConsistencyFinding":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"person_id":{"type":"string","format":"uuid"},"detail":{"type":"string"},"fixable":{"type":"boolean"}}},"Ping":{"type":"object","properties":{"organisation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"rate_limit_per_minute":{"type":"integer"},"expires_at":{"type":["string","null"],"format":"date-time"}}},"server_time":{"type":"string","format":"date-time"},"api_version":{"type":"string"}}},"Scope":{"type":"object","properties":{"scope":{"type":"string"},"description":{"type":"string"},"granted":{"type":"boolean"}}}}}}