Create a warehouse source

Creates a new Warehouse source.

POST https://warehouse.betterstack.com/api/v1/sources

Headers

Authorization
required string
Content-Type
required string

Body parameters

name
required string
data_region
string
events_retention
integer
time_series_retention
integer
live_tail_pattern
string
vrl_transformation
string
source_group_id
string
201

Response body

{
  "data": {
    "id": "5678",
    "type": "warehouse_source",
    "attributes": {
      "warehouse_source_group_id": null,
      "team_id": 123456,
      "team_name": "example-team",
      "name": "new_user_events",
      "table_name": "new_user_events",
      "token": "abc123def456ghi789jkl012",
      "ingesting_paused": false,
      "ingesting_host": "s5678.us-east-9.betterstackdata.com",
      "created_at": "2025-10-06T09:24:10Z",
      "updated_at": "2025-10-21T16:38:50Z",
      "events_retention": 9999999,
      "time_series_retention": 9999999,
      "live_tail_pattern": "{status} {message}",
      "data_region": "us-east-9",
      "custom_bucket": null,
      "vrl_transformation": ""
    }
  }
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
422

Response body

{
  "errors": "Sorry, you are missing some required attributes",
  "required_attributes": [
    "name"
  ]
}

Example cURL

Example
curl --request POST \
  --url https://warehouse.betterstack.com/api/v1/sources \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "New User Events",
    "data_region": "us_east",
    "events_retention": 30
  }'