ApiRequest

The API request log: every write and every failed request made with your keys and sessions (successful reads aren't logged), newest first.

page = noclick.ApiRequest.list_page(method="POST", status="4xx", key="nk_live_ab12")
class ApiRequest

One logged API request.

Attributes
idstring
actorstring | null

key, session or owner.

keyIdstring | null
userIdstring | null
sessionIdstring | null
methodstring
routestring

The route template, e.g. /v1/agents/{agent_id}/messages.

pathParamsJsonObject
statusnumber | null
errorTypestring | null
durationMsnumber | null
idempotencyReplayedboolean
operationIdstring | null

The operation the request started, if any.

requestIdstring | null
createdAtDate | null
rawJsonObject

The response JSON exactly as the API sent it.

liststatic

static list(
  options?: ApiRequestFilters & { limit?: number },
): Promise<ApiRequest[]>

Every matching request (or the first limit).

Parameters
options.methodstring
options.statusstring | number

A class (2xx, 4xx, 5xx) or one code.

options.errorTypestring

An error type such as spend_cap_exceeded.

options.keystring

A key id or prefix.

options.routestring

A route template such as /v1/policy.

options.sinceDate | string
options.untilDate | string
options.limitnumber

Return at most this many.

options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

Every matching request, newest first, fetched page by page.

listPagestatic

static listPage(
  options?: ApiRequestFilters & PageOptions,
): Promise<Page<ApiRequest>>

One page of matching requests; pass nextCursor back as cursor.

Parameters
options.cursorstring | null

The next_cursor of the page before; omit it for the first page.

options.limitnumber

Return at most this many.

options.methodstring
options.statusstring | number

A class (2xx, 4xx, 5xx) or one code.

options.errorTypestring

An error type such as spend_cap_exceeded.

options.keystring

A key id or prefix.

options.routestring

A route template such as /v1/policy.

options.sinceDate | string
options.untilDate | string
options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

A page whose data holds up to limit requests (at most 200) and whose next_cursor is None on the last page.