SDK ReferenceTypeScript SDK
Logs
Usage
Access this class through the composio.logs property:
const composio = new Composio({ apiKey: 'your-api-key' });
const result = await composio.logs.list();Methods
get()
Retrieve one tool-execution log with its full detail (timings, context,
source and raw data).
async get(id: string, requestOptions?: ComposioRequestOptions): Promise<ToolExecutionLogDetail>Parameters
| Name | Type | Description |
|---|---|---|
id | string | The log id |
requestOptions? | ComposioRequestOptions |
Returns
Promise<ToolExecutionLogDetail> — The log detail, with an optional exact USD charge in metadata.instant_charge
Example
const log = await composio.logs.get('log_abc123');
console.log(log.status, log.timings?.endTime);search()
Search tool-execution logs with filters, a time range and cursor pagination.
async search(params?: LogSearchParams, requestOptions?: ComposioRequestOptions): Promise<LogSearchResponse>Parameters
| Name | Type | Description |
|---|---|---|
params? | LogSearchParams | Filters, timeRange, limit and cursor |
requestOptions? | ComposioRequestOptions |
Returns
Promise<LogSearchResponse> — Matching logs and the next cursor. Charged calls include metadata.instant_charge as an exact USD string.
Example
const { logs } = await composio.logs.search({
filters: [
{ field: 'status', operator: '==', value: 'failed' },
{ field: 'user_id', operator: '==', value: 'user_123' },
],
timeRange: { from: Date.now() - 24 * 60 * 60 * 1000, to: Date.now() },
});