Docs menu

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 — the OH-Version header 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; field and errors[] say which.
  • 422 — an id in the path is not a UUID (errors.common.validation.invalid_input), or a cursor / since value cannot be read.
  • 422 — a body refers to something that does not exist in your company, e.g. an unknown customer_id (errors.common.validation.invalid_reference).
  • 422 — a member the operation does not take: errors[].code = unknown_field (detail_key errors.common.validation.failed on webhook endpoints, errors.integrations.invoices.validation_failed on 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_keyStatusEnglish detail
errors.common.validation.failed422Some of the values you sent are not valid. Correct the fields marked with an error and send the form again.
errors.common.validation.invalid_input422That request wasn't valid — check the values you sent and try again.
errors.common.validation.invalid_reference422That references something that doesn't exist, or that you can't see.
errors.finance.validation.currency_not_enabled422That currency is not enabled for your organisation — enable it in currency settings or pick another.
errors.finance.validation.invalid_invoice_status_for_void422This invoice can no longer be voided in its current status
errors.integrations.bills.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.deliveries.invalid_since422The since parameter must be a valid ISO-8601 timestamp.
errors.integrations.documents.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.employees.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.fuel_logs.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.invoices.create_failed422The invoice could not be created.
errors.integrations.invoices.invalid_body422This 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_cursor422The pagination cursor is invalid or malformed.
errors.integrations.invoices.line_invalid422One or more invoice lines are invalid.
errors.integrations.invoices.no_writable_fields422No writable fields were provided.
errors.integrations.invoices.required422A required field is missing: {field}.
errors.integrations.invoices.update_failed422The invoice could not be updated.
errors.integrations.invoices.validation_failed422The invoice failed validation.
errors.integrations.invoices.void_failed422The invoice could not be voided.
errors.integrations.leave_requests.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.payments.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.purchase_orders.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.tickets.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.timesheets.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.unsupported_version400The requested OH-Version is not supported.
errors.integrations.vehicles.invalid_cursor422The pagination cursor is invalid or malformed.
errors.integrations.webhooks.event_types_required422At least one event type is required.
errors.integrations.webhooks.invalid_body422The webhook could not be saved. Give it a name, the address to call, and at least one event type.
errors.integrations.webhooks.invalid_pinned_version422The pinned OH-Version is not a supported version.
errors.integrations.webhooks.required422A required field is missing: {field}.
errors.integrations.webhooks.unknown_event_type422One or more event types are not in the event catalog.
errors.integrations.webhooks.url_not_publicly_routable422The webhook URL must be publicly routable (no private, loopback, or link-local addresses).
errors.integrations.work_orders.invalid_cursor422The pagination cursor is invalid or malformed.

All error types and keys →