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

# Retrieve an audit event

> Returns one audit event of the API key's environment. Only an API key can call this endpoint.



## OpenAPI

````yaml /openapi.json get /audit_events/{id}
openapi: 3.1.0
info:
  title: End Close API
  description: REST API is used to interact with the End Close platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.endclose.com/v1
security:
  - ApiKeyAuth: []
paths:
  /audit_events/{id}:
    get:
      summary: Retrieve an audit event
      description: >-
        Returns one audit event of the API key's environment. Only an API key
        can call this endpoint.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Audit event retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditEvent'
        '401':
          description: Unauthorized
        '403':
          description: The key is not an API key. Agent run keys cannot read audit events.
        '404':
          description: Audit event not found in this environment
components:
  schemas:
    AuditEvent:
      type: object
      description: >-
        One audited action: who (`actor`) did what (`action`) to what
        (`target`), when, from where, and what changed. Events are append-only:
        End Close never changes or deletes an event after it is recorded.
      properties:
        id:
          type: string
          format: uuid
        action:
          type: string
          description: >-
            What happened, as `<subject>.<verb>`. For example
            `reconciliation_rule.updated`, `reconciliation_match.created` or
            `api_key.deleted`.
        occurred_at:
          type: string
          format: date-time
          description: When the action happened, in UTC with millisecond precision.
        actor:
          type: object
          description: >-
            Who acted. The label is the value the actor had when the event was
            recorded, so the event still reads after the actor is removed.
          properties:
            type:
              type: string
              enum:
                - user
                - api_key
                - agent
                - system
              description: >-
                `user` is a person signed in to End Close. `api_key` is one of
                your API keys. `agent` is an End Close agent acting through one
                of its runs. `system` is End Close itself, such as a scheduled
                job.
            id:
              type: string
              nullable: true
              description: The actor's id. Null for `system`.
            label:
              type: string
              nullable: true
              description: >-
                A display value: the person's WorkOS user id, the API key's
                masked token, or the agent's name. An API key's full token is
                never stored.
        target:
          type: object
          nullable: true
          description: What was acted on. Null when the action has no single target.
          properties:
            type:
              type: string
              description: >-
                The kind of object, such as `Reconciliation`,
                `ReconciliationRule` or `APIKey`.
            id:
              type: string
              description: The object's id.
            label:
              type: string
              nullable: true
              description: The object's name when the event was recorded.
        changes:
          type: object
          additionalProperties:
            type: array
            minItems: 2
            maxItems: 2
            items: {}
          description: >-
            The changed attributes, as `{ "attribute": [before, after] }`. Empty
            when nothing was changed in place. Secrets and tokens are redacted.
        metadata:
          type: object
          additionalProperties: true
          description: >-
            More detail for the action, such as the record ids of a manual match
            and its `adjustment_reason`. Its keys depend on the action.
        source:
          type: string
          description: >-
            How the action reached End Close, such as `web`, `api`, `mcp`, `job`
            or `system`.
        environment_id:
          type: string
          format: uuid
        request_id:
          type: string
          nullable: true
          description: The id of the request that caused the action, when there was one.
        ip_address:
          type: string
          nullable: true
          description: The IP address of the request, when there was one.
        user_agent:
          type: string
          nullable: true
          description: The user agent of the request, when there was one.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

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