Skip to content
Get started

Get Account By ID

v1.accounts.get_account_by_id(intaccount_id) -> AccountGetAccountByIDResponse
GET/v1/accounts/{account_id}

Fetch account details by ID

ParametersExpand Collapse
account_id: int
ReturnsExpand Collapse
class AccountGetAccountByIDResponse:
data: Account

Represents a trading account

id: int

The unique identifier for the account

formatint64
account_holder_entity_id: int

The account holder entity identifier

formatint64
full_name: str

The full legal name of the account

open_date: date

The date the account was opened

formatdate
options_level: int

The options level of the account

formatint64
short_name: str

The short name of the account

The current status of the account

One of the following:
"ACTIVE"
"INACTIVE"
"CLOSED"

The sub-type of account

One of the following:
"CASH"
"MARGIN"
"OTHER"

The type of account

One of the following:
"CUSTOMER"
"OTHER"
close_date: Optional[date]

The date the account was closed, if applicable

formatdate

Get Account By ID

from clear_street import ClearStreet

client = ClearStreet(
    api_key="My API Key",
)
response = client.v1.accounts.get_account_by_id(
    0,
)
print(response)
{
  "data": {
    "account_holder_entity_id": 987654321,
    "close_date": null,
    "full_name": "Test Trading Account",
    "id": 19816,
    "open_date": "2023-01-15",
    "short_name": "TST-ACCOUNT-01",
    "status": "ACTIVE",
    "subtype": "MARGIN",
    "type": "CUSTOMER"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "data": {
    "account_holder_entity_id": 987654322,
    "close_date": "2024-08-01",
    "full_name": "Old Test Account",
    "id": 19817,
    "open_date": "2021-05-20",
    "short_name": "TST-ACCOUNT-02-CLOSED",
    "status": "CLOSED",
    "subtype": "CASH",
    "type": "CUSTOMER"
  },
  "error": null,
  "metadata": {
    "request_id": "c8f3e4a5-b2c3-5d4e-9f0a-6b7c8d9e0f1a"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}
Returns Examples
{
  "data": {
    "account_holder_entity_id": 987654321,
    "close_date": null,
    "full_name": "Test Trading Account",
    "id": 19816,
    "open_date": "2023-01-15",
    "short_name": "TST-ACCOUNT-01",
    "status": "ACTIVE",
    "subtype": "MARGIN",
    "type": "CUSTOMER"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "data": {
    "account_holder_entity_id": 987654322,
    "close_date": "2024-08-01",
    "full_name": "Old Test Account",
    "id": 19817,
    "open_date": "2021-05-20",
    "short_name": "TST-ACCOUNT-02-CLOSED",
    "status": "CLOSED",
    "subtype": "CASH",
    "type": "CUSTOMER"
  },
  "error": null,
  "metadata": {
    "request_id": "c8f3e4a5-b2c3-5d4e-9f0a-6b7c8d9e0f1a"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}