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

# List audit logs

> Returns audit logs, newest first.




## OpenAPI

````yaml /openapi-v0.yaml get /v0/audit_logs
openapi: 3.1.0
info:
  title: Decimal Chat API
  version: v0
  description: >
    ## Authentication


    All endpoints require a Bearer token:


    ```

    Authorization: Bearer sk-de-...

    ```


    API tokens are created in the Decimal dashboard under Settings → API keys.

    Every endpoint except `GET /v0/me` requires a scope, and a token without it
    gets `403` with code `forbidden`. Scopes: `chat:read`, `chat:write`,
    `chat:escalate`, `tickets:read`, `tickets:write`, `tickets:notes`,
    `tickets:reply`, `tickets:update`, `tickets:delete`, `knowledge:read`,
    `knowledge:delete`, `audit_logs:read`, `pull_requests:read`, `gaps:read`,
    `gaps:write`, `automations:read`, `customers:read`, `customers:write`.


    ## Quick Start


    ```bash

    # 1. Send a message

    curl -X POST https://api.getdecimal.ai/v0/chat \
      -H "Authorization: Bearer sk-de-..." \
      -H "Content-Type: application/json" \
      -d '{"message": "How do I configure SSO?"}'
    # → 202 { "conversation_id": "abc123", "message_id": "xyz789", "status":
    "processing" }


    # 2. Poll until complete

    curl https://api.getdecimal.ai/v0/chat/abc123 \
      -H "Authorization: Bearer sk-de-..."
    # → 200 { "status": "completed", "messages": [...] }

    ```


    ### Continue a conversation

    ```bash

    curl -X POST https://api.getdecimal.ai/v0/chat \
      -H "Authorization: Bearer sk-de-..." \
      -H "Content-Type: application/json" \
      -d '{"message": "Can you show me the SAML setup?", "conversation_id": "abc123"}'
    # → 202 { "conversation_id": "abc123", "message_id": "def456", "status":
    "processing" }

    ```


    A conversation keeps its `conversation_id` across turns. Each answer has its
    own `message_id`.


    ### Stream the answer

    ```bash

    curl -N -X POST https://api.getdecimal.ai/v0/chat \
      -H "Authorization: Bearer sk-de-..." \
      -H "Content-Type: application/json" \
      -d '{"message": "How do I configure SSO?", "stream": true}'
    # event: message.started

    # data: { "conversation_id": "abc123", "message_id": "xyz789", "status":
    "processing" }

    #

    # event: tool_call.started

    # data: { "id": "call_1", "name": "searchPublicKB", "status": "incomplete",
    "input": { "query": "configure SSO" }, "refs": [] }

    #

    # event: tool_call.completed

    # data: { "id": "call_1", "name": "searchPublicKB", "status": "completed",
    "input": { "query": "configure SSO" }, "refs": [...] }

    #

    # event: message.completed

    # data: { "conversation_id": "abc123", "message": { "role": "assistant",
    "content": "...", "message_id": "xyz789" } }

    ```


    ## Rate Limiting


    Every response includes rate limit headers:

    - `X-RateLimit-Limit`: Requests allowed per minute

    - `X-RateLimit-Remaining`: Requests remaining in current window

    - `X-RateLimit-Reset`: Unix timestamp when the window resets


    Rate limits apply at two levels:

    - **Per API token:** 120 requests/min

    - **Per organization:** 600 requests/min across all tokens


    Some endpoints also have a lower per-organization limit of their own.

    The stricter limit applies. Headers report the limit with the fewest
    requests remaining.

    Contact support for higher limits.


    ## Idempotency


    Endpoints that create something accept an `Idempotency-Key` header. Retrying
    with the

    same key within 24 hours returns the original response instead of running
    the request

    again, with an `Idempotent-Replayed: true` header. Only successful responses
    are saved,

    so a request that failed can be retried with the same key. Reusing a key for
    a

    different path or request body returns `409 Conflict`.


    ## Request IDs


    Every response includes a `Request-Id` header. Include it when you contact
    support.
  contact:
    name: Decimal Support
    url: https://getdecimal.ai
