Create work order and assign technician in single API call?

Hey folks — working on an integration where we're creating work orders from an external scheduling system. Right now I'm making two calls: POST to /work_orders to create, then PATCH to update the assignee_id.

Wondering if there's a way to do this in one shot? I tried including assignee_id in the POST body but got a 422 with "assignee cannot be set during creation."

Is this a hard limitation or am I missing something in the payload structure? Would be nice to cut the round-trip latency here.

cc similar OAuth question for context on how I'm authenticating these calls.

Parents
  • Hey Devon — yeah this trips people up. The short answer is Leo's right: standard POST doesn't support it, but the bulk endpoint does let you bundle operations.

    Here's what that looks like:

    POST /v1/work_orders/bulk
    {
      "operations": [
        {
          "method": "POST",
          "path": "/work_orders",
          "body": {
            "title": "HVAC Maintenance",
            "customer_id": "cust_abc123"
          }
        },
        {
          "method": "PATCH",
          "path": "/work_orders/{id_from_first_response}",
          "body": {
            "assignee_id": "usr_def456"
          }
        }
      ]
    }

    It's technically still two operations, but single HTTP round-trip. The responses come back in order so you can correlate.

    Heads up: bulk endpoint has different rate limits — 10 ops per request, 100 requests/minute vs the standard 1000/min for individual calls. YMMV depending on your volume.

    There's also a webhook work_order.created you could listen for and assign reactively, but that adds complexity vs. just accepting the two-step flow.

    I've flagged this with the API team — nested resource creation on POST comes up a lot. No committed timeline but it's on the radar.

Reply
  • Hey Devon — yeah this trips people up. The short answer is Leo's right: standard POST doesn't support it, but the bulk endpoint does let you bundle operations.

    Here's what that looks like:

    POST /v1/work_orders/bulk
    {
      "operations": [
        {
          "method": "POST",
          "path": "/work_orders",
          "body": {
            "title": "HVAC Maintenance",
            "customer_id": "cust_abc123"
          }
        },
        {
          "method": "PATCH",
          "path": "/work_orders/{id_from_first_response}",
          "body": {
            "assignee_id": "usr_def456"
          }
        }
      ]
    }

    It's technically still two operations, but single HTTP round-trip. The responses come back in order so you can correlate.

    Heads up: bulk endpoint has different rate limits — 10 ops per request, 100 requests/minute vs the standard 1000/min for individual calls. YMMV depending on your volume.

    There's also a webhook work_order.created you could listen for and assign reactively, but that adds complexity vs. just accepting the two-step flow.

    I've flagged this with the API team — nested resource creation on POST comes up a lot. No committed timeline but it's on the radar.

Children