Brex: Get user
Brex team.teamGetUserById: arguments, response, policy and SDK examples.
← Team operations · Get started
Operation brex.team_getuserbyid
Provider route: GET /v2/users/{id}. 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"]["teamGetUserById"]>[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.teamGetUserById(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_get_user_by_id(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.id | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.load_custom_fields | JSON | Optional | |
query.load_custom_fields (anyOf 1) | boolean | Alternative | |
query.load_custom_fields (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 Get user — response body |
Referenced models: Get user — response body
Schemas
Section titled “Schemas”20 more schemas are linked from the tables above, on the schema pages.
Get user — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
cost_center_id | JSON | Optional | |
cost_center_id (anyOf 1) | string | Alternative | |
cost_center_id (anyOf 2) | null | Alternative | |
custom_fields | JSON | Optional | |
custom_fields (anyOf 1) | array | Alternative | A list of custom field values associated with the user. |
custom_fields (anyOf 1)[] | Model | Each item | Expand Get user — response body — custom fields array item |
custom_fields (anyOf 2) | null | Alternative | |
department_id | JSON | Optional | |
department_id (anyOf 1) | string | Alternative | |
department_id (anyOf 2) | null | Alternative | |
email | string | Required within parent | Email address of the user |
first_name | string | Required within parent | First name of the user |
id | string | Required within parent | |
last_name | string | Required within parent | Last name of the user |
legal_entity_id | JSON | Optional | |
legal_entity_id (anyOf 1) | string | Alternative | |
legal_entity_id (anyOf 2) | null | Alternative | |
location_id | JSON | Optional | |
location_id (anyOf 1) | string | Alternative | |
location_id (anyOf 2) | null | Alternative | |
manager_id | JSON | Optional | |
manager_id (anyOf 1) | string | Alternative | The user id of the manager of this user |
manager_id (anyOf 2) | null | Alternative | |
metadata | JSON | Optional | |
metadata (anyOf 1) | object | Alternative | The metadata or customized attributes of the user. Maximum number of entries: 100 Additional keys: see wildcard field |
metadata (anyOf 1).* | string | Additional keys | |
metadata (anyOf 2) | null | Alternative | |
remote_display_id | JSON | Optional | |
remote_display_id (anyOf 1) | string | Alternative | Identifier that is displayed on the IDP or HR system, eg, if OKTA identifies you as user xyz |
remote_display_id (anyOf 2) | null | Alternative | |
role_name | JSON | Optional | |
role_name (anyOf 1) | string | Alternative | The user's role, as shown in the Brex dashboard. |
role_name (anyOf 2) | null | Alternative | |
status | JSON | Optional | |
status (anyOf 1) | JSON | Alternative | |
status (anyOf 1) (allOf 1) | string | All variants apply | Status of the user Known values: INVITED, ACTIVE, DISABLED, PENDING_ACTIVATION, INACTIVE, ARCHIVED |
status (anyOf 2) | null | Alternative | |
title_id | JSON | Optional | |
title_id (anyOf 1) | string | Alternative | |
title_id (anyOf 2) | null | Alternative |
Referenced models: Get user — response body — custom fields array item
Get user — response body — custom fields array item
Referenced models: Get user — response body — custom fields array item value The value of the custom field Boolean list value, Get user — response body — custom fields array item value The value of the custom field Boolean value, Get user — response body — custom fields array item value Base class for custom field values, Get user — response body — custom fields array item value The value of the custom field Date list value, Get user — response body — custom fields array item value The value of the custom field Date value, Get user — response body — custom fields array item value The value of the custom field Decimal list value, Get user — response body — custom fields array item value The value of the custom field Decimal value, Get user — response body — custom fields array item value The value of the custom field Enum list value, Get user — response body — custom fields array item value The value of the custom field Enum value, Get user — response body — custom fields array item value The value of the custom field Money list value, Get user — response body — custom fields array item value The value of the custom field Money value, Get user — response body — custom fields array item value The value of the custom field Option string list value, Get user — response body — custom fields array item value The value of the custom field Option string value, Get user — response body — custom fields array item value The value of the custom field String list value, Get user — response body — custom fields array item value The value of the custom field String value, Get user — response body — custom fields array item value The value of the custom field Timestamp list value, Get user — response body — custom fields array item value The value of the custom field Timestamp value
Get user — response body — custom fields array item value Base class for custom field values
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Base class for custom field values |
data_type | JSON | Required within parent | |
data_type (allOf 1) | string | All variants apply | The type of the custom field data. Known values: STRING, DECIMAL, BOOLEAN, ENUM, TIMESTAMP, DATE, MONEY, OPTION_STRING |
data_type (allOf 2) | JSON | All variants apply | The type of the custom field data. |
value_type | JSON | Required within parent | |
value_type (allOf 1) | string | All variants apply | The type of the custom field value. Known values: SINGLE_VALUE, LIST |
value_type (allOf 2) | JSON | All variants apply | The type of the custom field value. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: brex.team_getuserbyid. Catalog operation: team:getUserById. 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: ["users", "users.readonly"]