DUET PlatformDocs
API referenceInbound sync

Sync work orders

available
POST
/integrations/v1/work-orders/sync

Creates or updates up to 200 work orders from your system. external_id is the idempotency key. The first call with an external_id creates the work order and sends workorder.synced. Later calls with the same external_id update it. DUET reads issue_id and title only when it creates the work order. DUET stores status as you send it, and a status of complete sends workorder.completed. DUET doesn't deliver changes that you write here back to your own subscription.

Authorization

Bearer
headerAuthorizationBearer <token>

Header Parameters

x-duet-signature*string

The signature, in the form t=<Unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">. Sign it with your subscription secret. DUET rejects the call when t differs from DUET's clock by more than 300 seconds.

Request Body

application/json
  1. body
organization_id*string
Length1 <= length
project_id*string
Length1 <= length
delivery_id*string

An ID that is unique to the call. DUET treats a repeated delivery_id within 15 minutes as already applied.

Length1 <= length <= 200
external_system*string

The name of your integration. DUET stores it on each work order.

Length1 <= length <= 100
work_orders*array<>
Items1 <= items <= 200

Response Body

DUET applied the call, or had already applied it (duplicate is true).

application/json
  1. response
ok*true
Value intrue
applied*integer

The number of items that DUET created or updated.

results*array<>

The outcome for each item. DUET applies each item independently, so an unknown ID doesn't fail the whole call.

duplicate?boolean

Whether DUET already applied a call with this delivery_id. When true, DUET changes nothing and the call still succeeds.

Example Request
curl -X POST 'https://api.enurgen.com/integrations/v1/work-orders/sync' \  -H 'x-duet-signature: string' \  -H 'Content-Type: application/json' \  -d '{  "organization_id": "string",  "project_id": "string",  "delivery_id": "string",  "external_system": "string",  "work_orders": [    {      "external_id": "string"    }  ]}'
Example Response
{  "ok": true,  "applied": 0,  "results": [    {      "external_id": "string",      "issue_id": "string",      "status": "created",      "reason": "string"    }  ],  "duplicate": true}