> ## Documentation Index
> Fetch the complete documentation index at: https://plainrouter.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Export the workspace audit log

> Download the member audit export with pseudonymous consent proof. Account-bound keys are refused. Only explicit new grants admit this read.



## OpenAPI

````yaml https://plainrouter.com/openapi.json get /workspaces/{workspace}/admin/audit-events
openapi: 3.1.0
info:
  title: Plainrouter Conversion API
  version: 0.5.0
  description: Plainrouter public Signals Conversion API.
servers:
  - url: https://plainrouter.com/api/v1
    description: Production
security:
  - workspaceSecret: []
paths:
  /workspaces/{workspace}/admin/audit-events:
    get:
      tags:
        - ActionAuditExportApi
      summary: Export the workspace audit log
      description: >-
        Download the member audit export with pseudonymous consent proof.
        Account-bound keys are refused. Only explicit new grants admit this
        read.
      operationId: get_audit_events
      parameters:
        - name: workspace
          in: path
          required: true
          description: The workspace ID
          schema:
            type: integer
        - name: limit
          in: query
          description: Events per page, ordered by sequence.
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 500
        - name: cursor
          in: query
          description: >-
            Opaque next_cursor with after_sequence semantics; keep the same
            workspace, from and to.
          schema:
            type: string
            maxLength: 4096
        - name: from
          in: query
          description: >-
            Inclusive created_at lower bound, years 0001 through 9999; optional,
            with no default time restriction.
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: >-
            Inclusive created_at upper bound, years 0001 through 9999; must be
            at or after from when both are supplied.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Exact web export event fields, in ascending sequence order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ActionAuditExportEvent'
                    maxItems: 500
                  next_cursor:
                    type:
                      - string
                      - 'null'
                  note:
                    type: string
                    description: >-
                      hash_version 2 uses SHA-256 of the canonical durable event
                      fields. Null hash_version marks a legacy segment whose
                      original hashes cannot be recomputed. Its single
                      audit.legacy_checkpoint freezes a canonical snapshot
                      digest of that segment. Verification covers the current
                      database snapshot; detecting tail deletion requires
                      comparing a previously saved head hash and sequence.
                      Recognised assignments: name=value (also name[]= and
                      parent[name]=) in URLs, fragments and form bodies; "name":
                      value in JSON, including JSON nested in strings; name:
                      value and name => value for compound names or quoted,
                      bracketed or braced names; payload key names. Names are
                      trimmed and matched case-insensitively: access_token,
                      appsecret_proof, client_secret, refresh_token, signature,
                      token, secret and password. Bare token, signature, secret
                      and password colon/arrow forms require quotes, brackets or
                      braces. The JSON object key code is preserved; code is
                      redacted only as a parameter. Up to six rounds of
                      JSON-escape, percent and HTML-entity decoding are applied.
                      Recognised remaining assignments are exported whole as
                      [redacted]; changed payload keys are renamed without
                      overwriting other entries. Independently, substrings
                      matching /EAA[A-Za-z0-9]{30,}/ are redacted from Meta
                      provider response bodies before storage and hashing, and
                      from exported payloads, actor names and summaries, without
                      requiring a credential name. HTTP(S) URL user-info is
                      redacted from exported payload strings, including JSON
                      strings; an @ in a URL query or fragment does not trigger
                      this user-info rule. This URL user-info rule does not
                      change stored provider response bodies. thumbnail_url
                      query strings are removed. Other encodings of non-Meta
                      secrets are not guaranteed to be caught: the assignment
                      rules do not recognise look-alike names, base64/base64url,
                      name/value pairs, Authorization headers, JS hex escapes or
                      unnamed free text. The EAA backstop covers these only
                      where the matching token text is intact. A changed event
                      includes redacted: true. Clients cannot recompute its
                      event_hash and should use the verify endpoint, which
                      checks the original stored bytes. Member export consent
                      proof: signal.consent_decision_recorded and
                      signal.consent_withdrawal_received payloads include
                      visitor-linked event_id, consent_state and timestamps.
                      event_id is pseudonymous to outsiders but may be a
                      merchant order or Stripe identifier.
                required:
                  - data
                  - next_cursor
                  - note
        '401':
          description: >-
            Workspace key missing, expired, revoked or no longer valid for its
            issuer or bound account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: >-
            The key lacks read ability, an explicit operation grant or current
            workspace membership, or is bound to one ad account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: >-
            Workspace outside the credential binding or unavailable; no audit
            data is returned.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorMessage'
                  - $ref: '#/components/schemas/ApiRouteNotFound'
        '422':
          description: Invalid page size, time window or continuation cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: The shared API limit of 120 requests per minute per key is exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          headers:
            Retry-After:
              description: Seconds until retry is allowed.
              required: true
              schema:
                type: integer
      security:
        - workspaceExportKey: []
