Open a bank account
curl --request POST \
--url https://api.getlemma.com/v0/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"entity_id": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.getlemma.com/v0/accounts"
payload = {
"entity_id": "<string>",
"name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({entity_id: '<string>', name: '<string>'})
};
fetch('https://api.getlemma.com/v0/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getlemma.com/v0/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entity_id' => '<string>',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getlemma.com/v0/accounts"
payload := strings.NewReader("{\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getlemma.com/v0/accounts")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlemma.com/v0/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
{
"statusCode": 400,
"error": "Bad Request",
"message": [
"name may only contain letters, numbers, spaces, hyphens, underscores, #, +, &, and /"
]
}
{
"statusCode": 403,
"error": "Forbidden",
"message": "You do not have permission to open bank accounts for this entity"
}
{
"statusCode": 409,
"error": "Conflict",
"message": "An account with this name already exists"
}
Bank Accounts
Open a bank account
Open a new Lemma bank account for an entity.
POST
/
v0
/
accounts
Open a bank account
curl --request POST \
--url https://api.getlemma.com/v0/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"entity_id": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.getlemma.com/v0/accounts"
payload = {
"entity_id": "<string>",
"name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({entity_id: '<string>', name: '<string>'})
};
fetch('https://api.getlemma.com/v0/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getlemma.com/v0/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entity_id' => '<string>',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getlemma.com/v0/accounts"
payload := strings.NewReader("{\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getlemma.com/v0/accounts")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlemma.com/v0/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
{
"statusCode": 400,
"error": "Bad Request",
"message": [
"name may only contain letters, numbers, spaces, hyphens, underscores, #, +, &, and /"
]
}
{
"statusCode": 403,
"error": "Forbidden",
"message": "You do not have permission to open bank accounts for this entity"
}
{
"statusCode": 409,
"error": "Conflict",
"message": "An account with this name already exists"
}
Opens a new Lemma bank account for an entity. The account gets its own account number and routing number.
Headers
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.
Request body
string
required
The ID of the entity to open the account for. You can find entity IDs using
the List entities endpoint.
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.Response
Returns the new bank account, in the same shape as Get bank account.string
Unique identifier for the account, prefixed with
account_.string
The ID of the entity that owns this account.
string
The name of the account, with whitespace collapsed.
string
The bank account number.
string
The ABA routing number.
integer
The total balance of the account in cents. Always
0 for a new account.integer
The balance available for use in cents. Always
0 for a new account.{
"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"
}
{
"statusCode": 400,
"error": "Bad Request",
"message": [
"name may only contain letters, numbers, spaces, hyphens, underscores, #, +, &, and /"
]
}
{
"statusCode": 403,
"error": "Forbidden",
"message": "You do not have permission to open bank accounts for this entity"
}
{
"statusCode": 409,
"error": "Conflict",
"message": "An account with this name already exists"
}