Skip to main content
POST
/
basins
Create Basin
curl --request POST \
  --url https://api.example.com/basins \
  --header 'Content-Type: application/json' \
  --data '
{
  "basin": "<string>",
  "config": {
    "default_stream_config": {
      "storage_class": "<string>",
      "retention_policy": {},
      "timestamping": {
        "mode": "<string>",
        "uncapped": true
      },
      "delete_on_empty": {
        "min_age_secs": 123
      }
    },
    "create_stream_on_append": true,
    "create_stream_on_read": true
  },
  "scope": "<string>"
}
'
{
  "name": "<string>",
  "scope": "<string>",
  "state": "<string>"
}
Create a new basin with a globally unique name.

Headers

s2-request-token
string
Client-specified request token for idempotent retries.

Body Parameters

basin
string
required
Basin name which must be globally unique. It can be between 8 and 48 bytes in length, and comprise lowercase letters, numbers and hyphens. It cannot begin or end with a hyphen.
config
object
Basin configuration.
scope
string
Basin scope. This cannot be reconfigured after creation. Possible values: aws:us-east-1

Response

name
string
Basin name.
scope
string
Basin scope.
state
string
Basin state.

Example

curl -X POST "https://aws.s2.dev/v1/basins" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "basin": "my-new-basin",
    "config": {
      "default_stream_config": {
        "storage_class": "standard",
        "retention_policy": {"age": 604800}
      },
      "create_stream_on_append": true
    },
    "scope": "aws:us-east-1"
  }'

Response (201 Created)

{
  "name": "my-new-basin",
  "scope": "aws:us-east-1",
  "state": "creating"
}

Build docs developers (and LLMs) love