---
title: "Enable or disable one news source"
canonical_url: "https://tweetstream.io/docs/api/set-news-source-enabled"
last_updated: 2026-11-05
---

# Enable or disable one news source

PATCH /api/news/sources turns one news source on or off for your stream by sourceId. It returns the source; 409 means it is not available right now.

Canonical URL: https://tweetstream.io/docs/api/set-news-source-enabled

## `PATCH /api/news/sources`

`https://api.tweetstream.io/api/news/sources`

## Authorization

| Name | Type | Description |
| --- | --- | --- |
| `Authorization` | `string`, required | Bearer authentication with your TweetStream API key: `Bearer <key>`. |

## Body

| Name | Type | Description |
| --- | --- | --- |
| `enabled` | `boolean`, required |  |
| `sourceId` | `string`, required |  |

### Body example

```json
{
  "enabled": true,
  "sourceId": "bbc-news"
}
```

## Response fields

| Name | Type | Description |
| --- | --- | --- |
| `source` | `object`, required |  |
| `source.available` | `boolean`, required |  |
| `source.enabled` | `boolean`, required |  |
| `source.icon` | `string`, required |  |
| `source.id` | `string`, required |  |
| `source.name` | `string`, required |  |

## Responses

| Status | Description | Headers |
| --- | --- | --- |
| `200` | Success |  |
| `400` | Invalid request |  |
| `401` | Missing or invalid API key |  |
| `403` | The authenticated account cannot use this capability |  |
| `409` | The source is not currently available |  |
| `500` | The request could not be completed |  |

### 200

```json
{
  "source": {
    "available": true,
    "enabled": true,
    "icon": "<string>",
    "id": "<string>",
    "name": "<string>"
  }
}
```

### 400

```json
{
  "error": "<string>"
}
```

### 401

```json
{
  "error": "<string>"
}
```

### 403

```json
{
  "error": "<string>"
}
```

### 409

```json
{
  "error": "<string>"
}
```

### 500

```json
{
  "error": "<string>"
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url https://api.tweetstream.io/api/news/sources \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "enabled": true,
  "sourceId": "bbc-news"
}'
```

### JavaScript

```javascript
const response = await fetch("https://api.tweetstream.io/api/news/sources", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "enabled": true,
    "sourceId": "bbc-news"
  }),
});

console.log(response.status, await response.json());
```

### Python

```python
import os
import requests

response = requests.patch(
    "https://api.tweetstream.io/api/news/sources",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
    json={
        "enabled": True,
        "sourceId": "bbc-news",
    },
)

print(response.status_code, response.json())
```
