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

# List folders

> List folders in the organization, newest first.

Returns a paginated list of folders in your organization, newest first. Pass `parent_folder_id=null` for top-level folders, or a folder ID for its immediate children.

Unlike `GET /v1/programs`, omitting `status` returns both `ACTIVE` and `ARCHIVED` folders.

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


## OpenAPI

````yaml GET /v1/folders
openapi: 3.1.0
info:
  contact:
    email: support@scrip.dev
    name: Scrip Support
  description: >-
    Scrip is the operating system for rewards programs. Use this REST API to
    send events, read balances and history, trigger redemptions, and configure
    programs, assets, rules, tiers, and rewards. Full guides and reference:
    https://docs.scrip.dev


    Base URLs:

    - **Sandbox:** `https://api-sandbox.scrip.dev` (keys start with `sk_test_`)

    - **Production:** `https://api.scrip.dev` (keys start with `sk_live_`)


    Authentication & headers:

    - Pass `Authorization: Bearer <api_key>` on every request.

    - Pass `Content-Type: application/json` on requests with a JSON body.


    Response envelopes:

    - **List endpoints** return `{"data": [...], "pagination": {"has_more":
    false, "next_cursor": null}}`.

    - **Single-resource endpoints** return the resource object directly.

    - **Errors** return `{"type": "...", "code": "...", "message": "...",
    "request_id": "...", "doc_url": "..."}` (plus `param`, `fields`, or
    `details` when applicable). Match on `code` in your error handling and
    include `request_id` when contacting support.


    Participant identifiers: every `{participant_id}` path accepts either
    Scrip's UUID or `ext:` followed by your own `external_id` (for example,
    `/v1/participants/ext:user_123/balances`).


    Idempotency: every operation carries `x-scrip-idempotency` (`replay`,
    `conflict_safe`, `natural_key`, or `none`). On `replay` routes, repeating a
    request with the same `Idempotency-Key` within 24 hours returns the original
    response with `Idempotent-Replayed: true`.
  license:
    name: Proprietary
  termsOfService: https://scrip.dev/terms
  title: Scrip API
  version: '1.0'
servers:
  - description: Production
    url: https://api.scrip.dev
  - description: Sandbox
    url: https://api-sandbox.scrip.dev
security: []
tags:
  - description: Create and manage rewards programs and program wallets.
    name: Programs
  - description: Group programs and other folders inside your organization.
    name: Folders
  - description: Define and manage units of value (points, cashback, credits).
    name: Assets
  - description: Manage participants, balances, state, and transaction history.
    name: Participants
  - description: Manage participant groups with shared balances and state.
    name: Groups
  - description: Create, validate, simulate, and version earn rules.
    name: Rules
  - description: Ingest, inspect, retry, and reverse user events.
    name: Events
  - description: Transfer balances between participants and groups.
    name: Transfers
  - description: >-
      Liability, rollforward, attribution, expiration, activity, and fulfillment
      cost reports.
    name: Reporting
  - description: >-
      Redeem participant balances for catalog items, gift cards, or custom
      amounts.
    name: Redemptions
  - description: Manage items in a program's rewards catalog.
    name: Rewards
  - description: Schedule recurring, one-time, or participant-state-triggered events.
    name: Automations
  - description: >-
      Configure ranked tier tracks, qualification criteria, and downgrade
      policies.
    name: Tiers
  - description: Inspect double-entry ledger records for auditing and reconciliation.
    name: Journal Entries
  - description: >-
      Manage webhook endpoints and delivery logs. Webhooks notify your
      application of real-time events via HTTP POST with HMAC-SHA256 signatures.
    name: Webhooks
  - description: >-
      Inspect the gift-card provider accounts that fulfill redemptions, and the
      products each one offers.
    name: Fulfillment Accounts
  - description: >-
      Connect a program to a fulfillment account so its catalog backs rewards,
      and choose which products the program offers.
    name: Reward Sources
  - description: >-
      Group a program's rules into ordered sets, and reorder the sets and the
      rules inside them.
    name: Rule Sets
  - description: >-
      Events Scrip sends to your webhook endpoints. Each key under `webhooks` is
      an event type, and its request body is the delivery.
    name: Webhook events