components:
  schemas:
    ActionAuditExportEvent:
      type: object
      properties:
        id:
          type: string
        workspace_id:
          type: integer
        action_batch_id:
          type:
            - string
            - 'null'
        proposed_action_id:
          type:
            - string
            - 'null'
        event_type:
          type: string
        actor_type:
          type: string
        actor_id:
          type:
            - string
            - 'null'
        actor_name:
          type: string
          description: >-
            Workspace member or principal display name with substrings matching
            /EAA[A-Za-z0-9]{30,}/ redacted; may contain a member email used as a
            display name.
        summary:
          type: string
          description: >-
            Stored audit summary with substrings matching /EAA[A-Za-z0-9]{30,}/
            redacted; some decision and policy events include the workspace
            member name.
        payload:
          description: >-
            Recognised assignments: name=value (also name[]= and parent[name]=)
            in URLs, fragments and form bodies; "name": value in JSON, including
            JSON nested in strings; name: value and name => value for compound
            names or quoted, bracketed or braced names; payload key names. Names
            are trimmed and matched case-insensitively: access_token,
            appsecret_proof, client_secret, refresh_token, signature, token,
            secret and password. Bare token, signature, secret and password
            colon/arrow forms require quotes, brackets or braces. The JSON
            object key code is preserved; code is redacted only as a parameter.
            Up to six rounds of JSON-escape, percent and HTML-entity decoding
            are applied. Recognised remaining assignments are exported whole as
            [redacted]; changed payload keys are renamed without overwriting
            other entries. Independently, substrings matching
            /EAA[A-Za-z0-9]{30,}/ are redacted from Meta provider response
            bodies before storage and hashing, and from exported payloads, actor
            names and summaries, without requiring a credential name. HTTP(S)
            URL user-info is redacted from exported payload strings, including
            JSON strings; an @ in a URL query or fragment does not trigger this
            user-info rule. This URL user-info rule does not change stored
            provider response bodies. thumbnail_url query strings are removed.
            Other encodings of non-Meta secrets are not guaranteed to be caught:
            the assignment rules do not recognise look-alike names,
            base64/base64url, name/value pairs, Authorization headers, JS hex
            escapes or unnamed free text. The EAA backstop covers these only
            where the matching token text is intact.
            signal.consent_decision_recorded and
            signal.consent_withdrawal_received include pseudonymous event_id,
            consent_state (including captured_at and provenance) and event
            timestamps; withdrawals also include withdrawal_received_at and
            audience_removal_deadline. event_id can be a merchant order or
            Stripe identifier; this proof is not anonymous.
          anyOf:
            - type: object
              additionalProperties: {}
            - type: array
              items: {}
            - type: 'null'
        sequence:
          type: integer
        previous_hash:
          type:
            - string
            - 'null'
        event_hash:
          type: string
        hash_version:
          type:
            - integer
            - 'null'
        created_at:
          type: string
          format: date-time
        redacted:
          type: boolean
          description: >-
            Present and true when output redaction changed this payload, actor
            name or summary. Its event_hash covers the original stored bytes:
            clients cannot recompute it from this event and should use the
            verify endpoint.
      required:
        - id
        - workspace_id
        - action_batch_id
        - proposed_action_id
        - event_type
        - actor_type
        - actor_id
        - actor_name
        - summary
        - payload
        - sequence
        - previous_hash
        - event_hash
        - hash_version
        - created_at
      title: ActionAuditExportEvent
    ErrorMessage:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: ErrorMessage
    ApiRouteNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - api_route_not_found
            message:
              type: string
            resolution:
              type: string
          required:
            - code
            - message
            - resolution
        request:
          type: object
          properties:
            method:
              type: string
            path:
              type: string
          required:
            - method
            - path
        resources:
          type: object
          properties:
            documentation:
              type: string
            openapi:
              type: string
          required:
            - documentation
            - openapi
      required:
        - error
        - request
        - resources
      title: ApiRouteNotFound
    ValidationError:
      type: object
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - errors
      title: ValidationError
  securitySchemes:
    workspaceSecret:
      type: http
      description: >-
        Per-workspace Server secret. It authenticates only the Signals workspace
        represented by the credential.
      scheme: bearer
    workspaceExportKey:
      type: http
      description: >-
        Workspace read key whose stored grant explicitly names the operation.
        Existing grants are not expanded.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.