Skip to navigation

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 endpoint.

Authentication

X-Auth-Tokenstring

OAuth scopes

UI NamePermissionParameter
Infrastructure Deploymentsread-onlystore_infrastructure_deployments_read_only
Infrastructure Deploymentscreate previewstore_infrastructure_deployments_create_preview
Infrastructure Deploymentsmanagestore_infrastructure_deployments_manage
Infrastructure Projectsread-onlystore_infrastructure_projects_read_only
Infrastructure Projectsmanagestore_infrastructure_projects_manage
Infrastructure Logsread-onlystore_infrastructure_logs_read_only

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API 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 objectsOptional
metaobjectOptional

Meta information including cursor-based pagination.

Errors

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