Skip to main content
POST
← Own Workforce API Delete trainings by id. The request checks every id and answers 202 Accepted with an ingest job that deletes them in the background. Follow it with GET /v2/ingest-jobs/{id} or the ingest_job.finished webhook. The ids are the ones Create Workforce Trainings (v2) answers, or the ids of List Workforce Trainings. Deleting an employee deletes its trainings too.
Permanent. Deleted trainings cannot be recovered. Use dry_run=true first if you are not sure.
Beta. Part of the bulk ingest API, currently in beta. The contract may still change before general availability.

How it works

  1. The request checks every id. One that does not exist, belongs to an employee outside your organization’s perimeter or is repeated rejects the whole request with 422, and nothing is deleted.
  2. The job deletes them in the background, with their custom column values.
  3. When every chunk is done the job is completed (or completed_with_errors), and ingest_job.finished is sent with "operation": "delete".

Request

Headers

string
required
Your API key (see Authentication).
string
required
Your organization. The trainings of its employees, and of those of the organizations under it that you can write to, can be deleted.
string
required
1 to 255 characters, unique per batch. A retry with the same key and body returns the original job (with Idempotent-Replayed: true); 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 bad ids, nothing deleted, no job; 200 with {"dry_run": true, "submitted": n, "valid": n} when every id is valid.

Body Parameters

array[uuid]
required
Training ids, 1 to 5,000, each once.

Response

202 Accepted with the job (entity_type: own_workforce_trainings, operation: delete) and a Location header to it. GET /v2/ingest-jobs/{id}/items has one item per training, in the order sent; an item is failed with DELETE_FAILED when its training was already gone by the time the job reached it.

Errors

Problem details. Per-id codes in errors[].error_code of a 422 BULK_RECORDS_REJECTED (source_row_index is the position in ids): 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 ids, more than 5,000, no Idempotency-Key), 422 IDEMPOTENCY_KEY_REUSED, 409 IDEMPOTENCY_KEY_IN_PROGRESS, and 429 beyond the rate limits.

Limits

Create Workforce Trainings (v2)

Create trainings in bulk

List Workforce Trainings

Find the ids to delete

Get Ingest Job

Follow the deletion

List Job Items

The outcome of each id