Skip to content
WorkRoad home
REST API

Create several tasks

POST
/tasks/batch

Creates up to 50 tasks in one call, each with the fields POST /tasks takes, and answers 200 with a result per task in the order sent: created with the task, or rejected with the error POST /tasks would have returned for it. Each task is created or refused on its own, so fix the rejected ones and send only those again. A subject or task type the first task creates is there for the ones after it. type is the kind of work and must be one of the user's task types (GET /task-types); the course or module is the subject, sent as subjectId or subjectName. List the subjects and types first, and create a missing subject (or ask the user) rather than putting its name in another field. An exam or in-class test is type Test, with its day as dueDate and the topics and start time in the description.

Use this to save content you wrote yourself. It uses none of the user's WorkRoad AI uses.

Required scopes: tasks:create

Authorization

headerAuthorizationBearer <token>

Header Parameters

Idempotency-Key?string

A client-generated key (1 to 255 visible ASCII characters) that makes this POST safe to retry. A retry with the same key and body replays the original response; the same key with a different body returns 409 idempotency_conflict. Stored for 24 hours.

Match^[\x21-\x7E]{1,255}$
Length1 <= length <= 255

Request Body

application/json
  1. body
tasks*array<>

1-50 tasks, each with the fields POST /tasks takes. Each is created or refused on its own.

Items1 <= items <= 50

Response Body

OK

application/json
  1. response
data*
Example Request
curl -X POST 'https://workroad.app/api/v1/tasks/batch' \  -H 'Authorization: Bearer $WORKROAD_API_KEY' \  -H 'Content-Type: application/json' \  -d '{  "tasks": [    {      "name": "string"    }  ]}'
Example Response
{  "data": {    "createdCount": 1,    "rejectedCount": 1,    "results": [      {        "index": 0,        "status": "created",        "task": {          "id": "4d3c2b1a-0f9e-4d8c-9b7a-6f5e4d3c2b1a",          "name": "Finish lab report",          "description": "Include the error analysis.",          "type": "Generic",          "subjectId": "5f0c1d2e-3a4b-4c5d-8e6f-7a8b9c0d1e2f",          "dueDate": "2026-02-10T17:00:00.000Z",          "completed": false,          "priority": "high",          "parentId": null,          "createdAt": "2026-01-15T09:30:00.000Z",          "updatedAt": "2026-02-01T12:00:00.000Z"        }      },      {        "index": 1,        "status": "rejected",        "error": {          "status": 400,          "code": "invalid_request",          "message": "\"Software Engineering\" is not one of the user's task types: \"Generic\", \"Homework\", \"Test\". A task type is the kind of work; a course or module is the subject, so send it as subjectId or subjectName. An exam or test is \"Test\". To add a new type, send createType: true.",          "details": {            "field": "type",            "reason": "unknown-task-type",            "taskTypes": [              "Generic",              "Homework",              "Test"            ]          }        }      }    ]  }}