Example
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "The requested audit log could not be found",
    "status": 404,
    "title": "Not Found",
    "type": "https://unkey.com/docs/api-reference/errors-v2/unkey/data/audit_log_not_found"
  }
}

What Happened?

This error occurs when you’re trying to retrieve or operate on a specific audit log entry that doesn’t exist in the Unkey system. Audit logs record important actions and events that occur within your workspace.

Common scenarios that trigger this error:

  • Using an incorrect audit log ID
  • Requesting an audit log entry that has been deleted or expired
  • Trying to access audit logs from a different workspace
  • Typographical errors in audit log identifiers

Here’s an example of a request that would trigger this error:

# Attempting to get a non-existent audit log entry
curl -X GET https://api.unkey.com/v1/audit.getLog \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "logId": "log_nonexistent"
  }'

How To Fix

Verify that you’re using the correct audit log ID and that the log entry still exists in your workspace:

  1. Check the audit log ID in your request for typos or formatting errors
  2. Use the list audit logs endpoint to find valid log IDs
  3. Verify you’re working in the correct workspace
  4. Consider that audit logs might have a retention period after which they’re automatically deleted

Here’s how to list recent audit logs in your workspace:

curl -X GET https://api.unkey.com/v1/audit.listLogs \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "limit": 10
  }'

Common Mistakes

  • Expired logs: Trying to access audit logs beyond the retention period
  • Copy-paste errors: Using incorrect log IDs from documentation examples
  • Workspace boundaries: Attempting to access logs from another workspace
  • Permission issues: Trying to access logs you don’t have permission to view