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

# Recover an ID You Didn't Save

> Find the ID of an entity, account, counterparty, transfer, card or other resource when your system didn't store it at creation.

This guide recovers the ID of a resource you created but didn't save, for example after a timeout, a failed database write, or a retry that returned `409 error_duplicate_resource`. It ends with the ID in hand, ready to use in your next call.

Nuvion returns a resource's ID in the create response. If you lost it, list the resource and match on a value you still know, such as a name, a reference or the account it belongs to.

## Which call to use

| Lost ID | Call | Match on | ID in the response |
| - | - | - | - |
| Entity | `GET /entities?name=` | `name`. The match is partial and ignores letter case. | `data.data[].id` |
| Person, address, identification | `GET /entities/{entity_id}` | The entity you found. | `data.person.id`, `data.address.id`, `data.identification.id` |
| Account | `GET /accounts?entity_id=&currency=&display_name=` | `currency` and `display_name`. The `display_name` match is partial and ignores letter case. | `data.data[].id` |
| Account details | `GET /account-details?account_id=` | The account. | `data.data[].id` |
| Counterparty | `GET /counterparties?search=` | The counterparty name. The match is partial and ignores letter case. | `data.data[].id` |
| Payment detail | `GET /counterparties/{counterparty_id}/payment-details` | `currency` and `account_holder_name`. | `data.data[].id` |
| Transfer | `GET /transfers?unique_reference=` | `unique_reference`. The match is exact and case-sensitive. | `data.data[].id` |
| Funding session | `GET /funding-sessions?account_id=` | `unique_reference`. The list can't filter by it, so match it in the response. | `data.data[].id` |
| Payment intent | `GET /payment-intents?reference=` | `reference`. The match is exact and case-sensitive. | `data.items[].id` |
| Card | `GET /cards?account_id=` | `name`. The list can't filter by it, so match it in the response. | `data.cards[].id` |

