Connections
A Connection links your Account to a source system that already holds your workers, such as Conneqtr. Dockt reads the source’s sites and rosters. You choose which workers to take in, and Dockt creates their Persons, employers, Assignments and files.
Connections are available when Dockt has enabled them for your Account. GET /v1/account shows connections_enabled. Without it, the connection endpoints return 404.
You manage Connections under /v1/account/connections. You bind sites, read rosters and take workers in with /v1/source-bindings, /v1/source-workers and /v1/source-intakes.
The parts
Section titled “The parts”- A connector is a source system Dockt can connect to.
GET /v1/account/connectorslists them with their authentication methods and support state. - A Connection holds the credentials for one source account and the sites it can read.
- A source binding links one source site to one Workplace.
- A source worker is a worker on a bound site’s roster, as the source records them.
- A source intake takes one selected source worker in at the Workplace.
Connect a source
Section titled “Connect a source”Create a Connection with the credentials the source system issued:
{ "provider": "conneqtr", "label": "Conneqtr production", "credentials": { "method": "client_credentials", "client_id": "REPLACE_WITH_CLIENT_ID", "client_secret": "REPLACE_WITH_CLIENT_SECRET" }}POST /v1/account/connections stores the credentials encrypted and tests them. Dockt never returns credentials. The Connection’s access_status says whether Dockt can read the source: pending, ready, reconnect_required or failed. Its sites list the source’s sites, such as Conneqtr construction sites. GET /v1/connections lists the Account’s Connections with their status, access status and sites; GET /v1/account/connections/{id} shows one in full, with its sync frequency and last error.
| Operation | Call |
|---|---|
| Test access and refresh the sites | POST /v1/account/connections/{id}/test, optionally with new credentials |
| Rename, pause or resume, or change the sync frequency | PATCH /v1/account/connections/{id} with label, status (active or paused) or refresh_minutes (60, 360 or 1440) |
| Sync every bound site now | POST /v1/account/connections/{id}/sync |
| Disconnect | DELETE /v1/account/connections/{id} |
| Connect again after disconnecting | POST /v1/account/connections/{id}/test with new credentials |
Disconnecting removes the credentials and stops syncing. Bindings, Persons and files already taken in stay. To connect a disconnected Connection again, test it with new credentials: it returns to draft. Bind its sites again; the first bind resumes syncing. A draft Connection does not expire. Source credentials expire on a date you choose in the source system; replace them with POST /v1/account/connections/{id}/test before then.
Bind sites to Workplaces
Section titled “Bind sites to Workplaces”Bind a source site to the Workplace it feeds:
{ "workplace": { "external_ref": "plant-antwerp" }, "connection": { "id": "con_4Tq1" }, "site": { "id": "2f0c1d" }}POST /v1/source-bindingscreates the binding and starts the first sync right away.- A site feeds one Workplace at a time. Binding it again to the same Workplace re-enables it. A site bound to another Workplace is a conflict.
- Dockt then reads the site’s roster on the Connection’s schedule.
syncon the binding shows the status, the last success, the last error and the number of workers. POST /v1/source-bindings/{id}/syncsyncs one site now.DELETE /v1/source-bindings/{id}unbinds it; what was taken in stays.
Take workers in
Section titled “Take workers in”Syncing refreshes the roster. It does not create Persons, Companies, Assignments, or Documents until you select workers for intake. GET /v1/source-workers lists the workers on bound sites, filtered by binding, workplace, active or seen_on_site_since. A source can keep everyone ever registered for a site on its roster; seen_on_site_since narrows it to workers recorded on site on or after a date, and order_by=last_on_site lists the most recently present first. Each shows what the source records: name, date of birth, nationality, company, employment relationship, how many files it holds, and whether it records an identity number Dockt can match on.
Work follows the site. When a taken-in worker leaves the roster, their Assignment ends on the day they were last seen, and reopens if they return. Sources that record who is on site, such as Conneqtr’s check-ins, also end it once the worker has been away for the site’s on_site_months (a calendar month unless you set it otherwise): on their last day on site, or on its start if they have not been on site since. last_on_site on the source worker shows that day, and the next day on site reopens the Assignment.
Select workers with POST /v1/source-intakes:
{ "source_workers": [{ "id": "swr_8Kd2" }, { "id": "swr_9Lp0" }] }For each worker, Dockt takes in at the bound Workplace:
- The Person, matched on the identity number the source records. Dockt keeps that number only as a hash.
- Their employer as a Company, deduplicated by registration number as usual.
- An Assignment starting today.
- Their files, as Documents on the Person.
Values from a Connection have attribute source connection. The records it creates carry references in the provider’s namespace, such as conneqtr. Selecting a worker again after the source changed updates the same records. Selecting an unchanged worker returns its existing intake.
Each intake has a status: pending, completed or failed, with the Person and Assignment it created or matched. From then on, the Assignment behaves like any other: Dockt evaluates it and sends decision.created.
Intake never ends an Assignment. When a worker leaves the site, set the Assignment’s period.end.