# Update a warehouse source

Updates an existing Warehouse source. Only provided parameters will be changed.

[endpoint]
base_url = "https://warehouse.betterstack.com"
path = "/api/v1/sources/{id}"
method = "PATCH"

[[path_param]]
name = "id"
description = "The ID of the Warehouse source to update."
required = true
type = "string"

[[body_param]]
name = "name"
description = "The new name for the Warehouse source. Can contain letters, numbers, spaces, and special characters. Source names do not need to be unique."
required = false
type = "string"

[[body_param]]
name = "events_retention"
description = "The new retention period for event data in days."
required = false
type = "integer"

[[body_param]]
name = "time_series_retention"
description = "The new retention period for time series data in days."
required = false
type = "integer"

[[body_param]]
name = "live_tail_pattern"
description = "A new display template for live tail messages. Default is `\"{status} {message}\"`."
required = false
type = "string"

[[body_param]]
name = "vrl_transformation"
description = "A new VRL program for real-time data transformation. Read more about [VRL transformations](https://betterstack.com/docs/logs/using-logtail/transforming-ingested-data/logs-vrl/)."
required = false
type = "string"

[[body_param]]
name = "ingesting_paused"
description = "Set to `true` to pause ingestion, `false` to resume."
required = false
type = "boolean"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"

[[header]]
name = "Content-Type"
description = "application/json"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = '''The updated Warehouse source.'''
body = '''{
  "data": {
    "id": "5678",
    "type": "warehouse_source",
    "attributes": {
      "warehouse_source_group_id": 1234,
      "team_id": 123456,
      "team_name": "example-team",
      "name": "User Events Updated",
      "table_name": "warehouse_test",
      "token": "abc123def456ghi789jkl012",
      "ingesting_paused": true,
      "ingesting_host": "s5678.us-east-9.betterstackdata.com",
      "created_at": "2025-10-06T09:24:10Z",
      "updated_at": "2025-10-21T16:38:50Z",
      "events_retention": 90,
      "time_series_retention": 180,
      "live_tail_pattern": "{status} {message}",
      "data_region": "eu-nbg-2",
      "custom_bucket": null,
      "vrl_transformation": ""
    }
  }
}'''

[[response]]
status = 401
description = '''Unauthorized'''
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"
}'''

[[response]]
status = 404
description = '''Not Found'''
body = '''{
  "errors":"Resource with the provided ID was not found"
}'''

[[response]]
status = 422
description = '''Unprocessable Entity - Validation Errors'''
body = '''{
  "errors":"Sorry, you are missing some required attributes",
  "required_attributes":["name"]
}'''
[/responses]

#### Example cURL

```shell
[label Example]
curl --request PATCH \
  --url https://warehouse.betterstack.com/api/v1/sources/5678 \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "User Events Updated",
    "ingesting_paused": true
  }'
```
