REST Custom Object: Request Body Is Array, Not Object
The error HTTP 400 Bad Request VALIDATION_ERROR: Expected a JSON object but received a JSON array
What it means
The custom object endpoint expects a JSON object (starting with {}) but got an array (starting with []). Workday rejects the body immediately without processing any data. This is common when coming from a SOAP background where XML children feel naturally list-like.
Troubleshooting
- Check the first character of your request body - { is an object, [ is an array. The outer wrapper must be {}.
- Each field should be a key-value pair inside {}, not an element inside [].
- Reference fields like worker must also be objects: {"id": "..."} not ["..."].
- Do a GET on the same endpoint for an existing record and use that response structure as your PUT or POST template.
⚡ Quick fix
Change the outer wrapper from [...] to {...} and confirm all reference fields follow the {"id": "value"} pattern, then re-run.
✓ Permanent fix
Before writing the PUT or POST, do a GET on the custom object endpoint for a known record and mirror that exact JSON structure in your outbound payload. Validate request bodies against the schema before the call.
Was this helpful?