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

# update

> Update a stream using PUT.

Update a stream. Uses PUT for full replacement, so all fields must be provided
in the request body.

This method performs a full replacement (PUT), not a partial update (PATCH).
Include all fields you want to keep in the request body.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/video/streams/{id}:
    put:
      operationId: update_stream
      summary: Update 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 the stream.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
      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'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
        '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.UpdateStreamRequest'
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    Video.UpdateStreamRequest:
      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 updating a stream.
      title: Video.UpdateStreamRequest
    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
    TypesStatusCodesStatusCode404Error:
      type: string
      enum:
        - Not Found
      title: TypesStatusCodesStatusCode404Error
    Types.StatusCodes.StatusCode404:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode404Error'
      required:
        - error
      description: The server cannot find the requested resource.
      title: Types.StatusCodes.StatusCode404
    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**

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

stream = client.video.streams.update(
    "stream-id",
    url="rtmp://new-destination.example.com/key"
)
```