Logstreem
Create a dataset
POST

Create a dataset

Create one explicitly, to set retention or region before the first event.

Sending to a new dataset name creates it with defaults. Create it explicitly when you need a non-default retention or a pinned region — region is immutable afterwards.

POST/v1/datasets

Body parameters

namestringrequired

Lowercase letters, digits, hyphens, underscores. 1–128 characters.

descriptionstring

Shown in the console.

retention_daysintegerdefault 90

1–400. See retention.

regionenumdefault us-east

Storage region. Cannot be changed later.

us-eastus-westeu-centraleu-westap-southeastsa-east

curl -X POST https://api.logstreem.com/v1/datasets \
  -H "Authorization: Bearer $LOGSTREEM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"audit-trail","retention_days":400,"region":"eu-central"}'

Responses

201Created
{
  "object": "dataset",
  "id": "ds_9f2c7b1a4d8e0c3f6a5b",
  "name": "audit-trail",
  "description": "Production dataset.",
  "events": 0,
  "fields": 148,
  "retention_days": 400,
  "region": "us-east",
  "created_at": "2026-04-11T12:00:00.000Z"
}
409Exists
{
  "error": {
    "type": "invalid_request_error",
    "code": "dataset_exists",
    "message": "A dataset named 'audit-trail' already exists.",
    "param": "name",
    "doc_url": "https://logstreem.com/docs/errors#dataset_exists",
    "request_id": "req_6b2c8f0e94a1d75c30ee"
  }
}
401Unauthorized
{
  "error": {
    "type": "authentication_error",
    "code": "missing_token",
    "message": "No API token provided.",
    "doc_url": "https://logstreem.com/docs/errors#missing_token",
    "request_id": "req_9f3c2a7b41de08c5b2e6"
  }
}
Try itsandbox