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

# Use a Stream Template

> Retrieve a template's stream creation payload, ready to post as a new stream.

## Overview

Returns the stream creation payload the template was saved from: the exact
configuration of that stream, including its source, audio selections,
processing profiles, pipelines and targets.

The returned payload is compatible with the
[Create Stream](create-new-stream) request body. Its `start_time` and
`end_time` are the original stream's schedule and will be in the past, so set
them to your new broadcast window before creating the stream.

Templates are scoped to your workspace: requesting a template that belongs to
another workspace returns `404`.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://client.camb.ai/apis/stream/templates/12/payload" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://client.camb.ai/apis/stream/templates/12/payload",
      headers={"x-api-key": "YOUR_API_KEY"},
  )
  response.raise_for_status()

  payload = response.json()["payload"]

  # Reschedule, then create a new stream from the template.
  payload["start_time"] = "2026-08-15T18:45:00+02:00"
  payload["end_time"] = "2026-08-15T21:00:00+02:00"

  created = requests.post(
      "https://client.camb.ai/apis/stream",
      headers={"x-api-key": "YOUR_API_KEY"},
      json=payload,
  )
  created.raise_for_status()
  print(created.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "payload": {
      "name": "Matchday 3: home fixture",
      "source_stream": {
        "id": "stadium_feed",
        "url": "srt://ingest.example.com:9000",
        "category": 2
      },
      "audio_selections": [
        {
          "id": "commentary",
          "source": "$first_audio",
          "source_language": 1
        }
      ],
      "processing_profiles": [
        {
          "id": "full_dub",
          "demixing": "fast_model",
          "transcribing": "fast_model",
          "translating": "best_model",
          "revoicing": "fast_model"
        }
      ],
      "pipelines": [
        {
          "id": "spanish",
          "audio_selection": "commentary",
          "profile": "full_dub",
          "outputs": [
            { "id": "audio_es", "kind": "audio", "language": 37 },
            { "id": "subtitle_es", "kind": "subtitle", "language": 37 }
          ]
        }
      ],
      "target_streams": [
        {
          "id": "delivery",
          "type": 1,
          "url": "srt://delivery.example.com:9100",
          "inputs": [{ "asset_id": "audio_es" }]
        }
      ],
      "start_time": "2026-08-01T18:45:00+02:00",
      "end_time": "2026-08-01T21:00:00+02:00",
      "timezone": "Europe/Madrid"
    }
  }
  ```
</ResponseExample>

## Related endpoints

* [List Stream Templates](list-templates)
* [Create Stream](create-new-stream)


## OpenAPI

````yaml get /stream/templates/{template_id}/payload
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /stream/templates/{template_id}/payload:
    get:
      tags:
        - Apis
        - Streaming
      summary: Use a Stream Template
      description: >-
        Retrieve a template's stream creation payload: the exact configuration
        of the stream it was saved from. Adjust start_time and end_time, then
        post it to Create Stream.
      operationId: get_stream_template_payload_stream_templates__template_id__payload_get
      parameters:
        - name: template_id
          in: path
          required: true
          schema:
            type: integer
            exclusiveMinimum: 0
            title: Template Id
      responses:
        '200':
          description: The template's stream creation payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetStreamTemplatePayloadOut'
        '404':
          description: No template with this id exists in your workspace.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    GetStreamTemplatePayloadOut:
      type: object
      title: GetStreamTemplatePayloadOut
      required:
        - payload
      properties:
        payload:
          type: object
          title: Payload
          description: >-
            A stream creation payload compatible with the Create Stream request
            body. Adjust start_time and end_time before creating a stream from
            it.
          additionalProperties: true
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        The `x-api-key` is a custom header required for authenticating requests
        to our API. Include this header in your request with the appropriate API
        key value to securely access our endpoints. You can find your API key(s)
        in the 'API' section of our studio website.

````