Errors

What a failed request returns, and how to handle it.

A request that fails answers with an HTTP error status and a JSON body that says what went wrong. Use code in your own logic: it stays the same, while message is written for people and may change.

{
  "status": 400,
  "code": "invalid",
  "message": "Some fields are invalid.",
  "fields": {
    "phone": { "code": "invalid", "message": "Unsupported mobile number." }
  },
  "requestId": "req_..."
}

fields appears when the request's data wasn't valid, with a message for each field. Every response, failed or not, has the same request ID in its X-Request-Id header. Include it when you contact us.

Common codes

StatusCodeWhat it means
400invalidSome data isn't valid; see fields.
400invalid_jsonThe body isn't one valid JSON object, or has a field the endpoint doesn't take.
400invalid_cursorThe cursor isn't one a list gave you. Start from the first page.
400invalid_limitlimit isn't a whole number from 1.
400invalid_status, invalid_channel, invalid_period, invalid_testA filter has a value the list doesn't know.
400invalid_api_versionGoomzo-Version isn't a version of the API.
400invalid_idempotency_keyThe Idempotency-Key is too long or has spaces.
401unauthenticatedNo secret was sent.
401invalid_tokenThe secret is wrong, expired or revoked.
403missing_permissionThe API key doesn't have the permission this request needs.
403not_for_service_accountsThis endpoint is only for people signed in to Goomzo.
404not_foundThe customer, segment or message doesn't exist.
404route_not_foundThere's no such endpoint. Check the path.
405method_not_allowedThe endpoint doesn't take this method.
409not_cancellableThe message or broadcast has already started sending.
409name_in_useAnother segment already has this name.
409segment_limitYou already have 500 segments, or this would take you past them.
409segment_fills_itselfThe segment is automatic: its rules decide who's in it.
409segment_in_useAnother segment's rules use this segment, so it can't be deleted yet.
409rule_segment_limitYou already have 50 automatic segments.
409channel_unavailableSending by this channel isn't set up yet.
409too_many_endpointsYou already have 10 webhook endpoints.
409endpoint_disabledThe webhook endpoint is turned off, so it can't be sent events.
409idempotency_key_in_useA request with this key is still being answered. Retry shortly.
413body_too_largeThe request body is too large.
422insufficient_smsThere aren't enough SMS to send it; needed and available say how many. SMS bundles.
422too_many_to_exportMore than 50,000 customers match. Search or filter to export fewer.
422rules_too_slowA segment's rules took too long to work out. Use fewer or simpler conditions.
422idempotency_key_reusedThis key was used for a different request. Use a new key.
429rate_limitedToo many requests. Wait Retry-After seconds. Rate limits.
500internalSomething went wrong on our side. Try again later.

Token errors

The token endpoint, /v1/oauth/token, answers in the OAuth format instead, with status 400:

{ "error": "invalid_grant", "error_description": "..." }

error is invalid_request, unsupported_grant_type or invalid_grant.

Last updated