Skip to main content
API key events track the creation, modification, status changes, and access patterns of API keys used to authenticate with the Centure API. These events record security-relevant actions including key revocation, configuration changes, and detail views.
All API key events include the standard actor, targets, context, and metadata fields. The schemas below show event-specific fields.

api_key.create

Records when a new API key is created for a project.

Triggered When

User creates an API key via the “Create API Key” form in a project’s API keys page.

Event Schema

action
string
required
api_key.create
targets
array
required
metadata.source
string
required
Page route where API key was created: /projects/[projectId]/api-keys/new
metadata.expiration_date
string
ISO 8601 timestamp when key expires (null if no expiration set)
metadata.ip_addresses
string
Comma-separated list of allowed IP addresses/CIDR blocks (null if no restrictions)

Example Event

{
  "action": "api_key.create",
  "occurredAt": "2025-01-15T10:30:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "api_key",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Production API Key",
      "metadata": {
        "name": "Production API Key",
        "environment": "production",
        "project_id": "proj_01JGXYZ789",
        "organization_id": "org_01JGXYZ456"
      }
    },
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {
    "source": "/projects/proj_01JGXYZ789/api-keys/new",
    "expiration_date": "2025-12-31T23:59:59.000Z",
    "ip_addresses": "203.0.113.0/24,198.51.100.42"
  }
}

api_key.update

Records when an API key’s configuration is modified (name, expiration, or IP restrictions).

Triggered When

User updates an API key’s settings via the edit forms on the API key details page (name, expiration date, or IP address restrictions).

Event Schema

action
string
required
api_key.update
targets
array
required
metadata.changes
string
required
JSON string containing changed fields with from and to values. Possible fields: name, expiration_date, ip_addresses

Example Event

{
  "action": "api_key.update",
  "occurredAt": "2025-01-15T14:20:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "api_key",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Production API Key - Updated",
      "metadata": {
        "name": "Production API Key - Updated",
        "project_id": "proj_01JGXYZ789",
        "organization_id": "org_01JGXYZ456"
      }
    },
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {
    "changes": "{\"name\":{\"from\":\"Production API Key\",\"to\":\"Production API Key - Updated\"},\"expiration_date\":{\"from\":\"2025-12-31T23:59:59.000Z\",\"to\":\"2026-12-31T23:59:59.000Z\"}}"
  }
}

api_key.update_status

Records when an API key’s status changes between active and paused states.

Triggered When

User activates or pauses an API key via the status action buttons on the API key details page. This event is NOT triggered for revocations (see api_key.revoke).

Event Schema

action
string
required
api_key.update_status
targets
array
required
metadata.status_from
string
required
Previous status (active or paused)
metadata.status_to
string
required
New status (active or paused)

Example Event

{
  "action": "api_key.update_status",
  "occurredAt": "2025-01-15T16:45:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "api_key",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Production API Key",
      "metadata": {
        "name": "Production API Key",
        "project_id": "proj_01JGXYZ789",
        "organization_id": "org_01JGXYZ456"
      }
    },
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {
    "status_from": "active",
    "status_to": "paused"
  }
}

api_key.revoke

Records when an API key is permanently revoked (cannot be reversed).

Triggered When

User revokes an API key via the “Revoke” action button on the API key details page. Revoked keys cannot be reactivated.

Event Schema

action
string
required
api_key.revoke
targets
array
required
metadata
object
required
Empty object (no event-specific metadata)

Example Event

{
  "action": "api_key.revoke",
  "occurredAt": "2025-01-16T09:15:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "api_key",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Production API Key",
      "metadata": {
        "name": "Production API Key",
        "project_id": "proj_01JGXYZ789",
        "organization_id": "org_01JGXYZ456"
      }
    },
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {}
}

api_key.view_details

Records when a user views an API key’s detailed configuration page.

Triggered When

User navigates to an API key’s details page to view its configuration, statistics, and usage history.

Event Schema

