Logs
List Logs
Get a list of logs for the Tenant.
The retention of logs available within a single request is defined by your Tenant's "Log Retention" Quota.
GET
https://api.basistheory.com/logsPermissions
log:read
Request
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/logs" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
const response = await client.logs.list();
for await (const item of response) {
console.log(item);
}
// Or you can manually iterate page-by-page
const page = await client.logs.list();
while (page.hasNextPage()) {
page = page.getNextPage();
}
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const logs = await bt.logs.list();
await client.Logs.ListAsync(new LogsListRequest());
response = client.logs.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
Query Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
entity_type | false | string | null | An optional entity type to filter the list of logs by. (e.g., token , card , bank , application , tenant ) |
entity_id | false | string | null | The unique identifier of the entity_type to filter the list of logs by. |
start_date | false | date | null | An ISO 8601 formatted date to filter logs where created_at is greater than or equal to |
end_date | false | date | null | An ISO 8601 formatted date to filter logs where created_at is less than |
Response
Returns a cursor paginated object with the data
property containing an array of logs. Providing any query parameters will filter the results. Returns an error if logs could not be retrieved.
{
"pagination": {...},
"data": [
{
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"actor_id": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"actor_type": "application",
"entity_type": "token",
"entity_id": "c06d0789-0a38-40be-b7cc-c28a718f76f1",
"operation": "read",
"message": "Token retrieved",
"created_at": "2021-03-01T08:23:14+00:00"
},
{...},
{...}
]
}
List Entity Types
Get a list of entity types that may be referenced from the logs.
GET
https://api.basistheory.com/logs/entity-typesPermissions
log:read
Request
- cURL
- Node
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/logs/entity-types" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
await client.logs.getEntityTypes();
await client.Logs.GetEntityTypesAsync();
client.logs.get_entity_types()
Response
Returns a non-paginated array of entity types.
[
{
"display_name": "Application",
"value": "application"
},
{
"display_name": "Bank",
"value": "bank"
},
{
"display_name": "Card",
"value": "card"
},
{
"display_name": "Proxy",
"value": "proxy"
},
...
]
Log Object
Attribute | Type | Description |
---|---|---|
tenant_id | uuid | The Tenant ID which owns the entity |
actor_id | uuid | (Optional) The ID of the actor which performed the operation |
actor_type | string | (Optional) The type of actor which performed the operation (e.g., user , application ) |
entity_type | string | The entity type of the log (e.g., token , card , bank , application , tenant ) |
entity_id | string | The unique identifier of the entity_type |
operation | string | The log operation (e.g., create, update, read, delete) |
message | string | The log message |
created_at | date | Created date of the token in ISO 8601 format |
Entity Type Object
Attribute | Type | Description |
---|---|---|
display_name | string | A readable string name for the entity type |
value | string | The system name of the entity. Referenced by a log's entity_type |