Skip to content

Audit Logs

GET /api/audit-logs

Returns a paginated list of audit log entries for the authenticated user’s organization, newest first. Audit logs record actions like API key creation, deletion, profile updates, and proxy endpoint changes.

Auth required: Yes

ParameterTypeDescription
cursorstringPagination cursor from previous response
limitnumberItems per page (1–100, default 20)
{
"items": [
{
"id": "a1b2c3d4-...",
"user_id": "...",
"org_id": "...",
"action": "api_key.created",
"resource_type": "api_key",
"resource_id": "550e8400-...",
"metadata": "{\"name\":\"CLI - MacBook Pro\"}",
"created_at": "2026-03-17T01:00:00.000Z"
}
],
"nextCursor": "2026-03-17T01:00:00.000Z|a1b2c3d4-...",
"hasMore": false
}
FieldTypeDescription
idstringUnique audit log ID
user_idstringID of the user who performed the action
org_idstringOrganization ID
actionstringAction identifier (e.g. api_key.created, proxy_endpoint.deleted)
resource_typestringType of resource affected (e.g. api_key, proxy_endpoint, profile)
resource_idstring | nullID of the affected resource
metadatastring | nullJSON string with additional context
created_atstringISO timestamp of when the action occurred
Terminal window
curl "https://codecosts.com/api/audit-logs?limit=10" \
-H "Authorization: Bearer $CODECOSTS_API_KEY"