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

# Execute up to 20 REST operations.

> Validates the complete envelope before dispatch, then executes operations sequentially through their normal REST routes. Results preserve input order. An operation failure does not stop later operations, and the batch is not transactional.



## OpenAPI

````yaml https://api.streamloop.app/v1/openapi.json post /batch
openapi: 3.1.0
info:
  contact:
    name: Streamloop
    url: https://streamloop.app
  description: >-
    The Streamloop REST API. Authenticate with either an `X-API-Key` header (a
    Streamloop API key, prefix `sl_` — simplest for programmatic clients) or an
    OAuth 2.1 bearer access token (obtain one via https://auth.streamloop.app).
    Collections are cursor-paginated (`limit` + `cursor`, returning `{ data,
    page }`). Errors are RFC 7807 problem documents.
  summary: >-
    Programmatic access to Streamloop — create and control 24/7 loop streams,
    manage media, destinations, playlists, and billing.
  title: Streamloop API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.streamloop.app/v1
security:
  - oauth2: []
  - bearerAuth: []
  - apiKey: []
tags:
  - description: The authenticated user's account.
    name: account
  - description: Credits, usage analytics, invoices, and top-ups.
    name: billing
  - description: Crypto deposit options for topping up credits.
    name: crypto
  - description: Manage streaming destinations (custom RTMP).
    name: destinations
  - description: Service metadata, discovery documents, and batch execution.
    name: meta
  - description: Manage and publish stream playlists.
    name: playlists
  - description: Create, control, schedule, and monitor 24/7 loop streams.
    name: streams
  - description: Upload and manage source media (video/audio).
    name: uploads
paths:
  /batch:
    post:
      tags:
        - meta
      summary: Execute up to 20 REST operations.
      description: >-
        Validates the complete envelope before dispatch, then executes
        operations sequentially through their normal REST routes. Results
        preserve input order. An operation failure does not stop later
        operations, and the batch is not transactional.
      operationId: executeBatch
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/BatchOperation'
              maxItems: 20
              minItems: 1
              type: array
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/BatchResult'
                type: array
          description: >-
            Ordered per-operation results. Individual results can contain
            non-2xx statuses.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The batch envelope is invalid; no operations were executed.
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Authentication is required.
      security:
        - oauth2: []
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    BatchOperation:
      additionalProperties: false
      description: >-
        One ordinary REST operation. The path is relative to /v1; nested batches
        are forbidden.
      properties:
        body:
          description: JSON request body for POST or PATCH operations.
        id:
          description: Caller-supplied correlation ID, unique within this batch.
          minLength: 1
          type: string
        idempotencyKey:
          description: >-
            Per-operation idempotency key for POST or PATCH. The outer request
            key is not inherited.
          type: string
        method:
          enum:
            - GET
            - POST
            - PATCH
            - DELETE
          type: string
        path:
          description: >-
            Path relative to /v1, including any query string (for example
            /streams?limit=10).
          pattern: ^/
          type: string
      required:
        - id
        - method
        - path
      type: object
    BatchResult:
      additionalProperties: false
      description: The independent result of one operation. Results preserve input order.
      properties:
        body:
          description: Decoded JSON response body, or a string for a non-JSON response.
        headers:
          additionalProperties:
            type: string
          type: object
        id:
          type: string
        status:
          maximum: 599
          minimum: 100
          type: integer
      required:
        - id
        - status
      type: object
    Problem:
      description: RFC 7807 problem-details error body.
      properties:
        code:
          description: A stable, machine-readable error code.
          type: string
        detail:
          description: A human-readable explanation specific to this occurrence.
          type: string
        status:
          description: The HTTP status code.
          type: integer
        title:
          description: A short, human-readable summary of the problem.
          type: string
        type:
          description: A URI reference identifying the problem type.
          format: uri-reference
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
      type: object
  securitySchemes:
    oauth2:
      description: OAuth 2.1 authorization-code flow with PKCE.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.streamloop.app/api/auth/oauth2/authorize
          scopes:
            streamloop:billing: Read billing/usage and create top-up links
            streamloop:destructive: Delete streams and destinations
            streamloop:read: Read streams, destinations, playlists, and billing status
            streamloop:write: Create and control streams, destinations, and playlists
          tokenUrl: https://auth.streamloop.app/api/auth/oauth2/token
      type: oauth2
    bearerAuth:
      bearerFormat: JWT
      description: An OAuth 2.1 bearer access token.
      scheme: bearer
      type: http
    apiKey:
      description: >-
        A Streamloop API key (prefix `sl_`), sent in the `X-API-Key` header.
        Create and manage keys in the dashboard. The simplest auth for
        programmatic / agent clients — no OAuth flow required; the key acts as
        its owning user.
      in: header
      name: X-API-Key
      type: apiKey

````