---
title: "Update an existing stream by id."
method: PATCH
path: "/streams/{id}"
tags: ["Stream Operations"]
---

# Update an existing stream by id.

`PATCH /streams/{id}`

## Request

- Base URL: `https://replace-with-account.api.decodable.co/v1alpha2`
- URL: `https://replace-with-account.api.decodable.co/v1alpha2/streams/{id}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://auth.decodable.co/authorize?audience=https://api.decodable.co/`
    - Token URL: `https://auth.decodable.co/oauth/token` scopes: `write:stream`
- TypeScript: <https://skmtc.dev/decodable/apis/decodable-control-plane/docs/streams/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Requires permission matching: `stream:write:default.<name>`.

## Query parameters

- `response_schema_v` 'v1' | 'v2'

## Request body

- StreamCommon: `kind: stream`, `spec_version: v1`.
  - `name` string: The stream name.
  - `description` string: The stream description.
  - `watermark` string: The stream watermark strategy.
  - `schema` object[]: Record schema.
    - `name` string: The field name.
    - `type` string: The field type.
  - `schema_v2` SchemaV2: Record schema, version 2.
    - `fields` union[]: The fields in this schema.
      - union
        - PhysicalField: A physical field.
          - `kind` 'physical', required
          - `name` string
          - `type` string
        - ComputedField: A computed field.
          - `kind` 'computed', required
          - `name` string
          - `expression` string
        - MetadataField: A metadata field.
          - `kind` 'metadata', required
          - `name` string
          - `type` string
          - `key` string
    - `watermarks` object[]: Watermark expressions for this stream. At this time only one expression is supported.
      - `name` string
      - `expression` string
    - `constraints` object
      - `primary_key` string[]: Column names to use for primary key.
  - `properties` object: The stream properties.
  - `partition_key` string[]: The fields to use to partition data in the stream

## Response `200`

A stream update response.

- union
  - object: `kind: stream`, `spec_version: v1`.
    - `id` string: An opaque ID, created by Decodable, that uniquely identifies a resource.
    - `type` 'APPEND' | 'CHANGE': The stream type.
    - `name` string: The stream name.
    - `description` string: The stream description.
    - `watermark` string: The stream watermark strategy.
    - `schema` object[], required: Record schema.
      - `name` string: The field name.
      - `type` string: The field type.
    - `schema_v2` SchemaV2: Record schema, version 2.
      - `fields` union[]: The fields in this schema.
        - union
          - PhysicalField: A physical field.
            - `kind` 'physical', required
            - `name` string
            - `type` string
          - ComputedField: A computed field.
            - `kind` 'computed', required
            - `name` string
            - `expression` string
          - MetadataField: A metadata field.
            - `kind` 'metadata', required
            - `name` string
            - `type` string
            - `key` string
      - `watermarks` object[]: Watermark expressions for this stream. At this time only one expression is supported.
        - `name` string
        - `expression` string
      - `constraints` object
        - `primary_key` string[]: Column names to use for primary key.
    - `properties` object: The stream properties.
    - `partition_key` string[]: The fields to use to partition data in the stream
    - `create_time` string, date-time: The date and time the resource was created.
    - `update_time` string, date-time: The date and time the resource was updated.
  - object: `kind: stream`, `spec_version: v1`.
    - `id` string: An opaque ID, created by Decodable, that uniquely identifies a resource.
    - `type` 'APPEND' | 'CHANGE': The stream type.
    - `name` string: The stream name.
    - `description` string: The stream description.
    - `watermark` string: The stream watermark strategy.
    - `schema` object[]: Record schema.
      - `name` string: The field name.
      - `type` string: The field type.
    - `schema_v2` SchemaV2, required: Record schema, version 2.
      - `fields` union[]: The fields in this schema.
        - union
          - PhysicalField: A physical field.
            - `kind` 'physical', required
            - `name` string
            - `type` string
          - ComputedField: A computed field.
            - `kind` 'computed', required
            - `name` string
            - `expression` string
          - MetadataField: A metadata field.
            - `kind` 'metadata', required
            - `name` string
            - `type` string
            - `key` string
      - `watermarks` object[]: Watermark expressions for this stream. At this time only one expression is supported.
        - `name` string
        - `expression` string
      - `constraints` object
        - `primary_key` string[]: Column names to use for primary key.
    - `properties` object: The stream properties.
    - `partition_key` string[]: The fields to use to partition data in the stream
    - `create_time` string, date-time: The date and time the resource was created.
    - `update_time` string, date-time: The date and time the resource was updated.

## Other responses

- `400`: An invalid request was received.
- `403`: Access denied: requesting user lacks a required permission.
- `404`: The requested resource does not exist.
- `409`: A resource conflict has been detected.
- `default`: An error has occurred.

---

[API](https://skmtc.dev/decodable/apis/decodable-control-plane.md) - [All operations](https://skmtc.dev/decodable/apis/decodable-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/decodable/apis/decodable-control-plane/revisions/9718a3019da8?raw)