servers:
  - url: https://api.getdecimal.ai
    description: Production
  - url: http://localhost:3000
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: Chat
    description: >-
      Send messages and get AI-powered answers from your public knowledge base
      and code.
  - name: Escalation
    description: Escalate conversations to external ticketing integrations.
  - name: Tickets
    description: Manage tickets synced from your helpdesk.
  - name: Pull requests
    description: Read pull requests from your connected repositories.
  - name: Knowledge gaps
    description: Read changes Decimal proposes to your knowledge base, docs, and code.
  - name: Automations
    description: >-
      Read your automations: what starts them, what they do, and how their runs
      went.
  - name: Audit logs
    description: Read who did what in your organization. Requires audit logs on your plan.
  - name: Knowledge
    description: Read and delete the articles your AI agent answers from.
  - name: Customers
    description: >-
      Manage the companies you support. Requires customers to be enabled for
      your organization.
  - name: Utility
    description: Token introspection.
paths:
  /v0/audit_logs:
    get:
      tags:
        - Audit logs
      summary: List audit logs
      description: |
        Returns audit logs, newest first.
      operationId: listAuditLogs
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/StartingAfter'
        - name: service
          in: query
          required: false
          schema:
            type: string
          description: 'Only events from this service: `app`, `api`, or `system`.'
        - name: event
          in: query
          required: false
          schema:
            type: string
          description: Only this event, such as `ticket.deleted`.
        - name: created_after
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: Only events after this time.
        - name: created_before
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: Only events before this time.
      responses:
        '200':
          description: A page of audit logs.
          headers:
            Request-Id:
              $ref: '#/components/headers/Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - BearerAuth:
            - audit_logs:read
components:
  parameters:
    Limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
      description: Number of results to return.
    StartingAfter:
      name: starting_after
      in: query
      required: false
      schema:
        type: integer
      description: ID of the last result on the previous page. Returns the next page.
  headers:
    Request-Id:
      description: Unique ID for this request. Include it when you contact support.
      schema:
        type: string
    X-RateLimit-Limit:
      description: Maximum requests allowed per minute.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp when the rate limit window resets.
      schema:
        type: integer
  schemas:
    AuditLogList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AuditLog'
        has_more:
          type: boolean
      required:
        - data
        - has_more
    AuditLog:
      type: object
      properties:
        id:
          type: integer
        event:
          type: string
          description: What happened, as `resource.action`.
        service:
          type: string
          description: 'Where it happened: `app`, `api`, or `system`.'
        user:
          description: Who did it. `null` for system and API token actions.
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            name:
              type:
                - string
                - 'null'
            email:
              type:
                - string
                - 'null'
          required:
            - id
            - name
            - email
        metadata:
          description: Details of the event. Shape varies by event.
          type:
            - object
            - 'null'
          additionalProperties: {}
        created_at:
          type: string
          format: date-time
      required:
        - id
        - event
        - service
        - user
        - metadata
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unauthorized
                - forbidden
                - not_found
                - conflict
                - payment_required
                - rate_limited
                - internal_error
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable error message.
            retryable:
              description: Whether the client should retry the request.
              type: boolean
          required:
            - code
            - message
      required:
        - error
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: bad_request
              message: Invalid JSON in request body
    Unauthorized:
      description: >-
        Missing or invalid API key. Correct the Authorization header before
        retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or expired API token
    Forbidden:
      description: Valid API key but insufficient scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: Insufficient permissions
    RateLimited:
      description: Rate limit exceeded.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          description: Seconds until the rate limit resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Too many requests
              retryable: true
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: An internal error occurred
              retryable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        API token with `sk-de-` prefix.
        Created in the Decimal dashboard under Settings → API Tokens.

````

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