> ## 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.

> ## Agent Instructions
> Start with https://docs.scrip.dev/agents.md and https://docs.scrip.dev/which-endpoints-you-need.md. Your application only needs a few API calls as users earn and spend (`POST /v1/events`, balance/history reads, and redemptions); program setup happens in the dashboard or setup scripts.
> Use `https://api-sandbox.scrip.dev` with `sk_test_` keys for testing, and `https://api.scrip.dev` with `sk_live_` keys for production. Keep API keys on your server.
> Pass your own user ID as `external_id` on events and prefix it with `ext:` in participant URL paths (e.g., `GET /v1/participants/ext:user_123/balances`). By default (`on_unknown_participant: CREATE`), the first event for a new `external_id` creates and enrolls the participant automatically.
> Events process asynchronously: `POST /v1/events` returns `202 Accepted` when queued, and rules evaluate in the background. Pass an `idempotency_key` (such as an order ID) on every event, and wait for the `event.completed` webhook or poll `GET /v1/events/{event_id}` before reading updated balances.
> Connect the hosted MCP server at https://mcp.scrip.dev/mcp (OAuth, defaults to Sandbox) to inspect programs, validate and simulate rules, and trace events. Append `.md` to any docs URL for Markdown, or fetch https://docs.scrip.dev/openapi.json for full endpoint schemas.

# Folders

> Hierarchical containers for organizing programs within an organization

Folders organize programs and nested subfolders within an organization, up to 8 levels deep. Folders are organizational metadata and do not change how contained programs evaluate rules or hold balances.

Folders cannot be deleted; archive a folder only after all nested subfolders and programs are archived. Use `folder_id` on `GET /v1/programs` and supported reporting endpoints to filter or aggregate across a folder tree.

## Endpoints

| Endpoint | Purpose |
| - | - |
| [List folders](https://docs.scrip.dev/api-reference/folders/list-folders.md) | List folders, filtered by parent, `kind`, `external_id`, `status`, or `search` |
| [Create a folder](https://docs.scrip.dev/api-reference/folders/create-a-folder.md) | Create a top-level or nested folder |
| [Get a folder](https://docs.scrip.dev/api-reference/folders/get-a-folder.md) | Retrieve a folder with its `ancestors` chain |
| [Update a folder](https://docs.scrip.dev/api-reference/folders/update-a-folder.md) | Rename, relabel, move, archive, or restore a folder |

> [!NOTE]
>
> For usage patterns and examples, see the [Folders guide](https://docs.scrip.dev/guides/folders.md).


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