Query Logs

Beta
Returns historical worker logs for a project within a time window. Supports filtering by HTTP method, status code, URL, and minimum severity level, plus cursor-based pagination. The `start` and `end` query parameters are both required, and the window between them cannot exceed 7 days. > **Note**: To stream logs in real time instead, use the [Tail Worker Logs](#tail-worker-logs) endpoint.

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Infrastructure Deployments | read-only | `store_infrastructure_deployments_read_only` | | Infrastructure Deployments | create preview | `store_infrastructure_deployments_create_preview` | | Infrastructure Deployments | manage | `store_infrastructure_deployments_manage` | | Infrastructure Projects | read-only | `store_infrastructure_projects_read_only` | | Infrastructure Projects | manage | `store_infrastructure_projects_manage` | | Infrastructure Logs | read-only | `store_infrastructure_logs_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

project_uuidstringRequiredformat: "uuid"
The UUID of the project to query logs for.
store_hashstringRequired
Permanent ID of the BigCommerce store.

Query parameters

startstringRequired

The start of the time window to query. Accepts an RFC 3339 timestamp or a Unix epoch in seconds. Must be before end.

endstringRequired

The end of the time window to query. Accepts an RFC 3339 timestamp or a Unix epoch in seconds. The window between start and end cannot exceed 7 days.

methodstringOptional

Filter logs by HTTP method, for example GET.

status_codeintegerOptional
Filter logs by HTTP response status code. Must be between 100 and 599.
url:likestringOptional
Filter logs by a partial match on the request URL.
level:minenumOptional
Filter logs to only those at or above the given severity level.
Allowed values:
limitintegerOptionalDefaults to 50
The number of results to return per page. Defaults to 50.
afterstringOptional
Cursor for forward pagination. Returns results after this cursor.
beforestringOptional
Cursor for backward pagination. Returns results before this cursor.

Response

The request completed successfully.
datalist of objects
metaobject

Meta information including cursor-based pagination.

Errors

400
Bad Request Error
404
Not Found Error
422
Unprocessable Entity Error