API returning 500 on nested custom field expansion

Getting consistent 500s when trying to expand custom fields on /work_orders. Request works fine without expansion.

GET /v1/work_orders?expand=custom_fields.customer_preferences&limit=50

Response:

HTTP/1.1 500 Internal Server Error
{"error": "internal_server_error", "request_id": "req_7a8f9e2d1c4b"}

Works:

GET /v1/work_orders?expand=assignee,customer&limit=50

Same behavior on jobs endpoint. Custom fields exist and are populated in UI.

req_7a8f9e2d1c4b, req_8b3c0a5f2e9d, req_9d1e4f7a3b8c — all from last 2 hours.

Parents
  • Hey Carlos — yeah this one tripped me up too when I first looked at it. The expansion syntax changed slightly in v1.2 and the error message is... not helpful.

    The issue is that custom_fields isn't a relationship you can traverse with dot notation. It's a flat object on the work order itself. Try:

    GET /v1/work_orders?expand=custom_fields&limit=50

    That'll give you the full custom_fields blob with all values. If you need specific field filtering, that's a separate custom_field_ids query param (undocumented, I know — we're fixing that).

    The 500 is a bug on our end — should be 400 with a clear message. Filed ts-034 to track.

    Re: your failing requests — I can see those in the logs. The parser is choking on the dot notation and falling through to a generic error handler. Working on a fix for next deploy.

  • Confirmed — expand=custom_fields works. Returns everything though, which is heavy.

    custom_field_ids param — what's the format? comma-separated? array syntax?

Reply Children
No Data