Skip to content

Task Batches

API for bulk task assignment

Create a batch of tasks

Request

Assigns one form to many employees in a single call. The batch and its parameters are validated synchronously: the form, employer/client/job scope, and every employee id must resolve, or the whole request is rejected and nothing is created. Task creation itself happens asynchronously; poll GET /task_batches/:task_batch_id for progress and per-item outcomes.

Security
form_session or user_session or component_session or component_token or api_token
Bodyapplication/jsonrequired
form_idstring(FormId)required

Form Identifier (lineage uid)

employer_id(EmployerId (string) or null) or null
Any of:
Any of:

Employer Identifier

string(EmployerId)
client_id(ClientId (string) or null) or null
Any of:
Any of:

Client Identifier

string(ClientId)
job_id(JobId (string) or null) or null
Any of:
Any of:

Job Identifier

string(JobId)
expired_atDateTimeUtc (string) or null
Any of:

a string to be decoded into a DateTime.Utc

string(DateTimeUtc)
due_atDateTimeUtc (string) or null
Any of:

a string to be decoded into a DateTime.Utc

string(DateTimeUtc)
deletion_scheduled_atDateTimeUtc (string) or null
Any of:

a string to be decoded into a DateTime.Utc

string(DateTimeUtc)
deletion_allowed_atDateTimeUtc (string) or null
Any of:

a string to be decoded into a DateTime.Utc

string(DateTimeUtc)
employee_idsArray of strings, [ 1 .. 1000 ] items(maxItems(1000))required

an array of at most 1000 item(s)

allow_duplicateboolean

When false (the default), an item whose employee already has a matching non-expired task is reported as a failed item with error_code duplicate_task instead of creating a second task.

curl -i -X POST \
  https://docs.onboarded.com/_mock/openapi/api/v1/task_batches \
  -H 'Authorization: Bearer <YOUR_Onboarded form session token_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "form_id": "tlin_abc123def456",
    "employer_id": "er_abc123def456",
    "client_id": "cl_abc123def456",
    "job_id": "job_abc123def456",
    "expired_at": "string",
    "due_at": "string",
    "deletion_scheduled_at": "string",
    "deletion_allowed_at": "string",
    "employee_ids": [
      "ee_abc123def456"
    ],
    "allow_duplicate": true
  }'

Responses

TaskBatch

Bodyapplication/json
idstring(TaskBatchId)^tb_required

Task Batch Identifier

statusstringrequired
Enum:"processing""completed""completed_with_errors"
form_idstring(FormId)required

Form Identifier (lineage uid)

employer_idEmployerId (string) or nullrequired
Any of:

Employer Identifier

string(EmployerId)
client_idClientId (string) or nullrequired
Any of:

Client Identifier

string(ClientId)
job_idJobId (string) or nullrequired
Any of:

Job Identifier

string(JobId)
total_countnumberrequired
result_countsobjectrequired
itemsArray of objects(TaskBatchItem)required
_tagstringrequired
Value:"TaskBatch"
Response
{ "id": "tb_abc123def456", "status": "processing", "form_id": "tlin_abc123def456", "employer_id": "er_abc123def456", "client_id": "cl_abc123def456", "job_id": "job_abc123def456", "total_count": 0, "result_counts": { "pending": 0, "completed": 0, "failed": 0 }, "items": [ { … } ], "_tag": "TaskBatch" }