> ## 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.

# Prevent duplicate work in code

> Save outbound call UUIDs and Knowledge operation keys correctly, keep their account binding, and reconcile other uncertain writes.

**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)

Persist each intended operation before sending it and use the identity mechanism supported by that specific endpoint.

Calls: **Saved request\_id** · Knowledge: **Idempotency-Key** · Other writes: **Read and reconcile**

**The important part**

* A call request UUID is not the same as a Knowledge Idempotency-Key header.
* Keep the original account, API base URL, identity and exact input while reconciling.
* A new identity represents a new action and can create duplicate work.

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

## Save the operation before sending

Store the intended effect, the owning account association, the exact request and its identity in private durable storage. Do not include the API secret in that operation record. Record the returned resource ID and outcome separately.

| Operation | Identity | Recovery after a lost reply |
| - | - | - |
| Single outbound call with UUID | JSON `request_id` saved before first send | Read that request in the same account. |
| Documented Knowledge write | Required `Idempotency-Key` header | Keep the same key and identical input; reconcile its resource/job using the endpoint's rules. |
| Other mutation | No universal replay guarantee | Read current state or follow that endpoint’s documented recovery steps. |

## Reconcile an outbound UUID

A first call acceptance returns 201. Reusing an already accepted UUID with matching input can return 200 with `replayed:true` and the existing call ID. Pending, unknown or conflicting requests are refused; they do not authorise another call under a replacement UUID.

Use [GET request state](https://docs.nixflex.com/api-reference/calls/get-outbound-request.md) and retain `pending`, `accepted`, `rejected` and `unknown` as different results. A 404 or failed read is not permission to redial. An accepted call ID remains important even if the launch reply includes `request_status:unconfirmed` and `safe_to_retry:false`.

The same UUID in another account is a separate scope. See the complete [saved-call workflow](https://docs.nixflex.com/guides/developer/call-requests.md), including durable preparation and process restarts.

## Knowledge operations

Use 8–128 letters, digits, dots, underscores, colons or hyphens for the required header. The `prompt:` prefix is reserved. A new import, an edit and draft acceptance are separate intended operations, each with its own saved key.

A revision guard protects newer state; it is not the operation identity. On `stale_revision`, reread the correct base, source or draft and review the change before making a new decision. Never turn a conflict into a loop that overwrites newer work.

HTTP 202 accepts a job. Poll the returned job ID and inspect its result. Preparation, review and publication remain separate stages. An accepted source does not confirm live topics changed.

## Other operations

Do not add a generic `Idempotency-Key` and assume it protects SMS, campaigns, key rotation or number updates. Disable automatic mutation retries unless the exact operation documents a safe recovery action.

For number credentials, only `credential_save_pending` permits deliberate identical-input completion of the local save. `carrier_outcome_unknown` requires reconciliation. For calendar consent, read the connection state before starting another flow after an uncertain reply.

## Handle conflicting evidence

| Evidence | What to do |
| - | - |
| Known accepted call ID | Retain it and inspect that call; never replace it with a new launch. |
| Unknown launch outcome | Keep the original UUID and show an unresolved state. |
| Knowledge key reused with changed input | Preserve the old operation; decide whether a separate new action is intended. |
| Fresh resource revision | Review the change before writing against it. |
| Empty history page | Do not treat absence from that page as proof nothing happened. |

## Next steps

* [Prepare and reconcile a call](https://docs.nixflex.com/guides/developer/call-requests.md)
* [Review and publish Knowledge](https://docs.nixflex.com/guides/developer/knowledge/review-and-publish.md)
* [Handle errors in code](https://docs.nixflex.com/guides/developer/errors.md)


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