Skip to content

Brex: Get legal entity

Brex team.teamGetLegalEntity: arguments, response, policy and SDK examples.

← Team operations · Get started

Operation brex.team_getlegalentity

Provider route: GET /v2/legal_entities/{id}. Alter supplies the connection’s credentials and routing.

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"]["teamGetLegalEntity"]>[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.teamGetLegalEntity(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from 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_get_legal_entity(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.idstringRequired within parent

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get legal entity — response body

Referenced models: Get legal entity — response body

Get legal entity — response body
FieldTypePresenceDescription and constraints
$objectRoot
A Brex legal entity.
billingAddressJSONRequired within parent
billingAddress (allOf 1)ModelAll variants applyExpand Get card — response body — billing address
billingAddress (allOf 2)JSONAll variants apply
The billing address of this legal entity. Also used as billing address for cards issued to users who belong to this entity.
createdAtstringRequired within parent
Timestamp, in UTC, when this legal entity was created.

Format: date-time
displayNamestringRequired within parent
The display name of this legal entity.
idstringRequired within parent
The ID of this legal entity.
isDefaultbooleanOptional
Whether this is the default entity of the account.
statusJSONRequired within parent
status (allOf 1)stringAll variants apply
The possible statuses for an entity's verification in Brex.

Known values: UNSUBMITTED, UNVERIFIED, IN_PROGRESS, VERIFIED, REJECTED
status (allOf 2)JSONAll variants apply
The current status of this legal entity.

Referenced models: Get card — response body — billing address

Get card — response body — billing address
FieldTypePresenceDescription and constraints
$objectRootCompany business address (must be in the US; no PO box or virtual/forwarding addresses allowed).
cityJSONOptional
city (anyOf 1)stringAlternativeCity, district, suburb, town, or village.
city (anyOf 2)nullAlternative
countryJSONOptional
country (anyOf 1)stringAlternativeTwo-letter country code (ISO 3166-1 alpha-2).
country (anyOf 2)nullAlternative
line1JSONOptional
line1 (anyOf 1)stringAlternativeAddress line 1, no PO Box.
line1 (anyOf 2)nullAlternative
line2JSONOptional
line2 (anyOf 1)stringAlternativeAddress line 2 (e.g., apartment, suite, unit, or building).
line2 (anyOf 2)nullAlternative
phone_numberJSONOptional
phone_number (anyOf 1)stringAlternativePhone number.
phone_number (anyOf 2)nullAlternative
postal_codeJSONOptional
postal_code (anyOf 1)stringAlternativeZIP or postal code.
postal_code (anyOf 2)nullAlternative
stateJSONOptional
state (anyOf 1)stringAlternativeFor US-addressed the 2-letter State abbreviation. For international-addresses the county, providence, or region.
state (anyOf 2)nullAlternative

SDK function policy ID: brex.team_getlegalentity. Catalog operation: team:getLegalEntity. 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"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.