oqimDocs
API referenceConsole

Start here

  • Introduction
  • Getting started

Guides

  • Telegram accounts
  • Recipients
  • Campaigns
  • Scheduling
  • Webhooks
  • AI writing assistant

AI Seller

  • AI Seller
  • Channels
  • Live inbox
  • Past conversations and privacy
  • Business insights

API

  • Authentication
  • API reference
  • SDK
  • Errors
  • Rate limits

Trust and operations

  • Security
  • Compliance
  • Administration
Docs / Errors

Start here

  • Introduction
  • Getting started

Guides

  • Telegram accounts
  • Recipients
  • Campaigns
  • Scheduling
  • Webhooks
  • AI writing assistant

AI Seller

  • AI Seller
  • Channels
  • Live inbox
  • Past conversations and privacy
  • Business insights

API

  • Authentication
  • API reference
  • SDK
  • Errors
  • Rate limits

Trust and operations

  • Security
  • Compliance
  • Administration

Errors

Every error response has the same shape, a stable machine-readable code and a fitting HTTP status. Branch on the code; show the message to people.

Error envelope#

422 Unprocessable Entity
{
  "error": {
    "code": "validation_failed",
    "message": "Some fields need attention.",
    "details": {
      "email": "Enter a valid email address.",
      "password": "Use at least 10 characters."
    }
  }
}
  • code is stable; build logic on it.
  • message is a sentence written for people. It may change, so don't parse it.
  • details appears with validation_failed only, keyed by request field.
  • The X-Request-Id response header names the request in the API's logs. Quote it when you report a problem.

Error codes#

CodeStatusMeaning
validation_failed422One or more fields are invalid. details maps each field to a message.
invalid_json400The body is empty or isn't valid JSON.
invalid_upload400An upload couldn't be read. Send multipart/form-data with the file in a field named file.
unauthenticated401No session cookie or bearer credential was sent.
invalid_credentials401Wrong email or password, or an API key or access token that is invalid, expired or revoked.
mfa_required401The session hasn't completed two-factor verification. Post a code to /auth/mfa/verify.
forbidden403Your role lacks the permission this needs; the message names it. Also returned by the administration API to anyone who isn't a platform administrator.
organization_suspended403The organization is suspended. Reads still work; changes and messaging don't.
policy_not_accepted403The organization hasn't accepted the current acceptable-use policy, which connecting accounts, launching and resuming require.
plan_limit_reached403The plan's limit on accounts, active campaigns, members or webhooks is reached, or the plan has no API access. The message says which.
origin_rejected403A cookie-authenticated change came from an origin not in ALLOWED_ORIGINS. Bearer requests never get this.
not_found404The resource doesn't exist, or belongs to another organization. The two cases are indistinguishable on purpose.
route_not_found404There's no such endpoint. Check the method and path.
conflict409The change conflicts with an existing record, such as a duplicate list name.
invalid_state409The object's status doesn't allow this, or changed a moment ago. Reload it and try again.
file_too_large413An upload is over its limit: 20 MB for attachments (10 MB for photos), 10 MB for imports.
unsupported_media_type415An import was neither multipart/form-data nor JSON.
rate_limited429Too many requests. Wait for the number of seconds in Retry-After.
internal_error500Something failed on Oqim's side. It was logged; retrying a read is safe.
maintenance_mode503The platform owner has put Oqim in maintenance. Reads still work; every change is refused until it ends. Signing in and out, two-factor verification and recipient opt-outs are never refused. Retry after the number of seconds in Retry-After.
support_read_only403The session is a platform administrator's support session in this organization, which is read-only: it can look, and every write is refused. Ending it, or signing out, is the only write allowed.
support_session403A support session tried to use the platform administration API. A support session belongs to the customer console and is never a way into the platform console.
not_in_support_session409Ending a support session was asked of a session that isn't one.
queue_not_found404Administration API: no queue has that name.
queue_not_started409Administration API: the queue hasn't received a task yet, so there is nothing in it to pause, resume or repair.
task_not_found404Administration API: no such task in the queue. It may have finished or been removed since the list loaded.
task_not_retryable409Administration API: only archived, retrying or scheduled tasks can be retried.
task_active409Administration API: the task is running right now and can't be dropped. Wait for it to finish, or pause the queue first.

Campaigns

CodeStatusMeaning
campaign_invalid422A pre-launch check failed. The report is in validation; see below.
campaign_not_draft409Only drafts can be launched or deleted.
field_locked409A field can't change in the campaign's current status; the message lists the locked fields.
campaign_locked409The campaign has finished and can't be edited.
campaign_ended409The end time has passed. Move end_at later before resuming.
no_active_accounts409None of the campaign's accounts can send; the message names them and why.
paused_by_admin409A platform administrator paused the campaign; the organization can't resume it.
not_paused_by_admin409Administration API: only campaigns a platform administrator paused can be resumed there.
not_repeating409Stop repeating was called on a campaign that has no repeat rule and isn't part of a series.

Telegram accounts and proxies

