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

# Add a multistream target



## OpenAPI

````yaml POST /stream/{id}/create-multistream-target
openapi: 3.1.0
info:
  title: Livepeer API Reference
  description: |
    Welcome to the Livepeer API reference docs. Here you will find all the
    endpoints exposed on the standard Livepeer API, learn how to use them and
    what they return.
  version: 1.0.0
servers:
  - url: https://livepeer.studio/api
security:
  - apiKey: []
tags:
  - name: stream
    description: Operations related to livestream api
  - name: asset
    description: Operations related to asset/vod api
  - name: webhook
    description: Operations related to webhook api
  - name: multistream
    description: Operations related to multistream api
  - name: session
    description: Operations related to session api
  - name: room
    description: Operations related to rooms api
  - name: transcode
    description: Operations related to transcode api
  - name: metrics
    description: Operations related to metrics api
  - name: playback
    description: Operations related to playback api
  - name: accessControl
    description: Operations related to access control/signing keys api
  - name: task
    description: Operations related to tasks api
  - name: generate
    description: Operations related to AI generate api
paths:
  /stream/{id}/create-multistream-target:
    post:
      tags:
        - stream
      summary: Add a multistream target
      operationId: addMultistreamTarget
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: ID of the parent stream
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/target-add-payload'
      responses:
        '204':
          description: Success (No content)
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      x-codeSamples:
        - lang: typescript
          label: addMultistreamTarget
          source: |-
            import { Livepeer } from "livepeer";

            const livepeer = new Livepeer({
              apiKey: "<YOUR_BEARER_TOKEN_HERE>",
            });

            async function run() {
              const result = await livepeer.stream.addMultistreamTarget({
                profile: "720p0",
                videoOnly: false,
                id: "PUSH123",
                spec: {
                  name: "My target",
                  url: "rtmps://live.my-service.tv/channel/secretKey",
                },
              }, "<id>");

              // Handle the result
              console.log(result);
            }

            run();
        - lang: go
          label: addMultistreamTarget
          source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    s := livepeergo.New(\n        livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n    )\n\n    ctx := context.Background()\n    res, err := s.Stream.AddMultistreamTarget(ctx, \"<id>\", components.TargetAddPayload{\n        Profile: \"720p0\",\n        VideoOnly: livepeergo.Bool(false),\n        ID: livepeergo.String(\"PUSH123\"),\n        Spec: &components.TargetAddPayloadSpec{\n            Name: livepeergo.String(\"My target\"),\n            URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: addMultistreamTarget
          source: >-
            from livepeer import Livepeer


            s = Livepeer(
                api_key="<YOUR_BEARER_TOKEN_HERE>",
            )


            res = s.stream.add_multistream_target(id="<id>",
            target_add_payload={
                "profile": "720p0",
                "video_only": False,
                "id": "PUSH123",
                "spec": {
                    "name": "My target",
                    "url": "rtmps://live.my-service.tv/channel/secretKey",
                },
            })


            if res is not None:
                # handle response
                pass
components:
  schemas:
    target-add-payload:
      $ref: '#/components/schemas/target'
      type: object
      additionalProperties: false
    error:
      type: object
      properties:
        errors:
          type: array
          minItems: 1
          items:
            type: string
            example:
              - id not provided
              - Account not found
    target:
      type: object
      required:
        - profile
      additionalProperties: false
      properties:
        profile:
          type: string
          description: |
            Name of transcoding profile that should be sent. Use
            "source" for pushing source stream data
          minLength: 1
          maxLength: 500
          example: 720p0
        videoOnly:
          type: boolean
          description: |
            If true, the stream audio will be muted and only silent
            video will be pushed to the target.
          default: false
          example: false
        id:
          type: string
          description: ID of multistream target object where to push this stream
          example: PUSH123
        spec:
          type: object
          writeOnly: true
          description: |
            Inline multistream target object. Will automatically
            create the target resource to be used by the created
            stream.
          required:
            - url
          additionalProperties: false
          properties:
            name:
              type: string
              example: My target
            url: 2d40d583-52db-44b0-a09b-18e2f8dab8de
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````