Each list is paginated, newest first unless the endpoint says otherwise. When `has_next` is `true`, pass `next_cursor` as `cursor` to read the next page. See [Pagination](https://docs.nuvion.co/pagination.md).

## Recover an entity

Search by the name you sent when you created the entity. This is also how you recover from a `409 error_duplicate_resource` on create.

```bash curl theme={null}
curl "https://api.nuvion.dev/entities?type=individual&name=alex%20johnson" \
  -H "Authorization: Bearer $NUVION_API_KEY"
```

The `id` of the match is the `entity_id`. To read the person, address and identification IDs, or the person's email, retrieve the entity.

```bash curl theme={null}
curl https://api.nuvion.dev/entities/01HXYZ0001ABCDEFGHJKMNPQRS \
  -H "Authorization: Bearer $NUVION_API_KEY"
```

See [List entities](https://docs.nuvion.co/api-reference/entities.md#list-entities) and [Get an entity](https://docs.nuvion.co/api-reference/entities.md#get-an-entity) for the full responses.

## Recover an account

Filter the entity's accounts by the `currency` and `display_name` you used. Without `entity_id`, the list returns your own accounts. The `display_name` match is partial, so if more than one account comes back, pick the one whose `display_name` matches exactly.

```bash curl theme={null}
curl "https://api.nuvion.dev/accounts?entity_id=01HXYZ0001ABCDEFGHJKMNPQRS&currency=USD&display_name=USD%20Operating" \
  -H "Authorization: Bearer $NUVION_API_KEY"
```

```json 200 OK theme={null}
{
  "status": "success",
  "message": "Accounts retrieved successfully",
  "data": {
    "data": [
      {
        "id": "01HXYZ2345ABCDEFGHJKMNPQRS",
        "entity_id": "01HXYZ0001ABCDEFGHJKMNPQRS",
        "type": "checking",
        "currency": "USD",
        "display_name": "USD Operating",
        "nuvion_ban": "0011879002",
        "status": "active",
        "meta": {
          "asset_type": "",
          "network": ""
        },
        "config": {
          "is_overdraftable": false,
          "overdraft_limit": 0
        },
        "balance": {
          "current": 1140456,
          "available": 1140456,
          "overdraft_used": 0,
          "posted": 1145957,
          "outstanding": 0
        },
        "maintenance_fee_opted_out": false,
        "outstanding_breakdown": [],
        "created": 1793017748017,
        "updated": 1793887243208
      }
    ],
    "meta": {
      "pagination": {
        "order": "asc",
        "has_next": false,
        "limit": 20,
        "has_previous": false,
        "next_cursor": null,
        "previous_cursor": null
      },
      "filters_applied": {
        "parent_account_id": null,
        "entity_id": "01HXYZ0001ABCDEFGHJKMNPQRS",
        "type": {},
        "currency": "USD",
        "display_name": {
          "like": "USD Operating"
        },
        "sort": {
          "field": "created",
          "order": "asc"
        }
      }
    }
  }
}
```

The account `id` is `data.data[].id`. See [List accounts](https://docs.nuvion.co/api-reference/accounts.md#list-accounts) for the filters.

## Recover a transfer

Filter by the `unique_reference` you sent. The reference must match exactly, including letter case.

```bash curl theme={null}
curl "https://api.nuvion.dev/transfers?unique_reference=PAY-2025-001" \
  -H "Authorization: Bearer $NUVION_API_KEY"
```

```json 200 OK theme={null}
{
  "status": "success",
  "message": "Transfers retrieved successfully",
  "data": {
    "data": [
      {
        "id": "01HXYZ0060ABCDEFGHJKMNPQRS",
        "amount": 5000,
        "currency": "USD",
        "unique_reference": "PAY-2025-001",
        "counterparty_id": "01HXYZ0062ABCDEFGHJKMNPQRS",
        "account_id": "01HXYZ2345ABCDEFGHJKMNPQRS",
        "entity_id": "01HXYZ0001ABCDEFGHJKMNPQRS",
        "status": "pending",
        "status_reason": "Outbound local payment submitted",
        "narration": "Invoice payment INV-2025-001",
        "type": "outflow",
        "payment_type": "bank-transfer",
        "applicable_fee": 501,
        "meta": {
          "provider_reference": null
        },
        "created": 1793887242278,
        "updated": 1793887422996
      }
    ],
    "meta": {
      "pagination": {
        "order": "desc",
        "has_next": false,
        "limit": 20,
        "has_previous": false,
        "next_cursor": null,
        "previous_cursor": null
      }
    }
  }
}
```

A reference that no transfer uses returns `200 OK` with an empty `data` array. A transfer record exists even when the transfer ends in `failed`, so a missing match means no transfer was created with that reference.

## Recover a card

The card list can't filter by name, so list the cards on the funding account and match `name`. The card `id` is under `data.cards`.

```bash curl theme={null}
curl "https://api.nuvion.dev/cards?account_id=01HXYZ2345ABCDEFGHJKMNPQRS" \
  -H "Authorization: Bearer $NUVION_API_KEY"
```

```json 200 OK theme={null}
{
  "status": "success",
  "data": {
    "cards": [
      {
        "id": "01HXYZ9012ABCDEFGHJKMNPQRS",
        "name": "Alex Travel Card",
        "type": "virtual",
        "status": "active",
        "currency": "USD",
        "nuvion_account_name": "USD Operating",
        "last4": null,
        "expiration_month": null,
        "expiration_year": null,
        "created": "2026-11-06"
      }
    ],
    "pagination": {
      "order": "desc",
      "has_next": false,
      "limit": 20,
      "has_previous": false,
      "next_cursor": null,
      "previous_cursor": null
    }
  }
}
```

If several cards look alike, use `created` and `type` to tell them apart. See [List cards](https://docs.nuvion.co/api-reference/cards.md#list-cards).

## When a call fails or returns nothing

| Status | `type` | Cause |
| - | - | - |
| `401` | `error_auth_credentials_invalid` | The API key is missing, invalid or expired. |
| `404` | `error_resource_not_found` | The entity ID doesn't match an entity. This covers `GET /entities/{entity_id}` and `entity_id` on `GET /accounts`, and a malformed ID counts as unknown. |
| `404` | `error_resolution_account_not_found` | The `account_id` on `GET /transfers` doesn't match an account. |
| `422` | `error_validation_error` | A filter value is invalid, for example `limit` outside `1` to `100`, an unsupported `type` or `sort`, a `currency` that isn't 3 characters or an empty `display_name` on `GET /accounts`, or a malformed `account_id` on `GET /transfers`. The `validations` array names the field. |
| `200` | n/a | No match. The `data` array is empty. |

The request can also return the shared `403` and `429` errors. See [Errors](https://docs.nuvion.co/errors.md) for the standard error object.

```json 401 Invalid credentials theme={null}
{
  "status": "error",
  "message": "Your credentials are invalid or have expired. Please check your credentials and try again",
  "type": "error_auth_credentials_invalid"
}
```

```json 404 Entity not found theme={null}
{
  "status": "error",
  "message": "We couldn't find that entity. It may have been deleted or the ID might be incorrect.",
  "type": "error_resource_not_found"
}
```

```json 422 Validation error theme={null}
{
  "status": "error",
  "message": "Validation failed for one or more fields",
  "type": "error_validation_error",
  "validations": [
    {
      "limit": {
        "type": "error_validation_value_out_of_range",
        "message": "The value for 'limit' should be between 1 and 100."
      }
    }
  ]
}
```

> [!WARNING]
>
> An empty result doesn't prove the resource is missing. `GET /cards`, `GET /funding-sessions`, `GET /account-details` and `GET /counterparties/{counterparty_id}/payment-details` return `200` with an empty array for an `account_id` or `counterparty_id` that doesn't exist. Check the ID you filter by before you conclude the resource was never created.

## Don't lose it again

* **Store the ID when the create succeeds,** before you do anything else with the resource.
* **Send a stable reference** such as `unique_reference` on transfers and funding sessions, and `display_name` on accounts. A retry with the same value returns `409 error_duplicate_resource` instead of creating a second record, and the reference lets you find the first one.
* **Handle `409 error_duplicate_resource`** by recovering the existing ID, as above, not by showing the raw error. See [Avoiding duplicate entities](https://docs.nuvion.co/core-concepts/entities.md#avoiding-duplicate-entities).


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