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

# Open a bank account

> Open a new Lemma bank account for an entity.

Opens a new Lemma bank account for an entity. The account gets its own account number and routing number.

## Headers

<ParamField header="Idempotency-Key" type="string" required>
  A key that prevents opening a duplicate account if the same request is
  retried. Reusing a key returns the originally opened account instead of
  opening a second one. See [Idempotency](/docs/api-reference/idempotency).
</ParamField>

## Request body

<ParamField body="entity_id" type="string" required>
  The ID of the entity to open the account for. You can find entity IDs using
  the [List entities](/docs/api-reference/list-entities) endpoint.
</ParamField>

<ParamField body="name" type="string" required>
  The name of the account, visible to the entity's team on their Lemma
  dashboard. Choose something descriptive, such as "Payroll" or "Cigna
  deposits". Leading and trailing whitespace is removed and runs of whitespace
  are collapsed to a single space before the name is saved.

  Between 1 and 100 characters. May contain only letters (A to Z), numbers,
  spaces, hyphens (`-`), underscores (`_`), `#`, `+`, `&`, and `/`.

  Must be unique among the entity's open accounts, ignoring case. A closed
  account's name can be reused.
</ParamField>

## Response

Returns the new bank account, in the same shape as [Get bank account](/docs/api-reference/get-bank-account).

<ResponseField name="id" type="string">
  Unique identifier for the account, prefixed with `account_`.
</ResponseField>

<ResponseField name="entity_id" type="string">
  The ID of the entity that owns this account.
</ResponseField>

<ResponseField name="name" type="string">
  The name of the account, with whitespace collapsed.
</ResponseField>

<ResponseField name="account_number" type="string">
  The bank account number.
</ResponseField>

<ResponseField name="routing_number" type="string">
  The ABA routing number.
</ResponseField>

<ResponseField name="total_balance" type="integer">
  The total balance of the account in cents. Always `0` for a new account.
</ResponseField>

<ResponseField name="available_balance" type="integer">
  The balance available for use in cents. Always `0` for a new account.
</ResponseField>

<ResponseField name="opened_at" type="string">
  [ISO 8601](/docs/api-reference/timestamps) timestamp of when the account was
  opened.
</ResponseField>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "account_Rv4nBt8xKw2pMh6s",
    "entity_id": "entity_k7mXp2vR9nTf",
    "name": "Payroll",
    "account_number": "987654321",
    "routing_number": "101050001",
    "total_balance": 0,
    "available_balance": 0,
    "opened_at": "2026-10-13T16:20:00Z"
  }
  ```

  ```json 400 theme={null}
  {
    "statusCode": 400,
    "error": "Bad Request",
    "message": [
      "name may only contain letters, numbers, spaces, hyphens, underscores, #, +, &, and /"
    ]
  }
  ```

  ```json 403 theme={null}
  {
    "statusCode": 403,
    "error": "Forbidden",
    "message": "You do not have permission to open bank accounts for this entity"
  }
  ```

  ```json 409 theme={null}
  {
    "statusCode": 409,
    "error": "Conflict",
    "message": "An account with this name already exists"
  }
  ```
</ResponseExample>


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