Invalid request (400, 422)
The request was understood but something in it is not acceptable.
type: https://officehero.io/errors/validation
When you get it
400— theOH-Versionheader is malformed or names a version that does not exist (errors.integrations.unsupported_version).422— a body field is missing or has the wrong type or format;fieldanderrors[]say which.422— an id in the path is not a UUID (errors.common.validation.invalid_input), or acursor/sincevalue cannot be read.422— a body refers to something that does not exist in your company, e.g. an unknowncustomer_id(errors.common.validation.invalid_reference).422— a member the operation does not take:errors[].code=unknown_field(detail_keyerrors.common.validation.failedon webhook endpoints,errors.integrations.invoices.validation_failedon invoices — creating and changing alike).422— the operation is not allowed in the resource's current state, e.g. changing an invoice that is no longer a draft, or voiding a draft (errors.finance.validation.invalid_invoice_status_for_void).
What to do
Do not retry unchanged. Read detail_key (and field / errors when present), correct the request and send it again.
detail_key values
detail_key | Status | English detail |
|---|---|---|
errors.common.validation.failed | 422 | Some of the values you sent are not valid. Correct the fields marked with an error and send the form again. |
errors.common.validation.invalid_input | 422 | That request wasn't valid — check the values you sent and try again. |
errors.common.validation.invalid_reference | 422 | That references something that doesn't exist, or that you can't see. |
errors.finance.validation.currency_not_enabled | 422 | That currency is not enabled for your organisation — enable it in currency settings or pick another. |
errors.finance.validation.invalid_invoice_status_for_void | 422 | This invoice can no longer be voided in its current status |
errors.integrations.bills.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.deliveries.invalid_since | 422 | The since parameter must be a valid ISO-8601 timestamp. |
errors.integrations.documents.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.employees.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.fuel_logs.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.invoices.create_failed | 422 | The invoice could not be created. |
errors.integrations.invoices.invalid_body | 422 | This request could not be read. It must be valid JSON: an object or a list, no more than 63 levels deep and no larger than 2 MiB. |
errors.integrations.invoices.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.invoices.line_invalid | 422 | One or more invoice lines are invalid. |
errors.integrations.invoices.no_writable_fields | 422 | No writable fields were provided. |
errors.integrations.invoices.required | 422 | A required field is missing: {field}. |
errors.integrations.invoices.update_failed | 422 | The invoice could not be updated. |
errors.integrations.invoices.validation_failed | 422 | The invoice failed validation. |
errors.integrations.invoices.void_failed | 422 | The invoice could not be voided. |
errors.integrations.leave_requests.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.payments.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.purchase_orders.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.tickets.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.timesheets.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.unsupported_version | 400 | The requested OH-Version is not supported. |
errors.integrations.vehicles.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |
errors.integrations.webhooks.event_types_required | 422 | At least one event type is required. |
errors.integrations.webhooks.invalid_body | 422 | The webhook could not be saved. Give it a name, the address to call, and at least one event type. |
errors.integrations.webhooks.invalid_pinned_version | 422 | The pinned OH-Version is not a supported version. |
errors.integrations.webhooks.required | 422 | A required field is missing: {field}. |
errors.integrations.webhooks.unknown_event_type | 422 | One or more event types are not in the event catalog. |
errors.integrations.webhooks.url_not_publicly_routable | 422 | The webhook URL must be publicly routable (no private, loopback, or link-local addresses). |
errors.integrations.work_orders.invalid_cursor | 422 | The pagination cursor is invalid or malformed. |