action
string
required
api_key.view_details
targets
array
required
metadata.source
string
required
Page route where details were viewed: /projects/[projectId]/api-keys/[apiKeyId]

Example Event

{
  "action": "api_key.view_details",
  "occurredAt": "2025-01-15T11:00:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "api_key",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Production API Key",
      "metadata": {
        "name": "Production API Key",
        "environment": "production",
        "status": "active",
        "project_id": "proj_01JGXYZ789",
        "organization_id": "org_01JGXYZ456"
      }
    },
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {
    "source": "/projects/proj_01JGXYZ789/api-keys/550e8400-e29b-41d4-a716-446655440000"
  }
}

api_key.list

Records when a user views the list of API keys for a project.

Triggered When

User navigates to a project’s API keys page to view all keys in that project.

Event Schema

action
string
required
api_key.list
targets
array
required
metadata.source
string
required
Page route where list was viewed: /projects/[projectId]/api-keys

Example Event

{
  "action": "api_key.list",
  "occurredAt": "2025-01-15T10:00:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {
    "source": "/projects/proj_01JGXYZ789/api-keys"
  }
}

api_key.delete

Records when an API key is permanently deleted from a project.

Triggered When

User deletes an API key via the delete action on the API key details page or list view.

Event Schema

action
string
required
api_key.delete
targets
array
required
metadata.source
string
required
Page route where API key was deleted: /projects/[projectId]/api-keys

Example Event

{
  "action": "api_key.delete",
  "occurredAt": "2025-01-16T10:30:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "api_key",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Production API Key",
      "metadata": {
        "name": "Production API Key",
        "project_id": "proj_01JGXYZ789",
        "organization_id": "org_01JGXYZ456"
      }
    },
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {
    "source": "/projects/proj_01JGXYZ789/api-keys/abcd123"
  }
}

api_key.list_usage

Records when a user views or filters the usage history for an API key.

Triggered When

User views the usage section on an API key’s details page, or applies filters (date range, classification, pagination) to the usage results.

Event Schema

action
string
required
api_key.list_usage
targets
array
required
metadata.source
string
required
Page route where usage was viewed: /projects/[projectId]/api-keys/[apiKeyId]
metadata.start_date
string
ISO 8601 timestamp for usage query start date (null if not filtered)
metadata.end_date
string
ISO 8601 timestamp for usage query end date (null if not filtered)
metadata.classification
string
Filter for scan result classification: safe, unsafe, unknown, or null if not filtered
metadata.page
string
required
Current page number (1-indexed)
metadata.limit
string
required
Number of results per page
metadata.total_results
string
required
Total number of usage records matching filters

Example Event

{
  "action": "api_key.list_usage",
  "occurredAt": "2025-01-15T12:30:00.000Z",
  "version": 1,
  "actor": {
    "type": "user",
    "id": "user_01JGXYZ123",
    "name": "Alice Johnson",
    "metadata": {
      "first_name": "Alice",
      "last_name": "Johnson",
      "email": "[email protected]",
      "impersonator_email": "",
      "impersonator_reason": ""
    }
  },
  "targets": [
    {
      "type": "api_key",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Production API Key",
      "metadata": {
        "name": "Production API Key",
        "environment": "production",
        "project_id": "proj_01JGXYZ789",
        "organization_id": "org_01JGXYZ456"
      }
    },
    {
      "type": "project",
      "id": "proj_01JGXYZ789",
      "name": "AI Assistant",
      "metadata": {
        "name": "AI Assistant",
        "organization_id": "org_01JGXYZ456"
      }
    }
  ],
  "context": {
    "location": "192.0.2.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
  },
  "metadata": {
    "source": "/projects/proj_01JGXYZ789/api-keys/550e8400-e29b-41d4-a716-446655440000",
    "start_date": "2025-01-01T00:00:00.000Z",
    "end_date": "2025-01-15T23:59:59.000Z",
    "classification": "unsafe",
    "page": "1",
    "limit": "50",
    "total_results": "342"
  }
}