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": "Only mobile numbers in Tanzania work here, and this one is from Kenya." }
  },
  "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.
401unauthenticatedNo token was sent.
401invalid_tokenThe token is wrong, expired or revoked.
403missing_permissionThe service account 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.
400invalid_idempotency_keyThe Idempotency-Key is empty, too long or has spaces.
409not_cancellableThe message or broadcast has already started sending.
409idempotency_key_in_useA request with this key is still being answered. Retry shortly.
422insufficient_smsThere aren't enough SMS to send it. Buy SMS.
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.