Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.logs.search({
query: "where status_code >= 400 | order by timestamp desc",
limit: 50,
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.logs.search(
query="where status_code >= 400 | order by timestamp desc",
limit=50,
)curl --request POST \
--url https://api.useautumn.com/v1/logs.search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"query": "where status_code >= 400 | order by timestamp desc",
"limit": 50
}
'{
"list": [
{
"timestamp": "2026-09-21T12:00:00.000Z",
"source": "api_request",
"status_code": 200,
"request": {
"method": "POST",
"url": "https://api.useautumn.com/v1/balances.check",
"path": "/v1/balances.check"
},
"context": {
"org_id": "org_123",
"customer_id": "cus_123",
"entity_id": null,
"auth_type": "secret_key",
"user_id": "user_123",
"user_email": "user@example.com"
},
"stripe": {
"event_id": null,
"event_type": null,
"object_id": null
},
"request_body": {
"customer_id": "cus_123"
},
"response_body": {
"allowed": true
}
}
]
}
Logs
Search Request Logs
Search API requests and incoming Stripe webhooks for your organization and environment.
POST
/
v1
/
logs.search
Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.logs.search({
query: "where status_code >= 400 | order by timestamp desc",
limit: 50,
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.logs.search(
query="where status_code >= 400 | order by timestamp desc",
limit=50,
)curl --request POST \
--url https://api.useautumn.com/v1/logs.search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"query": "where status_code >= 400 | order by timestamp desc",
"limit": 50
}
'{
"list": [
{
"timestamp": "2026-09-21T12:00:00.000Z",
"source": "api_request",
"status_code": 200,
"request": {
"method": "POST",
"url": "https://api.useautumn.com/v1/balances.check",
"path": "/v1/balances.check"
},
"context": {
"org_id": "org_123",
"customer_id": "cus_123",
"entity_id": null,
"auth_type": "secret_key",
"user_id": "user_123",
"user_email": "user@example.com"
},
"stripe": {
"event_id": null,
"event_type": null,
"object_id": null
},
"request_body": {
"customer_id": "cus_123"
},
"response_body": {
"allowed": true
}
}
]
}
Search API requests and incoming Stripe webhooks for your organization and environment.
Common Use Cases
const logs = await autumn.logs.search({
query: "where customer_id == 'cus_123' and status_code >= 400",
limit: 50,
});
const logs = await autumn.logs.search({
query: "where request_body.feature_id == 'credits' | order by timestamp desc",
range: {
startDate: new Date(Date.now() - 60 * 60 * 1000).toISOString(),
},
});
const logs = await autumn.logs.search({
query: "where source == 'stripe_webhook' and stripe_event_type == 'customer.subscription.updated'",
limit: 25,
});
Writing a query
Usewhere to filter, order by to sort, and limit to cap results. Join these steps with |. Without a query, you get the most recent logs.
Filter on fields like customer_id, status_code, request_path, and stripe_event_type. Use dot paths for body fields, such as request_body.feature_id, or contains to find text: where response_body contains 'error'.
Field names inside the query stay in snake_case, including when you use the TypeScript SDK.
By default, the search covers the last 30 minutes. Set range to search another window of up to 7 days.
Body Parameters
Response
{
"list": [
{
"timestamp": "2026-09-21T12:00:00.000Z",
"source": "api_request",
"status_code": 200,
"request": {
"method": "POST",
"url": "https://api.useautumn.com/v1/balances.check",
"path": "/v1/balances.check"
},
"context": {
"org_id": "org_123",
"customer_id": "cus_123",
"entity_id": null,
"auth_type": "secret_key",
"user_id": "user_123",
"user_email": "user@example.com"
},
"stripe": {
"event_id": null,
"event_type": null,
"object_id": null
},
"request_body": {
"customer_id": "cus_123"
},
"response_body": {
"allowed": true
}
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Filter and sort logs using where, order by, and limit, joined with |. Omit to return recent logs.
Maximum string length:
4000Time window to search. Defaults to the last 30 minutes. Maximum 7 days.
Show child attributes
Show child attributes
Maximum number of logs to return, from 1 to 200. Defaults to 100.
Required range:
1 <= x <= 200Response
200 - application/json
OK
Matching logs, newest first unless you specify an order.
Show child attributes
Show child attributes