Audit Log API

A read-only HTTP API to fetch your organization's audit log from external applications. Each request is scoped to the organization that owns the API key.

Authentication

All requests must include a Bearer token in the Authorization header. Tokens start with the prefix pck_ and are tied to a single organization. Revoked tokens return 401.

Authorization: Bearer pck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Endpoint

GET https://hnoqvrgxarrdarowlube.supabase.co/functions/v1/public-audit-log

Query parameters

NameTypeDescription
startrequiredInclusive start date (YYYY-MM-DD, UTC).
endrequiredInclusive end date (YYYY-MM-DD, UTC).
actionoptionalFilter by action code (see list below).
limitoptionalMax items per page (1–1000, default 100).
offsetoptionalPagination offset (default 0).

Example request

curl -H "Authorization: Bearer pck_xxx..." \
  "https://hnoqvrgxarrdarowlube.supabase.co/functions/v1/public-audit-log?start=2026-01-01&end=2026-01-31&action=message_created"

Example response

{
  "organization_id": "8a1b...",
  "start": "2026-01-01",
  "end": "2026-01-31",
  "total": 312,
  "limit": 100,
  "offset": 0,
  "items": [
    {
      "id": "f0c7...",
      "created_at": "2026-01-15T09:23:11.482Z",
      "action": "message_created",
      "user_email": "alice@example.com",
      "agent_name": "Supplier Radar",
      "data": {
        "message_id": "...",
        "conversation_id": "...",
        "agent_id": "...",
        "dust_agent_sid": "..."
      }
    }
  ]
}

Action codes

  • agent_addedAn agent was activated for the organization.
  • conversation_createdA user started a new conversation.
  • message_createdA user sent a message in a conversation.
  • feedback_givenA user gave thumbs up / down feedback on a message.

Rate limits

Each API key is limited to 60 requests per minute. Exceeding the limit returns HTTP 429.

Errors

  • 400Missing or invalid start / end parameters.
  • 401Missing, malformed, or revoked Bearer token.
  • 405Method not allowed (only GET is supported).
  • 429Rate limit exceeded (60 requests/minute per key).
  • 500Unexpected server error.

How to get a key

An organization administrator creates API keys from the admin console of Pivotal Chat. The token is displayed only once at creation — store it securely. Keys can be revoked at any time and immediately stop working.