إنتقل إلى المحتوى الرئيسي

List API Key Audit Logs

Returns append-only security and lifecycle audit events for your API key (KEY_CREATED, AUTH_FAILED, BALANCE_REJECTED, CAP_EXCEEDED, RATE_LIMITED, FRAUD_BLOCKED, PURCHASE_COMPLETED, API_CHARGE_COMPLETED).

Optional keyId must belong to the authenticated account—passing another user's keyId returns 403 FORBIDDEN.

GET/api/v1/audit
Target: https://api.example.com
curl -sS -X GET "https://api.example.com/api/v1/audit?limit=10" \
-H "x-api-key: YOUR_API_KEY" \
-H "Accept: application/json"

Query Parameters​

ParameterTypeDefaultDescription
limitinteger20Items per page (1–100).
cursorstring—Pagination cursor from nextCursor.
keyIdstringPresented key IDFilter audit logs for a specific key owned by the user (1–64 chars).

Success Response (200 OK)​

{
"items": [
{
"id": "aud_mock_001",
"action": "PURCHASE_COMPLETED",
"endpoint": "/api/v1/purchases",
"requestType": "PRODUCT_PURCHASE",
"httpStatus": 201,
"details": {
"orderId": "ord_mock_001",
"productId": "prod_win11_pro",
"quantity": 1,
"total": "12.000000"
},
"createdAt": "2026-11-30T18:10:00.000Z"
}
],
"nextCursor": null
}

Error Responses​

HTTPerror.codeCause
400VALIDATION_ERRORInvalid query parameter
401UNAUTHORIZEDInvalid, revoked, or expired key
403FORBIDDENDisabled key, suspended account, or keyId owned by another user
404NOT_FOUNDUnknown keyId
429RATE_LIMITEDRate limit exceeded
500INTERNAL_ERRORUnexpected server error