Skip to content

Complete a compliance task

The tasks.complete operation: POST /api/v1/tasks/{id}/complete in the REST API and the tasks_complete tool in the MCP server.

POST/api/v1/tasks/{id}/complete

Completes a work task with what was done: reference numbers (references), when it was submitted (submittedAt), receipt files already uploaded (files, file_…) and notes. The task becomes done.

For tasks whose completion changes a registration or a filing period (registration.submit, registration.confirm, deregistration.submit, filing.submit, filing.pay: the task's completeWith is tasks.submit), use tasks.submit (task_submit_required). A filing.prepare task finishes by itself once its period is prepared (task_not_ready before); a prerequisite task when the prerequisite is marked done.

While someone holds the task's lease, only they can complete it (task_claimed).

At a glance

  • REST: POST /api/v1/tasks/{id}/complete
  • MCP tool: tasks_complete
  • Operation ID: tasks.complete
  • Scope: Organization, or one of its legal entities or brands
  • Permission: tasks:write
  • Risk tier: write
  • Dry run: Supported (send Ownrecord-Dry-Run: true)
  • Idempotency: Idempotency-Key required
  • Modes: Test and live
  • Authentication: API key with the tasks:write scope
  • Since: M7

Request

Path parameters

FieldTypeDescription
idtask_… ID

Body

A JSON object (Content-Type: application/json):

FieldTypeRequiredDescription
outputsobjectNo
outputs.referencesobjectNo
outputs.submittedAtdate-timeNo
outputs.filesarray of file_… IDNo
outputs.notesstringNo
expectedVersioninteger (at least 1)No

Response

200 OK with a JSON object:

FieldTypeDescription
idtask_… ID
object"task"
typeone of 12 values, e.g. registration.prerequisites, registration.prepare, registration.submit (all in the OpenAPI document)
entityIdent_… ID
livemodeboolean
regimeIdstring or null
registrationIdregn_… ID or null
filingPeriodIdfp_… ID or null
prerequisiteCodestring or null
titlestring
descriptionstring or null
priorityone of low, normal, high, urgent
statusone of open, claimed, in_progress, awaiting_approval, done, failed, cancelled
reasonone of 11 values, e.g. auto_blocked, existing_customer_sale, prerequisite_open (all in the OpenAPI document) or null
dueAtdate-time or null
overdueboolean
assigneeobject or null
claimedUntildate-time or null
leaseActiveboolean
completeWithone of tasks.complete, tasks.submit
needsAuthorizationboolean
inputsarray of object
inputs[].kindstring
inputs[].fileIdfile_… ID or null
inputs[].dataobject or null
outputsobject or null
authorizationIdatz_… ID or null
approvalRequestIdapr_… ID or null
failureobject or null
checklistarray of object
checklist[].textstring
checklist[].doneboolean
createdAtdate-time
updatedAtdate-time
completedAtdate-time or null
completedBystring or null
versioninteger (at least 1)

Examples

The registration was prepared

HTTP
POST /api/v1/tasks/task_01m4ttwd3veh9apbewxheq5xaf/complete
Authorization: Bearer or_test_…
Idempotency-Key: 3f1c9a52-7d0e-4b8f-9a61-0c2d5e8b7f14
Content-Type: application/json

{
  "outputs": {
    "notes": "Packet reviewed; the contact person is our tax manager, Ana Horvat."
  }
}

Response (200):

JSON
{
  "id": "task_01m4ttwd3veh9apbewxheq5xaf",
  "object": "task",
  "type": "registration.prepare",
  "entityId": "ent_01m4ttwd3veh9apbewxheq5xh4",
  "livemode": true,
  "regimeId": "EU_OSS_NON_UNION",
  "registrationId": "regn_01m4ttwd3veh9apbewxheq5xag",
  "filingPeriodId": null,
  "prerequisiteCode": null,
  "title": "Prepare the EU One-Stop Shop, non-Union scheme registration",
  "description": "Customers tried to buy in EU One-Stop Shop, non-Union scheme, where consumer sales are blocked until the entity registers. Prepare the registration: check the prerequisites, the registration packet and the authorization of whoever will act for the entity. Complete this task when the application is ready.",
  "priority": "low",
  "status": "done",
  "reason": "blocked_with_demand",
  "dueAt": null,
  "overdue": false,
  "assignee": null,
  "claimedUntil": null,
  "leaseActive": false,
  "completeWith": "tasks.complete",
  "needsAuthorization": false,
  "inputs": [
    {
      "kind": "registration",
      "fileId": null,
      "data": {
        "registrationId": "regn_01m4ttwd3veh9apbewxheq5xag",
        "regimeId": "EU_OSS_NON_UNION",
        "jurisdictionIds": ["EU"],
        "state": "blocked_b2c",
        "stateReason": "grace_deadline_missed",
        "triggeredAt": "2026-10-14T09:00:00.000Z",
        "deadlineAt": "2026-11-10T22:59:59.000Z"
      }
    },
    {
      "kind": "registration_packet",
      "fileId": null,
      "data": {
        "registrationId": "regn_01m4ttwd3veh9apbewxheq5xag",
        "regimeId": "EU_OSS_NON_UNION"
      }
    },
    {
      "kind": "playbook",
      "fileId": null,
      "data": {
        "regimeId": "EU_OSS_NON_UNION",
        "playbookKind": "registration"
      }
    }
  ],
  "outputs": {
    "references": {},
    "submittedAt": null,
    "files": [],
    "notes": "Packet reviewed; the contact person is our tax manager, Ana Horvat."
  },
  "authorizationId": null,
  "approvalRequestId": null,
  "failure": null,
  "checklist": [
    {
      "text": "Check the prerequisites and read the playbook",
      "done": true
    },
    {
      "text": "Submit the registration application to the authority",
      "done": false
    },
    {
      "text": "Submit this task with the receipt and the authorization",
      "done": false
    },
    {
      "text": "Confirm the registration when the number arrives",
      "done": false
    }
  ],
  "createdAt": "2026-11-07T00:07:00.000Z",
  "updatedAt": "2026-11-08T09:15:00.000Z",
  "completedAt": "2026-11-08T09:15:00.000Z",
  "completedBy": "usr_01m4ttwd3veh9apbewxheq5xh6",
  "version": 2
}

Errors

CodeHTTP statusWhenWhat to do
validation_failed400An output is malformed or too long.Fix the fields listed in details.issues and send the request again.
resource_not_found404No task with this ID in this organization, entity and mode.Check the ID and that your credentials are scoped to the right organization, entity, brand and mode.
task_status_invalid409The task is finished, or it waits for an approval.Reload the task: finished tasks (done, failed, cancelled) don't change, and a task waiting for an approval changes only through that approval. details.status is the task's status.
task_claimed409Someone else holds the task's lease.Work on another task (tasks.list with claimable: true), or try again after details.claimedUntil: an expired lease frees the task. details.assignee is who holds it.
task_submit_required400The task changes a registration or filing period: submit it with tasks.submit.Call tasks.submit with the task's outputs (and an authorization for *.submit tasks). It is a compliance-tier operation, so your approval policy may ask a person to approve it first.
task_not_ready409A filing.prepare task's period isn't prepared yet.Read details: for example, prepare the filing period (lock it, then filing_periods.prepare) before completing filing.prepare, which then finishes by itself.
task_output_file_not_found400A receipt file doesn't exist for this organization and mode.Upload the receipt to the task first (tasks.documents.upload) and pass its file_… ID, or record the receipt number as a reference instead. details.fileId is the ID that wasn't found.
version_conflict409The task changed since expectedVersion, or at the same moment.Fetch the object again and retry the change.
permission_denied403You can't work on compliance tasks here.Ask an organization owner or admin for a role or scope that allows this action.

It can also return these common errors: api_version_unsupported, invalid_json, unsupported_media_type, authentication_required, api_key_invalid, idempotency_key_required, idempotency_key_reused, idempotency_in_progress, approval_required, approval_rejected, approval_expired, stale_approval, approval_policy_denied, rate_limited, internal_error.