> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# createStream

> Create a new stream for a conference.

Create a new stream for a conference, enabling external streaming output
(e.g., RTMP to a streaming platform).

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/video/conferences/{id}/streams:
    post:
      operationId: create_conference_stream
      summary: Create conference stream
      description: >-
        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Video_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_streams
      parameters:
        - name: id
          in: path
          description: Unique id of a video conference
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Stream response object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video.Stream'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '422':
          description: The request contains invalid parameters. See errors for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video.VideoStatusCode422'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Video.CreateStreamRequest'
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    Video.CreateStreamRequest:
      type: object
      properties:
        url:
          type: string
          description: >-
            RTMP or RTMPS URL. This must be the address of a server accepting
            incoming RTMP/RTMPS streams.
      required:
        - url
      description: Request body for creating a stream.
      title: Video.CreateStreamRequest
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    Video.Stream:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: Unique identifier for the stream.
        url:
          type:
            - string
            - 'null'
          description: >-
            RTMP or RTMPS URL. This must be the address of a server accepting
            incoming RTMP/RTMPS streams.
        stream_type:
          type:
            - string
            - 'null'
          description: The type of stream.
        width:
          type:
            - integer
            - 'null'
          description: The stream's width in pixels.
        height:
          type:
            - integer
            - 'null'
          description: The stream's height in pixels.
        fps:
          type:
            - integer
            - 'null'
          description: The stream's frames per second.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the stream was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the stream was last updated.
      required:
        - id
        - url
        - stream_type
        - width
        - height
        - fps
        - created_at
        - updated_at
      description: A video stream object.
      title: Video.Stream
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    Types.StatusCodes.RestApiErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The category of error.
        code:
          type: string
          description: A specific error code.
        message:
          type: string
          description: A description of what caused the error.
        attribute:
          type:
            - string
            - 'null'
          description: The request parameter that caused the error, if applicable.
        url:
          type: string
          description: A link to documentation about this error.
      required:
        - type
        - code
        - message
        - url
      description: Details about a specific error.
      title: Types.StatusCodes.RestApiErrorItem
    Video.VideoStatusCode422:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Types.StatusCodes.RestApiErrorItem'
          description: List of validation errors.
      required:
        - errors
      description: The request contains invalid parameters. See errors for details.
      title: Video.VideoStatusCode422
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (200)

```json
{
  "id": "c22d24f6-5a47-4597-9a23-c7d01e696b92",
  "url": "rtmp://broadcaster",
  "stream_type": "rtmp",
  "width": 1920,
  "height": 1080,
  "fps": 20,
  "created_at": "2022-01-01T10:00:00Z",
  "updated_at": "2022-01-01T11:00:00Z"
}
```

## **Example**

```typescript {9}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com",
});

const stream = await client.video.conferences.createStream("conference-id", {
  url: "rtmp://live.example.com/key",
});
```