CodeStatusMeaning
restriction_not_acknowledged409Resuming a restricted account needs acknowledge_restriction: true.
person_required403A restricted account can only be resumed by a signed-in person, not an API key.
reauth_required409The account needs to sign in again; use reauth rather than resume.
disabled_by_admin409A platform administrator disabled the account.
not_disabled_by_admin409Administration API: only accounts a platform administrator disabled can be restored there.
test_limit_reached429The organization sent 20 test messages this hour, or the account 10. Launch a campaign to reach more people.
recipient_suppressed422A test message's recipient is on the suppression list.
account_in_use409The account is in a running campaign, so it can't be removed.
proxy_in_use409The proxy is already assigned to another account.
proxy_disabled409A platform administrator disabled the proxy, so it can't be checked, changed or deleted, and its address can't be added again.
gateway_unavailable502The worker that talks to Telegram can't be reached.

Recipients

CodeStatusMeaning
recipient_exists409A recipient with this Telegram ID or username already exists.
recipient_opted_out409The recipient opted out; their consent can't be changed.
recipient_busy409A message to this recipient is being sent right now. Try again in a minute.
already_suppressed409This Telegram ID or username is already on the suppression list.
invalid_link404An opt-out link is altered or incomplete.

Team, keys and webhooks

CodeStatusMeaning
last_owner409An organization needs at least one owner.
already_member409The person you invited is already a member.
invitation_accepted409The invitation was accepted, so it can't be revoked. Remove the member instead.
invalid_invitation404The invitation link isn't valid.
invitation_usedinvitation_revokedinvitation_expired410The invitation can no longer be used. Ask for a new one.
sign_in_required401The invitation is for an existing user; sign in as them to accept it.
key_inactive409A revoked or expired API key can't be rotated. Create a new one.
webhook_disabled409Enable the webhook before sending a test event.

Sign-in and profile

CodeStatusMeaning
no_organization403The session has no active organization. Switch to one or create one.
signups_closed403Sign-ups are turned off on this deployment. Ask for an invitation.
user_disabled403This user was disabled by a platform administrator.
unsupported_grant_type400POST /auth/token accepts grant_type api_key only.
not_applicable400The endpoint is for people and an API key called it, for example the two-factor endpoints.
mfa_enrollment_required403Platform administrators must turn on two-factor authentication to use the admin console.
mfa_setup_requiredmfa_not_enabled400Call POST /me/mfa/setup first, or two-factor authentication isn't on.
mfa_already_enabled409Two-factor authentication is already on.

Campaign validation errors#

When a launch fails its pre-launch checks, the response carries the whole report next to the error, warnings included. The same report is saved on the campaign as validation.

422 Unprocessable Entity
{
  "error": {
    "code": "campaign_invalid",
    "message": "Fix the failed checks before launching."
  },
  "validation": {
    "ok": false,
    "checked_at": "2026-09-29T14:01:58Z",
    "estimated_hours": 6.2,
    "audience": { "matched": 1902, "sendable": 1840, "opted_out": 31, "suppressed": 6, "unknown_consent": 25, "missing_variables": 0 },
    "checks": [
      {
        "key": "accounts_authorized",
        "label": "Accounts authorized",
        "status": "FAIL",
        "message": "Expo Desk (needs to sign in again) can't send. Remove it from the campaign or fix it first."
      },
      {
        "key": "opt_out_link",
        "label": "Opt-out link",
        "status": "FAIL",
        "message": "Add {{opt_out_url}} so recipients can opt out. Platform policy requires it."
      }
    ]
  }
}

Show each check with status FAIL to whoever launched it. See pre-launch validation for every check.

Telegram sign-in errors#

Connecting an account goes through a worker that talks to Telegram. When Telegram rejects a step, the API answers with Telegram's error type as the code, in lowercase, and a readable message:

POST /accounts/login/{flow_id}/code · 422
{
  "error": {
    "code": "phone_code_invalid",
    "message": "That code is wrong. Check the latest message from Telegram."
  }
}
CodeStatusMeaning
phone_code_invalid422The login code is wrong. The flow allows 5 attempts.
phone_code_expired410The login code expired. Start the sign-in again.
password_hash_invalid422The two-step verification password is wrong.
phone_number_invalid422Not a phone number Telegram recognises.
phone_number_unoccupied422The number isn't registered on Telegram.
phone_number_banned403Telegram has banned this number.
phone_number_flood429Telegram paused sign-in attempts for this number. Try later.
too_many_attempts429The flow used its 5 attempts. Start again.
flow_expiredflow_failed410The sign-in attempt is over (flows last 15 minutes). Start again.
flow_not_found404No such sign-in attempt.
proxy_unavailable422The proxy chosen for the account can't be reached.
telegram_app_invalid500The deployment's TELEGRAM_APP_ID or TELEGRAM_APP_HASH is wrong. Tell the platform operator.

Errors while sending are not API errors: they land on the delivery (last_error), the send job, the account status and the message.failed webhook event. See delivery and account states.

Handling errors#

  • 429: wait for Retry-After, then retry.
  • 5xx and network errors: retry reads with a growing delay. Before retrying a create, check whether the first attempt succeeded.
  • 401: the credential is missing, wrong or revoked. Retrying won't help; fix the credential.
  • 409: the object is in the wrong state for this. Reload it; the message says what to do instead.
  • Other 4xx: the request needs to change. Show message, and map details onto your form fields.
PreviousSDKNext Rate limits