Persons and Companies
Persons and Companies hold the information Dockt uses to check work: values you send, facts read from documents, and answers from public registries. The documentation calls a Person or Company a subject when the same behavior applies to both.
- A Person is a worker.
- A Company is an employer, subcontractor, main contractor or client.
Documents and registry results belong to the Person or Company they describe. A Person’s passport and safety certificate count at every Workplace where the Person works. Dockt decides which evidence applies to a piece of work from its facts, such as the employer, the country and the period.
Create Persons and Companies
Section titled “Create Persons and Companies”Choose the method that fits your workflow:
- Create them directly:
POST /v1/personsorPOST /v1/companies. - Create them with work: an Assignment or Engagement that refers to a Person or Company Dockt doesn’t know yet creates it from the details you send along.
- Import them from a Connection: taking a worker in from a source system creates or matches the Person and their employer.
For a normal Assignment or Engagement, you can create the Person or Company in the same request. A dry run requires those records to exist first.
POST /v1/persons with an external_ref creates the Person (201) or updates the one with that reference (200):
{ "external_ref": "worker-4821", "attributes": { "person.first_name": "Jan", "person.last_name": "Peeters", "person.date_of_birth": "1988-04-02", "person.nationality": ["BE"] }}POST /v1/companies creates a Company or updates the one with the same external_ref or registration number:
{ "external_ref": "comp-77", "name": "Alfa Welding BV", "country": "BE", "registration_number": "BE0123456789"}Matching
Section titled “Matching”For API creates, Dockt matches a Person by external_ref and namespace. It never matches people on their name or date of birth. Connection intake can also match using the identity number recorded by the source system.
Dockt keeps one Company per registration number in an Account, however the number is written. Spacing, punctuation and case don’t count. A number without a country prefix takes the Company’s country, and a Belgian enterprise number may omit BE and its leading zero. A known registration number sent with a new external_ref adds that reference to the existing Company.
When an external_ref points to one Company and the registration number to another, Dockt refuses the request with reference-conflict and names both. It never merges them silently.
Documents never create Companies. When a Person’s document names an employer that is not a Company in your Account, Dockt looks that employer up in registries. If the employer is still unknown when the work is evaluated, the Decision gets an unknown_employer finding for review.
Refer to a record
Section titled “Refer to a record”Wherever a request names a Person, Company or Workplace, send a reference object with either Dockt’s id or your external_ref. For example, use a Dockt ID:
{ "id": "per_7Hq2" }Or use your own reference. Omit namespace to use api:
{ "external_ref": "worker-4821", "namespace": "hr-system" }- A Person or Company reference by
external_refmay carry the record’s details, with the same fields as creating it. Dockt then creates the record if it is new, or applies the details if it exists. A Company reference can also useregistration_numberinstead of, or next to,external_ref. - A Workplace reference never carries details. The Workplace must exist.
- A reference by
idmust point to an existing record. Details next to anidare rejected withreference-invalid. - Sending both
idandexternal_refis rejected withreference-invalid. - An unknown
id, or an unknown Workplaceexternal_ref, returnsreference-not-found. - An unknown Person
external_refcreates the Person. An unknown Company reference needs at least anameto create the Company.
Responses return references in full:
{ "person": { "id": "per_7Hq2", "external_ref": "worker-4821", "namespace": "api" } }Find a record by your reference with a list filter, such as GET /v1/persons?external_ref=worker-4821&namespace=api. Without namespace, the filter finds the reference in any namespace, including one a Connection took in.
To look someone up, GET /v1/persons?q=… and GET /v1/companies?q=… search part of the name, or an exact reference or Dockt ID. Search only finds records to show; Dockt never matches a Person by name.
Each Person and Company has open_work: its upcoming and open Assignments counted by the result of their latest Decision. A Company counts the work of the workers it employs.
Attributes
Section titled “Attributes”Attributes are values about a Person, Company, Workplace, Assignment or Engagement. Their codes start with the record they belong to: person.*, company.*, workplace.*, assignment.* and engagement.*. Country-specific codes carry the country after the owner, such as workplace.be.region.
Send attributes as plain values keyed by code:
{ "attributes": { "person.date_of_birth": "1988-04-02", "person.nationality": ["BE"] } }Values you send through the API have source customer. Responses show the effective value of each attribute and its source:
{ "attributes": { "person.date_of_birth": { "value": "1988-04-02", "source": "document" }, "person.nationality": { "value": ["BE"], "source": "customer" } }}Sources are customer, connection, document, registry and derived. Dockt keeps one value per source. The effective value is the registry value when there is one, and otherwise the latest value.
When sources disagree after normalising case, accents and spacing, the record lists the attribute under discrepancies. A Decision that uses that attribute gets an attribute_discrepancy finding, so a person can decide which value is right.
An unknown code, or a code sent to the wrong record, is rejected with attribute-unknown. GET /v1/attribute-definitions lists every code. See the attribute reference.
Documents and registry results
Section titled “Documents and registry results”Upload a Person’s files to POST /v1/persons/{personId}/documents and a Company’s files to POST /v1/companies/{companyId}/documents. Each Document is processed once and counts wherever it applies.
Dockt also asks public registries about each Person and Company: company registers, credential registers and document issuers. It asks when a subject is created, when what is known about it changes, and again on the Policy’s re-check interval while work is open.
Active subjects
Section titled “Active subjects”active is true while a Person has an upcoming or open Assignment, or a Company has an upcoming or open Engagement. Dockt keeps checking active subjects. Filter Persons with GET /v1/persons?active=true.
Update and erase
Section titled “Update and erase”PATCH /v1/persons/{personId}sets attributes. Anexternal_refin the body adds another reference to the Person.PATCH /v1/companies/{companyId}changes the name, country, registration number and attributes, and can add a reference.
Each change re-evaluates the open work that depends on the subject.
DELETE /v1/persons/{personId} erases a Person. It is irreversible:
- It deletes the Person’s documents, attributes and registry results.
- It ends their open Assignments today.
- It keeps their Decisions as records without personal data.
- It removes Outcome notes and reviewer names.
Use it when a worker asks to be erased. To stop monitoring a worker who left, end their Assignments instead.