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

# AI resources

> Context files and documentation links for AI coding tools

Use these resources when asking AI coding tools to help integrate Scrip. Start with the core model, then add task-specific guides and the OpenAPI spec when the tool needs endpoint schemas.

## Context files

* [Scrip overview](https://scrip.dev/llms.txt): Start here if the tool only knows the product website.
* [Docs index](https://docs.scrip.dev/llms.txt): Use this to choose relevant docs pages.
* [Full docs](https://docs.scrip.dev/llms-full.txt): Load this when the tool supports large context files.
* [OpenAPI spec](https://docs.scrip.dev/openapi.json): Use this for endpoint paths, request schemas, response schemas, and error codes.

To let an AI client work with authorized account data instead of static context, connect the [MCP server](/mcp/overview). It exposes Scrip as a curated set of tools and serves these docs as resources the model can pull on demand.

## Recommended context

Events are the input that drives rule evaluation, balance changes, ledger entries, webhooks, and downstream reporting. Load event context before asking an AI tool to design rules, balances, or automations.

For most integration work, load these pages in order:

1. [Introduction](/introduction)
2. [Core concepts](/guides/core-concepts)
3. [Authentication](/authentication)
4. [Quickstart](/quickstart)
5. [Event processing](/guides/event-processing)
6. [API introduction](/api-reference/introduction)
7. [OpenAPI spec](https://docs.scrip.dev/openapi.json)

## Workflow context

For programs and assets, load [Core concepts](/guides/core-concepts), [Programs](/guides/programs), and [Asset configuration](/guides/asset-configuration).

For participants and groups, load [Core concepts](/guides/core-concepts), [Participants](/guides/participants), [State management](/guides/state-management), and [Groups](/guides/groups).

For rules and events, load [Event processing](/guides/event-processing), [Writing rules](/guides/writing-rules), [CEL expressions](/guides/cel-expressions), and [Rule actions](/guides/rule-actions).

For balances and ledger behavior, load [Ledger](/guides/ledger), [Balance operations](/guides/balance-operations), and [Lots and expiration](/guides/lots-and-expiration).

For redemptions and rewards catalog work, load [Ledger](/guides/ledger), [Balance operations](/guides/balance-operations), [Redemptions](/guides/redemptions), and [Rewards catalog](/guides/rewards-catalog).

For transfers, load [Ledger](/guides/ledger), [Balance operations](/guides/balance-operations), and [Transfers](/guides/transfers).

For reporting, load [Ledger](/guides/ledger), [Event processing](/guides/event-processing), and [Reporting](/guides/reporting).

For automations, load [Event processing](/guides/event-processing), [Writing rules](/guides/writing-rules), and [Automations](/guides/automations).

For webhooks, load [Event processing](/guides/event-processing) and [Webhooks](/guides/webhooks).

For testing, load [Quickstart](/quickstart), [Event processing](/guides/event-processing), and [Testing](/guides/testing).

## Integration path

When an AI tool is helping build a first REST API integration, use this sequence:

1. Set up server-side authentication.
2. Create a program.
3. Create and link an asset.
4. Define a rule with a CEL condition and one or more actions.
5. Ingest an event with an `idempotency_key`.
6. Verify the participant balance and ledger entries.

## Security constraints

Keep production credentials server-side. Do not expose them in browser code, mobile apps, public repositories, or AI prompts.

Use deterministic `idempotency_key` values for event retries. Reusing the same key returns the same event identity without reprocessing, even if the payload differs. To correct or replace an event, send a new event with a new idempotency key.
