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

# Retry failed events

> Retry up to 250 failed events.

Moves `FAILED` events back to `PENDING` for another processing attempt. Name the events in `event_ids`, or select a program's open failures with one cause.

Each retry runs every rule again against the participant's current state and sends the usual `event.completed` or `event.failed` webhook.

Fix the cause before retrying. A retry is accepted for a `SUSPENDED` or `CLOSED` participant, but fails again with `participant_inactive` if a balance, counter, or tier action still runs for them.

> [!NOTE]
>
> See [Event lifecycle](https://docs.scrip.dev/guides/event-processing.md#event-lifecycle) to retry named events, or [Failures by cause](https://docs.scrip.dev/guides/event-processing.md#failures-by-cause) for selection, pagination, and skipped-event recovery.


## OpenAPI

````yaml POST /v1/events/retry
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/events/retry:
    post:
      tags:
        - Events
      summary: Retry failed events
      description: Retry up to 250 failed events.
      operationId: retryEvents
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            examples:
              by_cause:
                summary: Retry open failures for one program and cause
                value:
                  before: '2027-01-15T10:30:00Z'
                  error_code: participant_inactive
                  program_id: 8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01
              by_event_ids:
                summary: Retry specific failed event IDs
                value:
                  event_ids:
                    - e5dc1b6a-7f3d-4e2a-8c1b-9a0f4d7e6c05
            schema:
              $ref: '#/components/schemas/RetryEventsRequest'
        description: The events to retry
        required: true
        x-originalParamName: request
      responses:
        '200':
          content:
            application/json:
              examples:
                default:
                  value:
                    has_more: false
                    next_cursor: >-
                      eyJ2IjoiMjAyNC0wMS0xNVQxMDozMDowMloiLCJpZCI6IjlkNWY3ZDRhIn0=
                    queued_count: 152
                    skipped:
                      - code: retry_identity_unavailable
                        event_id: e5dc1b6a-7f3d-4e2a-8c1b-9a0f4d7e6c05
                        message: >-
                          Original actor and recipient identity was not retained
                          for this event. Submit a new event with the original
                          identities and a new idempotency key.
              schema:
                $ref: '#/components/schemas/RetryEventsResponse'
          description: How many events were queued
          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:
                invalid_cursor:
                  summary: >-
                    The cursor is not one Scrip issued for this list with these
                    filters.
                  value:
                    code: invalid_cursor
                    doc_url: https://docs.scrip.dev/errors#invalid_cursor
                    message: >-
                      The cursor is not one Scrip issued for this list with
                      these filters.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: invalid_request
                invalid_json:
                  summary: The request body is not a valid JSON object.
                  value:
                    code: invalid_json
                    doc_url: https://docs.scrip.dev/errors#invalid_json
                    message: The request body is not a valid JSON object.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: invalid_request
                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
                    message: >-
                      The request failed validation. Fix every field listed in
                      fields.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: invalid_request
              schema:
                $ref: '#/components/schemas/ErrBadRequestResponse'
          description: >-
            Validation failed, or a cursor issued for another selection (code:
            validation_error | invalid_json | invalid_cursor)
          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'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          content:
            application/json:
              examples:
                participant_not_found:
                  summary: No participant with that id exists in your organization.
                  value:
                    code: participant_not_found
                    doc_url: https://docs.scrip.dev/errors#participant_not_found
                    message: No participant with that id exists in your organization.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: not_found
                program_not_found:
                  summary: No program with that id exists in your organization.
                  value:
                    code: program_not_found
                    doc_url: https://docs.scrip.dev/errors#program_not_found
                    message: No program with that id exists in your organization.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: not_found
              schema:
                $ref: '#/components/schemas/ErrNotFoundResponse'
          description: >-
            Program or participant not found (code: program_not_found |
            participant_not_found)
          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'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - BearerAuth: []
components:
  parameters:
    IdempotencyKey:
      description: >-
        Unique key (1-255 printable ASCII characters) to make retries safe.
        Repeating the same request with the same key within 24 hours replays the
        original response (`Idempotent-Replayed: true`).
      in: header
      name: Idempotency-Key
      schema:
        maxLength: 255
        type: string
  schemas:
    RetryEventsRequest:
      additionalProperties: false
      description: >-
        Selects the events to retry: the events `event_ids` names, or the open
        failures of one rewards program with one cause, such as a burst. Send
        `event_ids` or `program_id`, `error_code` and `before`, not both.
      properties:
        before:
          description: >-
            Retry only events whose latest failure is at or before this time,
            RFC 3339, compared to the second. Send the time you loaded the
            failures, so failures that arrive later stay open. Required without
            event_ids.
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
        cursor:
          description: >-
            The next_cursor from the previous response, to continue after the
            events it covered. Send it with the same program_id, error_code,
            participant_id and before.
          examples:
            - eyJ2IjoiMjAyNC0wMS0xNVQxMDozMDowMloiLCJpZCI6IjlkNWY3ZDRhIn0=
          maxLength: 1024
          minLength: 1
          type: string
        error_code:
          description: >-
            The cause: retry only events that first failed with this error_code.
            An event keeps the code it first failed with after a retry. Required
            without event_ids.
          examples:
            - participant_inactive
          maxLength: 100
          minLength: 1
          type: string
        event_ids:
          description: >-
            The events to retry, 1 to 250 ids, in any program. Send it without
            program_id, error_code, participant_id, before and cursor. A named
            event a retry of it alone would refuse, such as one that is not
            FAILED (event_not_retryable) or does not exist (event_not_found), is
            listed in skipped.
          examples:
            - - e5dc1b6a-7f3d-4e2a-8c1b-9a0f4d7e6c05
          items:
            type: string
          maxItems: 250
          minItems: 1
          type: array
        participant_id:
          description: >-
            Retry only this participant's events: those it is the actor or the
            recipient of. Omit it to retry every participant's failures.
          examples:
            - f7a8b9c0-1d2e-4f3a-b4c5-d6e7f8a9b006
          format: uuid
          type: string
        program_id:
          description: >-
            The rewards program whose failures to retry. Required without
            event_ids.
          examples:
            - 8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01
          format: uuid
          type: string
      type: object
    RetryEventsResponse:
      description: How many events a retry queued, and which it could not retry.
      properties:
        has_more:
          description: >-
            True when a selector request stopped at 250 events and more matching
            failures remain. Send the same request with next_cursor as cursor to
            retry the rest. Always false with event_ids.
          examples:
            - false
          type: boolean
        next_cursor:
          description: Where the next request continues. Null when has_more is false.
          examples:
            - eyJ2IjoiMjAyNC0wMS0xNVQxMDozMDowMloiLCJpZCI6IjlkNWY3ZDRhIn0=
          type:
            - string
            - 'null'
        queued_count:
          description: >-
            How many events this request moved back to PENDING. Scrip processes
            each again as a retry of it alone would.
          examples:
            - 152
          type: integer
        skipped:
          description: >-
            The named or selected events that could not be retried. They are
            left as they were.
          items:
            $ref: '#/components/schemas/SkippedEvent'
          type: array
      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
    ErrNotFoundResponse:
      description: >-
        The error body for a 404 response: the resource does not exist in your
        organization.
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - participant_not_found
          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#participant_not_found
          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 participant was not found.
          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:
            - not_found
          type: string
      type: object
    SkippedEvent:
      description: >-
        An event the request named or selected but could not change, with the
        error the same request for that event alone returns. It is left as it
        was.
      properties:
        code:
          description: >-
            The error code, such as retry_identity_unavailable,
            event_not_retryable or event_not_found.
          examples:
            - retry_identity_unavailable
          type: string
        event_id:
          description: The event's id.
          examples:
            - e5dc1b6a-7f3d-4e2a-8c1b-9a0f4d7e6c05
          format: uuid
          type: string
        message:
          description: What went wrong, as the request for this event alone says it.
          examples:
            - >-
              Original actor and recipient identity was not retained for this
              event. Submit a new event with the original identities and a new
              idempotency key.
          type: string
      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
    ErrForbiddenResponse:
      description: 'The error body for a 403 response: the caller is not allowed to do this.'
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - insufficient_permissions
          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#insufficient_permissions
          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:
            - Your dashboard role does not allow this action.
          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:
            - permission
          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'
    Forbidden:
      content:
        application/json:
          examples:
            insufficient_permissions:
              summary: Your dashboard role does not allow this action.
              value:
                code: insufficient_permissions
                doc_url: https://docs.scrip.dev/errors#insufficient_permissions
                message: Your dashboard role does not allow this action.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: permission
          schema:
            $ref: '#/components/schemas/ErrForbiddenResponse'
      description: The caller is not allowed to do this.
      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'
    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.