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

# Get account retention

> Read the Nixflex account retention default for new agents. Existing agents retain their saved settings until explicitly updated.

**FIXED · account** `DELETE /v1/calls` covers the owning account’s calls and related recordings. It takes no number or campaign filter. Its result reports sms\_deleted=0.

**NOT OFFERED → do this instead · number** There is no bulk erase for just one customer’s number in a shared account. Resolve and verify each tenant-owned call ID, then use single-call deletion.

**YOU CAN CHANGE · agent** New agents inherit account retention on creation. Use the agent update to change its saved call-retention policy.

**SCOPE · call** Read availability first. Stored links expire. Distinguish pending, expired, unavailable and customer storage.

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

Read the account retention default for new agents. Existing agents keep their saved retention settings; use Update an agent to change one agent.

Method: **GET** · Success: **200** · Scope: **Owning account**

**The important part**

* Read the saved account retention policy.
* Policy values alone do not confirm pending cleanup is complete.

[Business guide](https://docs.nixflex.com/guides/business/billing.md) · [Developer guide](https://docs.nixflex.com/guides/developer/billing.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Authentication

Send `Authorization: Bearer KEY_ID:KEY_SECRET` using the owning account’s server-side credential.

## Request fields

No request body or query fields are required.

No path, query or body fields are required. A new account defaults to 90 days if no account retention default has been saved.

## Response fields

`200 OK` returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.

| Field | Type | Meaning |
| - | - | - |
| `call_retention_days` | integer | Saved account default: 90, 30, 7, 1 or 0 days. Zero means delete eligible content after each call. Allowed: `90`, `30`, `7`, `1`, `0`. |
| `applies_to` | string | Only new agents inherit this default. |
| `processing_enabled` | boolean | Whether the retention processing feature is enabled. This does not confirm that a particular record has been erased. |

## Example request

Raw HTTP base URL: `https://api.nixflex.com/v1`. Node and Python SDK base URL: `https://api.nixflex.com`. The SDK adds `/v1`. Keep `NIXFLEX_API_KEY` in your private process environment. The shell examples use Bash syntax. SDK and CLI examples require Node/CLI 0.11.0 or later and Python 0.4.0 or later.

```bash cURL theme={"dark"}
curl --request GET \
  --url "https://api.nixflex.com/v1/account/retention" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY"
```

```javascript Node theme={"dark"}
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.account.retention();
// Handle result privately; do not log secrets or call content.
```

```python Python theme={"dark"}
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
    result = client.account.retention()
# AsyncNixflex supports the same calls with await (and async with).
```

```bash CLI theme={"dark"}
nixflex account retention --base-url https://api.nixflex.com --json
```

## Example response

Illustrative `200` response. Identifiers and values are examples; some optional or compatibility fields are omitted.

```json Response theme={"dark"}
{
  "call_retention_days": 90,
  "applies_to": "new_agents",
  "processing_enabled": true
}
```

## Errors

Failures return an `error` object with `code`, `message`, `doc_url` and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.

| Status | Code | Meaning | What to do |
| - | - | - | - |
| 503 | [`retention_unavailable`](https://docs.nixflex.com/api-reference/errors#retention_unavailable) | The saved retention default could not be read. | Retry a bounded read after recovery; do not assume a default from the failure. |
| 401 | [`unauthorized`](https://docs.nixflex.com/api-reference/errors#unauthorized) | The credential is missing or invalid. | Check the full account credential. |
| 429 | [`rate_limit_exceeded`](https://docs.nixflex.com/api-reference/errors#rate_limit_exceeded) | The account request limit was reached. | Wait for Retry-After. Reconcile uncertain writes before resending. |

## Retry and idempotency

This is a read-only request. Retry transient connection or server failures with bounded backoff; respect Retry-After for 429. Do not retry validation or ownership errors unchanged. A later read can return newer state.

## Related endpoints

* [Get account usage](https://docs.nixflex.com/api-reference/account/usage.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json GET /account/retention
openapi: 3.1.0
info:
  title: Nixflex public API
  version: 1.0.0
  description: >-
    Nixflex API reference for agents, calls, messaging, knowledge, organisations
    and integrations. Authenticate with the owning account and follow each
    operation’s permissions, response and retry contract.
servers:
  - url: https://api.nixflex.com/v1
security:
  - bearerAuth: []
paths:
  /account/retention:
    get:
      tags:
        - Account and keys
      summary: Get account retention
      description: >-
        Read the account retention default for new agents. Existing agents keep
        their saved retention settings; use Update an agent to change one agent.
        No path, query or body fields are required. A new account defaults to 90
        days if no account retention default has been saved.
      operationId: getAccountRetention
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  call_retention_days:
                    type: integer
                    description: >-
                      Saved account default: 90, 30, 7, 1 or 0 days. Zero means
                      delete eligible content after each call.
                    enum:
                      - 90
                      - 30
                      - 7
                      - 1
                      - 0
                  applies_to:
                    type: string
                    description: Only new agents inherit this default.
                    const: new_agents
                  processing_enabled:
                    type: boolean
                    description: >-
                      Whether the retention processing feature is enabled. This
                      does not confirm that a particular record has been erased.
                required:
                  - call_retention_days
                  - applies_to
                  - processing_enabled
                description: ''
                additionalProperties: false
              example:
                call_retention_days: 90
                applies_to: new_agents
                processing_enabled: true
        '401':
          description: >-
            unauthorized: The credential is missing or invalid. Check the full
            account credential.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error class.
                      code:
                        type: string
                        description: Stable machine-readable code.
                      message:
                        type: string
                        description: Readable refusal or failure reason.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                        format: uri
                      details:
                        type: object
                        properties: {}
                        description: Additional field, operation or outcome details.
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '429':
          description: >-
            rate_limit_exceeded: The account request limit was reached. Wait for
            Retry-After. Reconcile uncertain writes before resending.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error class.
                      code:
                        type: string
                        description: Stable machine-readable code.
                      message:
                        type: string
                        description: Readable refusal or failure reason.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                        format: uri
                      details:
                        type: object
                        properties: {}
                        description: Additional field, operation or outcome details.
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '503':
          description: >-
            retention_unavailable: The saved retention default could not be
            read. Retry a bounded read after recovery; do not assume a default
            from the failure.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error class.
                      code:
                        type: string
                        description: Stable machine-readable code.
                      message:
                        type: string
                        description: Readable refusal or failure reason.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                        format: uri
                      details:
                        type: object
                        properties: {}
                        description: Additional field, operation or outcome details.
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A
        verified personal dashboard Bearer session may be used where the
        operation documents role-based access.

````

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