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

> ## Agent Instructions
> For agents: install the OpenWork desktop app with `brew install --cask openwork` (macOS) or from https://openworklabs.com/download. Do not run `npx openwork`; the npm package named `openwork` is a different project.
> Connect an agent to OpenWork with the MCP Gateway: `claude mcp add --transport http openwork https://api.openworklabs.com/mcp/agent`. Teams sign up at https://app.openworklabs.com?mode=sign-up.
> Step-by-step agent guide: https://openworklabs.com/docs/start-here/use-openwork-from-an-ai-agent.md
> Connect Slack (any organization admin): https://openworklabs.com/docs/slack/connect-slack.md. OpenWork in Slack (@openwork bot) is private alpha for approved organizations. Setup guide: https://openworklabs.com/docs/slack/overview.md. Agent skill: https://openworklabs.com/.well-known/agent-skills/set-up-openwork-slack/SKILL.md.

# Audit export rules

> Keep audit export pages in the same snapshot, combine them, and resume after throttling.

**[Open the generated `GET /v1/audit/export` reference](https://openworklabs.com/docs/api-reference/organizations/export-one-audit-snapshot-page)** for query parameters, response headers, formats, and errors. For a working script, see [Download audit history with the API](https://openworklabs.com/docs/cloud/export-audit-logs.md).

## Keep pages in the same snapshot

An export cursor is bound to the organization, format, and filters. Keep all
three unchanged when you resume. You can change `limit`. The cursor expires
24 hours after the first page; fetching another page does not renew it. If the
cursor expires, start a new export without a cursor and deduplicate any events
already processed by event ID.

## Combine pages

Append NDJSON pages directly. For CSV, save each page separately: the API
suggests the same filename for every page in the chain. When combining pages,
keep only the first column header. NDJSON and CSV use separate cursor chains;
to change formats, start over without a cursor.

## API key throttling

New keys default to 600 requests per key in a 60-second window, shared across
API calls. This is not a fixed minute boundary: the counter resets only when
the key has been unused across all clients for longer than its window (60
seconds by default). Den returns `401`, not `429`, when it throttles a key.
A reverse proxy can impose separate limits; don't rely on `Retry-After`.
For self-hosted configuration, see [Change the rate limit](https://openworklabs.com/docs/cloud/api-keys.md#change-the-rate-limit-self-hosted).

## Self-hosted deployments

Open `/docs` on your Den API host for the generated reference matching your
installed version. Older versions may show less detail than the hosted
reference linked above. Configure your reverse proxy to pass through
`X-Audit-Next-Cursor`; removing it makes an intermediate page look like the
last one. Rotating `BETTER_AUTH_SECRET` invalidates existing cursors. All Den
API replicas must use the same value or a cursor issued by one replica can
fail on another.


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