Skip to main content

Overview

Tasks are the core work units in Xenia. Through a client key you can both read and write your workspace’s tasks: browse the grouped catalog, run a filtered/paginated list, fetch the full details of a single task, and create, edit, re-status or delete tasks. New tasks can be assigned to users, teams or locations, or to roles — the same targeting the web app offers — and can be created as recurring projects. See Assigning work.

Authentication & base URL

All requests go to https://api.xenia.team and every path starts with /api/v1. Authenticate with your client credentials (see Client Key Setup):
The workspace is derived from the key, so the {workspaceId} in each path must be your key’s own workspace. Always include the /workspaces/{workspaceId} segment — the unscoped task variants are not available to API keys (calling them returns 403). Each route also enforces the key user’s permission — reads require the key’s default-user role to grant access to the tasks/work-order surface, and writes require the permissions listed under Permissions.
Responses use Xenia’s standard envelope: a data payload plus a meta object. There is no status, statusCode, success, or requestId field, and successful POST calls return HTTP 200. Long queries are bounded by an ALB timeout of roughly 60 seconds, so narrow your filters/pagination on large workspaces.

Task Catalog

Return the grouped catalog of tasks with per-group counts — the same data that powers the Tasks board. Filters and pagination are supplied in the request body (every field is optional). Endpoint: POST /api/v1/ops/workspaces/{workspaceId}/tasks/catalog
Request Body (all optional): Response:

Task List

A flat, filtered, paginated list of tasks. Returns a total count plus the matching rows. Endpoint: POST /api/v1/ops/workspaces/{workspaceId}/tasks/list
Request Body (all optional):
Add ?count=true to the URL to run a count-only query; the response is then { "data": { "count": 45 }, "meta": {} }.
Response:

Task Details

Fetch the full detail object for a single task, including its assignees, location, asset, attached checklist/submission, and creator. Endpoint: GET /api/v1/ops/workspaces/{workspaceId}/tasks/{taskId}/details
Response:
The path parameter is the task ID. The details payload is a serialized task record with many associations (Creator, Finisher, Location, Asset, ServiceType, Checklist, ChecklistLog, TaskAssignees, time logs, work-order costs, and more). Which fields are present depends on the task type and what is set on the task.

Create a Task

Create one or more tasks. title is the only required field. Endpoint: POST /api/v1/ops/workspaces/{workspaceId}/tasks
Request Body:
Timestamps are parsed with the offset you send, so always include one (-04:00, Z, …). A dueTime in the past on a non-recurring task is adjusted forward rather than rejected. startDate is derived from startTime/dueTime and your workspace’s working hours — sending it has no effect.
Successful calls return HTTP 200 with the created task(s) in data and the message Task(s) Created.

Assigning work

assignees is a single array that accepts user ids, team ids and location ids interchangeably — Xenia resolves each id to the right kind of target. This mirrors the assignee picker in the web app. Role-based assignment uses a separate field, assigneesRoles, and the two are mutually exclusive: send assignees or assigneesRoles, never both.
Assign to users, teams and/or locations
Assign by role
Set "isMultiTasks": true to fan a single request out into one separate task per assignee rather than one shared task with several assignees. To resolve the ids these fields need, use the discovery endpoints:

Recurring projects

Setting "isProject": true creates a recurring project — a schedule that generates task instances over time — instead of a single task. Pass projectType as user, asset or role, and supply the matching target: assignees for user, assets for asset, assigneesRoles.roles for role. Projects require the Projects feature on your workspace. The response returns immediately while the schedule is generated in the background, so the project’s task instances appear shortly after the call succeeds. Once created, a project can be read, analysed, paused, resumed and ended over the API — see the Project Management guide.

Edit a Task

Endpoint: POST /api/v1/ops/workspaces/{workspaceId}/tasks/{taskId}/edit Send only the fields you want to change; the body accepts the same fields as create.

Change Task Status

Endpoint: PATCH /api/v1/ops/workspaces/{workspaceId}/tasks/{taskId}/status
Request Body:
This endpoint takes status, not taskStatus. taskStatus is the field name used when creating a task — sending it here will not change the status.
Archived tasks and not-yet-activated (planned) tasks reject status changes.Setting Completed on a task that requires a template submission returns 405 “Completion of template is required to finish this task” until the attached template has actually been submitted. Complete the submission first, then set the status.

Delete a Task

Endpoint: DELETE /api/v1/ops/workspaces/{workspaceId}/tasks/{taskId}
Deleting a task is not reversible through the API. Guard bulk scripts carefully — a loop over a task list can remove a lot of work in one pass.

Permissions

Each write route enforces the key’s default-user role (or the user named in x-client-user): The permission required depends on the kind of record, not on which one you happen to hold: holding Manage Tasks does not let you edit or delete a work order, and vice versa. Status changes carry one extra rule. Without Change Status of Others’ Tasks (or …Others’ Work Orders), a key can only re-status records it is assigned to — where “assigned” matches the key user’s own id, any of their teams, any of their locations, or their role. Grant the “others’” permission to the key’s default user if your integration needs to re-status work across the workspace. Creating a task also requires an active subscription and available capacity under your plan’s task limit.

What you can’t do via API key

These task operations exist in Xenia but are not reachable with a client key (they return 403 Forbidden: API key not authorized for this route). Use the web/mobile app or a signed-in user session for them:
  • Create a work order (/tasks/work-orders)
  • Bulk task updates and CSV export
  • Archive a recurring series
  • Claim, return or reassign an existing task’s assignees individually
  • Work-order costs
Assignees can still be set when you create a task, or replaced by editing it — only the per-assignee add/remove routes are closed. For reporting and export needs, use the read-only reporting surface instead.