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

# Create an ingest key

> For an `rtmp` or `srt` source of the draft: where an encoder (OBS, vMix) sends. The key is in this answer only.



## OpenAPI

````yaml /api-reference/scenes-openapi.json post /scenes/{id}/ingest-keys
openapi: 3.1.0
info:
  title: Streamloop Scenes API
  version: 1.0.0
  description: >-
    Build and run scenes: live, designed streams. A scene (id `scn_…`) holds
    frames — full arrangements of layers (text, pictures, video, web pages,
    tables, tickers), one on air at a time — each at `frame/<id>`, plus the
    sources it reads (cameras, RTMP/SRT inputs, files, playlists, URLs, Google
    Sheets), its components and its script. You edit its draft as resources at
    paths (`frame/intro`, `frame/intro/title`, `source/data/headlines`,
    `component/LowerThird`, `script/show.ts`); every write is built and checked
    as the Streamloop studio checks it, and studios open on it see it at once.
    Nothing reaches viewers until you publish. To put a scene on a stream: `PUT
    /v1/streams/{id}/scene` (Streamloop REST API), then start the stream.


    This API follows the conventions of Streamloop's REST API: the same
    authentication (`X-API-Key`, an OAuth bearer, or the dashboard's session),
    `X-Workspace-Id`, RFC 7807 problems with a stable `code`, cursor pages,
    `Idempotency-Key` on POST and PATCH, and `RateLimit-*` headers (600 requests
    a minute).
servers:
  - url: https://api.streamloop.app/v1
security:
  - apiKey: []
  - oauth: []
tags:
  - name: scenes
    description: Create, list, read and delete scenes.
  - name: draft
    description: >-
      Read and change the scene's draft, resource by resource. Start with `GET
      /scenes/{id}/resources` (the kinds of thing it holds) and `GET
      /scenes/{id}/resources/element/*` (the building blocks and their props).
  - name: publishing
    description: Put the draft on air, see what was published, go back.
  - name: live
    description: What a stream playing the scene has on air, and the operator's actions.
  - name: inputs
    description: >-
      Live inputs: ingest keys for RTMP/RTMPS/SRT encoders, RTSP cameras, and
      secrets the scene's tables use.
paths:
  /scenes/{id}/ingest-keys:
    parameters:
      - $ref: '#/components/parameters/id'
      - $ref: '#/components/parameters/workspace'
    post:
      tags:
        - inputs
      summary: Create an ingest key
      description: >-
        For an `rtmp` or `srt` source of the draft: where an encoder (OBS, vMix)
        sends. The key is in this answer only.
      operationId: createIngestKey
      parameters:
        - $ref: '#/components/parameters/idempotency'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - sourceId
              properties:
                sourceId:
                  type: string
      responses:
        '201':
          description: The key, with its secret once
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestKey'
        4XX:
          $ref: '#/components/responses/Problem'
        5XX:
          $ref: '#/components/responses/Problem'
components:
  parameters:
    id:
      name: id
      in: path
      required: true
      schema:
        type: string
        pattern: ^scn_
      description: The scene's id (`scn_…`)
    workspace:
      name: X-Workspace-Id
      in: header
      schema:
        type: string
      description: >-
        The workspace to act in. Required with an API key; otherwise the
        session's own.
    idempotency:
      name: Idempotency-Key
      in: header
      schema:
        type: string
        maxLength: 200
      description: >-
        Retry safely: the key (per caller, workspace, method and path) is taken
        before the request runs, and its first answer is replayed for 24 hours,
        with `Idempotency-Replayed: true` — a repeat sent while the first still
        runs waits for it. The same key with a different body is 422
        IDEMPOTENCY_KEY_REUSED. A 5xx is not kept: the retry runs.
  schemas:
    IngestKey:
      type: object
      properties:
        id:
          type: string
          description: '`ingkey_…`, for these routes'
        sceneId:
          type: string
        sourceId:
          type: string
        key:
          type: string
          description: Only when created or rotated
        keyPrefix:
          type: string
        status:
          type: string
          enum:
            - active
            - revoked
        live:
          type: boolean
        rtmpUrl:
          type: string
        rtmpsUrl:
          type: string
        srtUrl:
          type: string
          description: Only when created or rotated
        ingestdId:
          type: string
          description: >-
            The ingest service's id for the key (`ingk_…`, not the key's own
            `ingkey_…` id): what the draft's rtmp or srt source names as its
            ingest.key
        createdAt:
          type: string
          format: date-time
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - code
        - detail
      properties:
        type:
          type: string
          const: about:blank
        title:
          type: string
        status:
          type: integer
        code:
          type: string
          description: >-
            Stable — branch on it: BAD_REQUEST (400), WORKSPACE_REQUIRED (400),
            UNAUTHENTICATED (401), INSUFFICIENT_SCOPE (403), WORKSPACE_FORBIDDEN
            (403), NOT_FOUND (404), METHOD_NOT_ALLOWED (405), READ_ONLY (422),
            CONFLICT (409; currentRevision), EDIT_NO_MATCH (409), EDIT_AMBIGUOUS
            (409), IN_USE (409), CONFIRM_REQUIRED (409), STALE_PUBLISH (409;
            publishedVersion, basedOn, reverted, publishedVersionIsRevert),
            REVISION_REQUIRED (MCP only: a set or remove of an existing resource
            without its revision), NOT_PUBLISHED (409), SCENE_IN_USE (409),
            DRAFT_NOT_SAVED (409), SCENE_OFFLINE (409), SCENE_REFUSED (409),
            INGEST_KEY_REVOKED (409), CAMERA_PULL_GONE (409), SECRETS_FULL
            (409), PRECONDITION_FAILED (412; currentRevision), TOO_LARGE (413),
            UNSUPPORTED_MEDIA_TYPE (415), INVALID_INPUT (422),
            IDEMPOTENCY_KEY_REUSED (422), CHECK_FAILED (422), SCENE_INVALID
            (422), CAMERA_INVALID (422), CAMERA_PRIVATE_ADDRESS (422),
            SECRET_MISSING (422), RATE_LIMITED (429), CAMERA_TEST_BUSY (429),
            INTERNAL (500), NOT_SUPPORTED (501), UNAVAILABLE (502 or 503),
            INGEST_UNAVAILABLE (503), CAMERAS_UNAVAILABLE (503),
            SECRETS_UNAVAILABLE (503), SCENE_TIMEOUT (504)
        detail:
          type: string
          description: What happened and what to do
        errors:
          type: array
          description: Each problem, when there are several (a check's findings)
          items:
            type: object
            properties:
              line:
                type: integer
              path:
                type: string
              node:
                type: string
              message:
                type: string
            additionalProperties: true
        currentRevision:
          type:
            - string
            - 'null'
          description: >-
            CONFLICT / PRECONDITION_FAILED: the resource's revision now; null
            when it no longer exists
  responses:
    Problem:
      description: An RFC 7807 problem; branch on `code`
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        A Streamloop API key (`sl_…`). It carries no workspace: send
        `X-Workspace-Id` too (400 WORKSPACE_REQUIRED otherwise).
    oauth:
      type: http
      scheme: bearer
      description: >-
        An OAuth access token (as Streamloop's MCP server uses). Each operation
        needs the scope named in its `x-scope`: streamloop:read ⊂
        streamloop:write ⊂ streamloop:destructive (403 INSUFFICIENT_SCOPE).

````

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