Create a source

Returns a newly created source.

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

Headers

Authorization
required string

Body parameters

team_name
string
name
required string
ingesting_paused
boolean
platform
string
live_tail_pattern
string
logs_retention
integer
metrics_retention
integer
200

Response body

{
  "id": "95",
  "type": "source",
  "attributes": {
    "team_id": 123,
    "name": "Nginx",
    "table_name": "nginx",
    "platform": "nginx",
    "token": "FczKcxEhjEDE58dBX7XaeX1q",
    "ingesting_paused": false,
    "logs_retention": 7,
    "metrics_retention": 14,
    "live_tail_pattern": "{level} {host} {nginx.status} {nginx.method} {nginx.host} {nginx.path} {nginx.client} {nginx.agent} {message}",
    "created_at": "2021-05-27T12:30:41.695Z",
    "updated_at": "2021-06-11T14:00:50.756Z"
  }
}
422

Response body

{
  "errors": "Your plan doesn't support custom retention",
  "invalid_attributes": [
    "logs_retention",
    "metrics_retention"
  ]
}