Skip to content
Docs

    List Audit Logs

    GET/v1/audit_logs

    List Audit Log entries for an organization

    Query ParametersExpand Collapse
    action: optional string

    Filter by recorded action

    actor_id: optional string

    Filter by the acting user or API key

    actor_type: optional "user" or "api_key"

    Filter by the kind of actor that acted

    One of the following:
    "user"
    "api_key"
    client_ip: optional string

    Filter by client IP address, matched exactly

    created_at_max: optional string

    Only entries at or before this RFC 3339 instant

    formatdate-time
    created_at_min: optional string

    Only entries at or after this RFC 3339 instant

    formatdate-time
    cursor: optional string

    Pagination cursor returned by a previous request. Only valid for the same filters and sort order.

    limit: optional number

    Maximum number of items to return

    maximum100
    minimum10
    method: optional string

    Filter by HTTP method

    path: optional string

    Filter by a case-insensitive substring of the request path

    sort: optional string

    Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, status_code

    status_code_max: optional number

    Only entries with a status code at or below this

    status_code_min: optional number

    Only entries with a status code at or above this, e.g. 400 for failures only

    target_id: optional string

    Filter by the resource acted on

    target_type: optional string

    Filter by the kind of resource acted on

    ReturnsExpand Collapse
    AuditLogList object { items, pagination }
    items: array of AuditLog { id, action, actor, 7 more }
    id: string

    Unique identifier for the audit log entry.

    action: string

    The action that was performed.

    actor: AuditLogActor { id, name, type }

    The entity that performed the action.

    id: string

    Unique identifier for the actor.

    name: string

    Display name of the actor.

    Type of actor.

    One of the following:
    "user"
    "api_key"
    client_ip: string

    Client IP address.

    created_at: string

    When the action occurred.

    formatdate-time
    method: string

    HTTP method of the request.

    path: string

    Request path.

    status_code: number

    HTTP status code of the response.

    user_agent: string

    User agent string.

    target: optional AuditLogTarget { id, type }

    The target resource of the action.

    id: string

    Unique identifier for the target resource.

    type: string

    Type of the target resource.

    List Audit Logs

    curl https://api.nirvanalabs.io/v1/audit_logs \
        -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"
    {
      "items": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "action": "vm.created",
          "actor": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "name": "Alice Smith",
            "type": "user"
          },
          "client_ip": "203.0.113.1",
          "created_at": "2025-01-01T00:00:00Z",
          "method": "GET",
          "path": "/v1/compute/vms",
          "status_code": 200,
          "user_agent": "Mozilla/5.0",
          "target": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "type": "vm"
          }
        }
      ],
      "pagination": {
        "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
        "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
        "total_count": 125
      }
    }
    Returns Examples
    {
      "items": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "action": "vm.created",
          "actor": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "name": "Alice Smith",
            "type": "user"
          },
          "client_ip": "203.0.113.1",
          "created_at": "2025-01-01T00:00:00Z",
          "method": "GET",
          "path": "/v1/compute/vms",
          "status_code": 200,
          "user_agent": "Mozilla/5.0",
          "target": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "type": "vm"
          }
        }
      ],
      "pagination": {
        "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
        "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
        "total_count": 125
      }
    }