Skip to main content
POST
Create Stream

Overview

Create a new stream with an optional configuration. The stream name must be unique within the basin.

Authentication

This endpoint requires authentication via the S2-Basin header containing your basin name.

Headers

string
Optional idempotency token to ensure the request is processed only once. If a stream with the same name already exists and was created with the same token, returns the existing stream instead of an error.

Request Body

string
required
Stream name that is unique to the basin. Can be between 1 and 512 bytes in length.Example: logs/application, metrics/cpu, events/user-actions
StreamConfig
Optional stream configuration. If not provided, basin defaults will be used.

Response

Returns HTTP 201 Created on success.
string
Stream name.
string
Creation time in RFC 3339 format.
string | null
Always null for newly created streams.

Example Request

cURL

Example Response

Error Responses

  • 409 Conflict - Stream with this name already exists
  • 400 Bad Request - Invalid stream name or configuration
  • 404 Not Found - Basin does not exist