Ana içeriğe geç

Clients With No Requests Report

Endpoint

GET /apiops/projects/{projectName}/reports/inactive-clients

Unlike the other two report endpoints on this API, this one is project-scoped: the project is part of the path and is authorized before the report is built. It lists a project's authenticating identities, so it is gated on that project rather than on a platform-wide role.

Authentication

Requires a Personal API Access Token whose user holds Analytics / View permission in the project named in the path. A project the caller cannot see answers 404 — the same answer as a project that does not exist, so the endpoint cannot be used to discover project names.

A platform-scoped (administration) token has no project to read and is refused with 400 malformedRequest.

Authorization: Bearer YOUR_TOKEN

Request

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesName of the project whose identities are reported

Query Parameters

ParameterTypeRequiredDescription
environmentNamestringYesName of the environment whose traffic log is read
fromstringNoRange start, ISO-8601 or Elasticsearch date math. Default now-30d
tostringNoRange end, ISO-8601 or Elasticsearch date math. Default now
organizationCodestringNoConsumer organization code. Repeat the parameter to pass more than one
statusstringNoALL (default), ENABLED or DISABLED
includeApiClientsbooleanNoWhether API client (key) rows are listed. Default true
identityTypestringNoRestricts the answer to one row kind: CONSUMER or API_CLIENT
minUsageintegerNoLowest request count a row may have. Default 0
maxUsageintegerNoHighest request count a row may have
pageintegerNoZero-based page index
sizeintegerNoRows per page
sortstringNofield[,asc|desc] over lastUsedAt, createdAt, consumer, apiClientKey, status, identityType, total

Notes

  • References travel as names: a consumer as its username, an organization as its code, an API client as its apiClientKey. No internal identifier appears in the response.
  • A consumer's traffic is resolved from three sources and merged: requests made under its username, requests attributed to its credential record, and requests made by the API clients it owns. A consumer that only ever calls through its API client is therefore not reported as unused; it carries usedViaApiClient: true instead.
  • An organization code outside the caller's project scope matches nothing and answers 404.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"items": [
{
"identityType": "API_CLIENT",
"consumer": {
"username": "billing-service",
"fullName": "Billing Service"
},
"organization": {
"code": "FIN",
"name": "Finance"
},
"apiClient": {
"key": "ak_7f2c91d4",
"name": "Billing nightly job",
"clientId": "billing-nightly"
},
"createdAt": "2025-03-11T09:12:44Z",
"lastUsedAt": null,
"status": "ACTIVE",
"counts": {
"success": 0,
"blocked": 0,
"error": 0,
"total": 0
}
}
],
"page": 0,
"size": 20,
"totalElements": 1,
"totalPages": 1,
"sort": ["identity,asc"],
"coverage": {
"dataAvailableFrom": "2026-06-01T00:00:00Z",
"warning": "apinizerManagerApp.inactiveClients.coverageWarning",
"retentionDays": 90
}
}

Response Fields

FieldTypeDescription
identityTypestringCONSUMER for a consumer identity, API_CLIENT for a key owned by one
consumer.usernamestringOwning consumer's username
organization.codestringConsumer organization code
apiClient.keystringAPI client key; present on API_CLIENT rows only
apiClient.clientIdstringOAuth client_id of the API client, when it has one
createdAtstringWhen the identity was created. For an API client this is derived from its record
lastUsedAtstringMost recent request inside the retained traffic log; null when there is none
statusstringenabled, disabled or expired for a consumer; ACTIVE or SUSPENDED for an API client
usedViaApiClientbooleanPresent and true when the consumer itself is idle but one of its API clients is not
countsobjectRequest counts inside the requested range
coverage.dataAvailableFromstringOldest traffic-log record inside this scope
coverage.warningstringSet when the requested range is not fully covered by the traffic log
coverage.retentionDaysintegerTraffic-log retention in days, when the connector deletes old indices
Warning

lastUsedAt: null means no request inside the retained traffic log, not "never used". Read coverage.dataAvailableFrom before acting on it: a pipeline that revokes every key with a null lastUsedAt would revoke keys that were simply last used before the retention window began.

Error Responses

StatuserrorKeyWhen
400malformedRequestA platform-scoped token, or an unreadable status, identityType or page value
404resourceNotFoundUnknown project, unknown environmentName, or an organization code outside the project scope
503temporarilyUnavailableThe environment's Elasticsearch connector is disabled, unconfigured or unreachable

Example

curl -X GET \
"https://apinizer.example.com/apiops/projects/MyProject/reports/inactive-clients?environmentName=Production&from=now-90d&to=now&sort=lastUsedAt,asc" \
-H "Authorization: Bearer YOUR_TOKEN"