Brex: List legal entities
Brex team.teamListLegalEntities: arguments, response, policy and SDK examples.
← Team operations · Get started
Operation brex.team_listlegalentities
Provider route: GET /v2/legal_entities. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/brex with npm, or alter-sdk-brex with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { BrexIntegration } from "@alter-ai/brex";
async function execute(input: Parameters<BrexIntegration["team"]["teamListLegalEntities"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new BrexIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.team.teamListLegalEntities(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_brex import BrexIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = BrexIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.team.team_list_legal_entities(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.cursor | JSON | Optional | |
query.cursor (anyOf 1) | string | Alternative | |
query.cursor (anyOf 2) | null | Alternative | |
query.limit | JSON | Optional | |
query.limit (anyOf 1) | integer | Alternative | Format: int32 |
query.limit (anyOf 2) | null | Alternative |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List legal entities — response body |
Referenced models: List legal entities — response body
Schemas
Section titled “Schemas”List legal entities — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
items | array | Required within parent | |
items[] | Model | Each item | Expand Get legal entity — response body |
next_cursor | JSON | Optional | |
next_cursor (anyOf 1) | string | Alternative | |
next_cursor (anyOf 2) | null | Alternative |
Referenced models: Get legal entity — response body
Get legal entity — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A Brex legal entity. |
billingAddress | JSON | Required within parent | |
billingAddress (allOf 1) | Model | All variants apply | Expand Get card — response body — billing address |
billingAddress (allOf 2) | JSON | All variants apply | The billing address of this legal entity. Also used as billing address for cards issued to users who belong to this entity. |
createdAt | string | Required within parent | Timestamp, in UTC, when this legal entity was created. Format: date-time |
displayName | string | Required within parent | The display name of this legal entity. |
id | string | Required within parent | The ID of this legal entity. |
isDefault | boolean | Optional | Whether this is the default entity of the account. |
status | JSON | Required within parent | |
status (allOf 1) | string | All variants apply | The possible statuses for an entity's verification in Brex. Known values: UNSUBMITTED, UNVERIFIED, IN_PROGRESS, VERIFIED, REJECTED |
status (allOf 2) | JSON | All variants apply | The current status of this legal entity. |
Referenced models: Get card — response body — billing address
Get card — response body — billing address
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Company business address (must be in the US; no PO box or virtual/forwarding addresses allowed). |
city | JSON | Optional | |
city (anyOf 1) | string | Alternative | City, district, suburb, town, or village. |
city (anyOf 2) | null | Alternative | |
country | JSON | Optional | |
country (anyOf 1) | string | Alternative | Two-letter country code (ISO 3166-1 alpha-2). |
country (anyOf 2) | null | Alternative | |
line1 | JSON | Optional | |
line1 (anyOf 1) | string | Alternative | Address line 1, no PO Box. |
line1 (anyOf 2) | null | Alternative | |
line2 | JSON | Optional | |
line2 (anyOf 1) | string | Alternative | Address line 2 (e.g., apartment, suite, unit, or building). |
line2 (anyOf 2) | null | Alternative | |
phone_number | JSON | Optional | |
phone_number (anyOf 1) | string | Alternative | Phone number. |
phone_number (anyOf 2) | null | Alternative | |
postal_code | JSON | Optional | |
postal_code (anyOf 1) | string | Alternative | ZIP or postal code. |
postal_code (anyOf 2) | null | Alternative | |
state | JSON | Optional | |
state (anyOf 1) | string | Alternative | For US-addressed the 2-letter State abbreviation. For international-addresses the county, providence, or region. |
state (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: brex.team_listlegalentities. Catalog operation: team:listLegalEntities. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["legal_entities", "legal_entities.readonly"]