> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nixflex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Handle API errors in code

> Handle Nixflex error codes, keep unknown write outcomes visible and reconcile calls, messages and number changes before retrying work.

**FIXED · account** Inbound and outbound share the account/API-key concurrency budget. Read max\_concurrent for the effective limit.

**NOT OFFERED → do this instead · number** No per-number concurrency reservation exists. Queue or pace each business within the shared account call budget.

**YOU CAN CHANGE · account** Pace submissions. Accepted work may wait for capacity.

**SCOPE · operation** Check the code and details to distinguish refusal, acceptance and unknown outcome before retrying.

[Read the compact AI rules](https://docs.nixflex.com/ai-rules.md#limits-errors)

Use the HTTP status and machine error code to choose between correcting input, retrying a read and reconciling a write.

Decision: **Status and code** · Write failure: **Reconcile first** · Logs: **Safe fields only**

**The important part**

* Branch on error.code, not the wording of error.message.
* An error or lost connection can leave a write outcome unknown.
* Keep a non-JSON error fallback and log only safe diagnostic fields.

[Business guide](https://docs.nixflex.com/business.md) · [API reference](https://docs.nixflex.com/api-reference/introduction.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

```json theme={"dark"}
{"error":{"type":"conflict","code":"do_not_contact","message":"This recipient is on your do-not-contact list. The message was not sent.","doc_url":"https://docs.nixflex.com/errors/do_not_contact","details":{}}}
```

| Result | Application action |
| - | - |
| 400 validation | Correct the request. Do not repeat it unchanged. |
| 401 authentication | Check the full server credential privately. |
| 403 permission | Respect the role or account restriction. A shared key is not a browser workaround. |
| 404 owned resource | Check the identifier and ownership; do not infer another account's data. |
| 409 conflict | Follow the exact code and inspect current state. |
| 429 rate limit | Honour `Retry-After`; apply the operation's retry rules. |
| 503 or lost connection | A write may have happened. Reconcile before trying again. |

## SMS suppression change

Single `POST /v1/sms` suppression now returns **409 `do_not_contact`**, with type `conflict`. It previously returned **400 `invalid_request`**. Update code that matches the old response. Nothing was sent: stop and respect the recipient's opt-out. Campaign recipients remain held individually with `hold_reason: do_not_contact`.

## Preserve uncertainty

If hang-up is not confirmed, HTTP 503 `hangup_pending` returns `error.details.deleted:false` and `error.details.retry_pending:true`. Deletion stays queued and continues automatically. Repeating the same DELETE for the same account and ID safely resumes it. A lost response or `deletion_unavailable` is not success: check the list, then repeat that same DELETE if needed. Missing and foreign IDs share HTTP 404. Bulk call deletion and account closure keep separate safety rules.

An accepted call or SMS request is not delivery proof. Save returned identifiers and read the resulting record. For number credentials, `carrier_outcome_unknown` needs support investigation; `credential_save_pending` permits a deliberate retry with identical details to finish the local save. Never delete and re-import to recover.

Show a safe message and retain the code and operation ID when present. Keep full bodies, caller details and credentials out of logs. See the [error catalog](https://docs.nixflex.com/api-reference/errors.md) and [retry rules](https://docs.nixflex.com/api-reference/retries.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.