Skip to main content
POST
← Own Workforce API Record the trainings your employees received: what, when and for how many hours. Each training belongs to an employee, by the id that Create Workforce Employees (v2) answers. The request answers 201 Created with the trainings; nothing is calculated, so there is no job to follow.
Beta. Part of the bulk ingest API, currently in beta. The contract may still change before general availability.

How it works

Every record is checked. If any is invalid the whole request is rejected with 422 and nothing is written; the answer lists every invalid record, so you can fix them all at once. Otherwise the trainings are created at once. A training is not matched against the ones already stored: sending the same training twice creates it twice. To retry a request safely, repeat it with the same Idempotency-Key.

Request

Headers

string
required
Your API key (see Authentication).
string
required
Your organization. Its employees, and those of the organizations under it that you can write to, can take trainings; each training belongs to its employee’s organization.
string
required
1 to 255 characters, unique per batch. A retry with the same key and body answers the same trainings (with Idempotent-Replayed: true) instead of creating them again; the same key with another body is 422 IDEMPOTENCY_KEY_REUSED, and while the first request is still being processed 409 IDEMPOTENCY_KEY_IN_PROGRESS.

Query Parameters

boolean
default:"false"
Check only: the same 422 for invalid records, nothing written; 200 with {"dry_run": true, "submitted": n, "valid": n} when every record is valid.

Body Parameters

array[object]
required
The trainings to create, 1 to 1,000. A field not listed here is rejected (SCHEMA_INVALID).

Response

201 Created with items: one per record, in the order sent, with its source_row_index, client_row_id and the created training. Its id is the one Delete Workforce Trainings (v2) takes.

Errors

Problem details. Per-record codes in errors[].error_code of a 422 BULK_RECORDS_REJECTED: Request-level errors: 401 for a missing or invalid API key, 403 LOGGED_USER_NOT_MEMBER when the key’s user is not a member of the organization, 422 REQUEST_VALIDATION_FAILED for a malformed body (no records, more than 1,000, no Idempotency-Key), 422 IDEMPOTENCY_KEY_REUSED, 409 IDEMPOTENCY_KEY_IN_PROGRESS, and 429 beyond the rate limits.

Limits

Delete Workforce Trainings (v2)

Delete trainings by id

List Workforce Employees

The employees, and their ids

List Workforce Trainings

The trainings stored