paths:
  /v1/folders:
    get:
      tags:
        - Folders
      summary: List folders
      description: List folders in the organization, newest first.
      operationId: listFolders
      parameters:
        - description: Return at most this many records, from 1 to 200, default 50.
          example: 50
          in: query
          name: limit
          schema:
            default: 50
            maximum: 200
            minimum: 1
            type: integer
        - description: >-
            The next_cursor from the previous response, valid only with the same
            endpoint and filters.
          in: query
          name: cursor
          schema:
            type: string
        - description: >-
            Filter by immediate parent folder ID, or `null` for top-level
            folders.
          example: 6a8c0e24-d3f5-4b79-9c1b-e5a7c9b1d335
          in: query
          name: parent_folder_id
          schema:
            type: string
        - description: Filter by exact folder kind.
          in: query
          name: kind
          schema:
            type: string
        - description: Filter by exact external ID.
          example: user_123
          in: query
          name: external_id
          schema:
            type: string
        - description: Filter by folder status. Omit to include archived folders.
          in: query
          name: status
          schema:
            enum:
              - ACTIVE
              - ARCHIVED
            type: string
        - description: Filter by folder name substring (case-insensitive).
          in: query
          name: search
          schema:
            type: string
        - description: Return only records created after this time, RFC 3339.
          example: '2027-01-01T00:00:00Z'
          in: query
          name: created_after
          schema:
            format: date-time
            type: string
        - description: Return only records created before this time, RFC 3339.
          example: '2027-01-15T10:30:00Z'
          in: query
          name: created_before
          schema:
            format: date-time
            type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                default:
                  value:
                    data:
                      - created_at: '2027-01-15T10:30:00Z'
                        external_id: brand-coffee
                        id: 2c4e6a80-b1d3-4f57-8a92-c3e5a7b9d134
                        name: Coffee
                        status: ACTIVE
                        updated_at: '2027-01-15T10:30:00Z'
                    pagination:
                      has_more: true
                      next_cursor: YWJjMTIz
              schema:
                $ref: '#/components/schemas/FolderListResponse'
          description: List of folders
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '400':
          content:
            application/json:
              examples:
                validation_error:
                  summary: >-
                    One or more request fields are missing, malformed or not
                    allowed; `fields` lists each one.
                  value:
                    code: validation_error
                    doc_url: https://docs.scrip.dev/errors#validation_error
                    fields:
                      - field: parent_folder_id
                        message: parent_folder_id is not valid.
                        reason: invalid_format
                    message: parent_folder_id is not valid.
                    param: parent_folder_id
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: invalid_request
              schema:
                $ref: '#/components/schemas/ErrBadRequestResponse'
          description: 'Invalid query parameters (code: validation_error)'
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - BearerAuth: []
components:
  schemas:
    FolderListResponse:
      description: One page of folders, with the pagination details for the next page.
      properties:
        data:
          description: The folders on this page.
          items:
            $ref: '#/components/schemas/FolderResponse'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
          description: Whether another page follows, and the cursor that fetches it.
      type: object
    ErrBadRequestResponse:
      additionalProperties: false
      description: 'The error body for a 400 response: the request itself is wrong.'
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - validation_error
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#validation_error
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - The request failed validation. Fix every field listed in fields.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - invalid_request
          type: string
      type: object
    FolderResponse:
      description: >-
        A folder that organizes programs and nested folders within an
        organization.
      properties:
        created_at:
          description: When the folder was created.
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
        external_id:
          description: External identifier, unique per organization.
          examples:
            - brand-coffee
          type: string
        id:
          description: >-
            UUID passed as `folder_id` in paths and `parent_folder_id` on child
            folders.
          examples:
            - 2c4e6a80-b1d3-4f57-8a92-c3e5a7b9d134
          format: uuid
          type: string
        kind:
          description: Level classification (e.g., `brand`, `region`); informational only.
          examples:
            - brand
          type: string
        metadata:
          additionalProperties:
            type: string
          description: Key-value string labels attached to this folder.
          type: object
        name:
          description: >-
            Display name, unique among siblings under the same parent or at top
            level (case-insensitive).
          examples:
            - Coffee
          type: string
        parent_folder_id:
          description: Parent folder UUID (absent for top-level folders).
          examples:
            - 6a8c0e24-d3f5-4b79-9c1b-e5a7c9b1d335
          format: uuid
          type: string
        status:
          description: Lifecycle status of the folder.
          enum:
            - ACTIVE
            - ARCHIVED
          examples:
            - ACTIVE
          type: string
        updated_at:
          description: When the folder was last modified.
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
      type: object
    PaginationResponse:
      description: Whether another page follows, and the cursor that fetches it.
      properties:
        has_more:
          description: Whether more results are available beyond this page
          examples:
            - true
          type: boolean
        next_cursor:
          description: Cursor to fetch the next page. Null on the last page
          examples:
            - YWJjMTIz
          type:
            - string
            - 'null'
      required:
        - has_more
        - next_cursor
      type: object
    ErrorFieldDetail:
      description: 'One failing field: its JSON name, why it failed, and what to change.'
      properties:
        field:
          description: The JSON name of the failing field, with dots for nested fields
          type: string
        message:
          description: What to change in this field
          type: string
        reason:
          description: >-
            Why the field failed: required, invalid_format, out_of_range,
            unknown_field, not_allowed or too_long
          examples:
            - required
          type: string
      type: object
    ErrUnauthorizedResponse:
      description: 'The error body for a 401 response: the API key is missing or not valid.'
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - invalid_api_key
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#invalid_api_key
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - >-
              The API key in the Authorization header is unknown, revoked or
              needs rotation.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - authentication
          type: string
      type: object
    ErrTooManyRequestsResponse:
      additionalProperties: false
      description: >-
        The error body for a 429 response: you sent more requests than the rate
        limit allows.
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - rate_limit_exceeded
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#rate_limit_exceeded
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - Rate limit exceeded. Wait for the Retry-After delay, then retry.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - rate_limited
          type: string
      type: object
    ErrInternalResponse:
      description: >-
        The error body for a 500 response: something failed on Scrip's side.
        Quote the `request_id` when you contact support.
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - internal_error
          type: string
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#internal_error
          type: string
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - >-
              An internal error occurred. Retry the request; if it keeps
              failing, contact support with the request_id.
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - internal
          type: string
      type: object
  headers:
    X-RateLimit-Limit:
      description: Request ceiling enforced by the API instance that served your request.
      schema:
        examples:
          - 1000
        type: integer
    X-RateLimit-Remaining:
      description: Requests left before the instance that served your request returns 429.
      schema:
        examples:
          - 0
        type: integer
    X-RateLimit-Reset:
      description: >-
        Unix time in seconds when the instance that served your request has its
        full allowance again.
      schema:
        examples:
          - 1790000000
        type: integer
    X-Request-ID:
      description: >-
        The id of this request, the same `req_` value as `request_id` in an
        error body. Quote it when you contact support.
      schema:
        examples:
          - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
        type: string
    WWW-Authenticate:
      description: >-
        The authentication challenge: `Bearer realm="scrip"`. Send your API key
        as a bearer token.
      schema:
        examples:
          - Bearer realm="scrip"
        type: string
    Retry-After:
      description: Seconds to wait before you retry, rounded up to a whole second.
      schema:
        examples:
          - 1
        type: integer
  responses:
    Unauthorized:
      content:
        application/json:
          examples:
            authentication_required:
              summary: The request carried no API key or session token.
              value:
                code: authentication_required
                doc_url: https://docs.scrip.dev/errors#authentication_required
                message: The request carried no API key or session token.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: authentication
            invalid_api_key:
              summary: >-
                The API key in the `Authorization` header is unknown, revoked or
                needs rotation.
              value:
                code: invalid_api_key
                doc_url: https://docs.scrip.dev/errors#invalid_api_key
                message: >-
                  The API key in the Authorization header is unknown, revoked or
                  needs rotation.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: authentication
          schema:
            $ref: '#/components/schemas/ErrUnauthorizedResponse'
      description: >-
        The API key is missing or not valid. See
        [Authentication](https://docs.scrip.dev/authentication).
      headers:
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
    TooManyRequests:
      content:
        application/json:
          examples:
            rate_limit_exceeded:
              summary: Your organization sent more requests than the rate limit allows.
              value:
                code: rate_limit_exceeded
                doc_url: https://docs.scrip.dev/errors#rate_limit_exceeded
                message: >-
                  Your organization sent more requests than the rate limit
                  allows.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: rate_limited
          schema:
            $ref: '#/components/schemas/ErrTooManyRequestsResponse'
      description: >-
        Too many requests. Wait the number of seconds in the `Retry-After`
        header, then retry. See [Limits and
        durations](https://docs.scrip.dev/limits#rate-limits).
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
    InternalError:
      content:
        application/json:
          examples:
            internal_error:
              summary: Scrip hit an unexpected error while handling the request.
              value:
                code: internal_error
                doc_url: https://docs.scrip.dev/errors#internal_error
                message: Scrip hit an unexpected error while handling the request.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: internal
          schema:
            $ref: '#/components/schemas/ErrInternalResponse'
      description: >-
        Something failed on Scrip's side. Retry the request, and quote
        `request_id` if it keeps failing.
        [Errors](https://docs.scrip.dev/errors) lists every code, and the [API
        introduction](https://docs.scrip.dev/api-reference/introduction)
        describes the error format.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
  securitySchemes:
    BearerAuth:
      description: 'Send your API key as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http
      x-default: sk_...

````

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