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

# Audit export

> Export your ScripX event log as a tamper-evident, hash-chained record: every event on your desk with a chain digest your auditor can verify offline.

Your desk's event log, exportable and tamper-evident. Requires the `orders:read` scope. Cursor-paginated (`limit` default 100, max 500).

Each export carries a `chain_digest`: events are hash-chained, so an auditor can verify offline that nothing was inserted, altered or dropped. Built for the compliance file, not just debugging.

### Request example

```bash theme={"dark"}
curl "https://api.scripxhq.com/v1/audit/export?limit=500" \
  -H "X-ScripX-Key: <YOUR_API_KEY>"
```

### Response example

```json theme={"dark"}
{
  "count": 2,
  "events": [
    {"at": "2026-07-24T11:02:41+05:30", "kind": "order.placed", "order_id": "ord_01HZX…"},
    {"at": "2026-07-24T11:09:12+05:30", "kind": "order.matched", "order_id": "ord_01HZX…"}
  ],
  "chain_digest": "9c41f2…",
  "algo": "sha256-chain"
}
```

### Errors

* `401` / `403` / `429`, the standard [auth errors](/authentication#authentication-errors).

**Terms used here:** [order](/annexure/terminology#order), [statement](/annexure/terminology#statement), [audit export](/annexure/terminology#audit-export), [API key](/annexure/terminology#api-key), [scope](/annexure/terminology#scope), [pagination](/annexure/terminology#cursor-pagination). Full list in the [terminology annexure](/annexure/terminology).

### Next steps

* [Statements](/api-reference/account/statements), the billed view of the same activity.


## OpenAPI

````yaml GET /v1/audit/export
openapi: 3.1.0
info:
  title: ScripX Partner API
  version: 1.2.0
  description: >-
    Automate duty-credit-scrip trading: quote, order, positions, market,
    webhooks. Auth: `X-ScripX-Key: scripx_live_…`. Money = integer paise; price
    = bps of face.
  contact:
    name: ScripX API Support
    email: amin@eximfiles.io
    url: https://scripxhq.com
servers:
  - url: https://api.scripxhq.com
    description: >-
      Production and sandbox share one host; a scripx_test_ key selects the
      sandbox.
security:
  - ApiKeyAuth: []
tags:
  - name: Firms
    description: >-
      client-firm lifecycle: register, verify, authorize, credits, update,
      offboard
  - name: Trading
    description: quote, orders, positions, market
  - name: Group
    description: intra-group netting + positions (enterprise/broker)
  - name: Cross
    description: 'broker cross-desk: block deals + intra-group transfers'
  - name: Webhooks
    description: event subscriptions + delivery
  - name: Account
    description: usage + metering
  - name: Keys
    description: self-serve scoped child keys (sub-accounts)
paths:
  /v1/audit/export:
    get:
      tags:
        - Account
      summary: Tamper-evident export of your event log
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            maximum: 500
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: opaque offset from a prior response's next_cursor
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditExport'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AuditExport:
      type: object
      properties:
        party_iec:
          type: string
        period:
          type: string
        count:
          type: integer
        events:
          type: array
          items:
            $ref: '#/components/schemas/AuditEvent'
        chain_digest:
          type: string
          description: >-
            SHA-256 chain over the events as shown; recompute to verify
            integrity
        algo:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: stable machine code
          enum:
            - bad_request
            - unauthorized
            - forbidden
            - not_found
            - conflict
            - unprocessable
            - rate_limited
            - internal
        message:
          type: string
        detail:
          type: object
    AuditEvent:
      type: object
      properties:
        seq:
          type: integer
        at:
          type: string
        event:
          type: string
          description: >-
            order.placed | order.matched | trade.matched | settlement.settled |
            settlement.failed | cross.settled | credit.issued |
            savings.delivered | payout.sent
        ref:
          type: string
          description: the id of the order / trade / cross it concerns
        detail:
          type: object
          description: scheme + amounts for the event; never any fee or spread
        row_hash:
          type: string
        prev_hash:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-ScripX-Key
      description: >-
        Your API key, e.g. `scripx_live_…`. Bound to one firm; tenant isolation
        is enforced.

````