---
title: "Update Monitor"
description: "Updates monitor settings. Changing the webhook URL clears any webhook_failing status."
---

> Documentation Index
> Fetch the complete documentation index at: https://staging.threadapi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

Path: ThreadAPI API › Monitors

`PATCH /v1/monitors/{id}`

Updates monitor settings. Changing the webhook URL clears any webhook_failing status.

## Authentication

Requires one of the following:

- `bearerAuth`, http, header `Authorization`
- `apiKeyAuth`, apiKey, in header, header `x-api-key`

## Path parameters

- `id` (`updateMonitor.path.id`; string, required)

## Request body

_Required._

- `name` (`updateMonitor.name`; string, optional)
- `keywords` (`updateMonitor.keywords`; array<string>, optional)
- `exclude` (`updateMonitor.exclude`; array<string>, optional)
- `subreddits` (`updateMonitor.subreddits`; array<string>, optional)
- `posts` (`updateMonitor.posts`; boolean, optional)
- `comments` (`updateMonitor.comments`; boolean, optional)
- `nsfw` (`updateMonitor.nsfw`; boolean, optional)
- `webhook_url` (`updateMonitor.webhook_url`; string | null, optional)
- `webhook_kind` (`updateMonitor.webhook_kind`; string | null, optional)
  - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null`

## Example request

```json
{
  "name": "string",
  "keywords": [
    "string"
  ],
  "exclude": [
    "string"
  ],
  "subreddits": [
    "string"
  ],
  "posts": true,
  "comments": true,
  "nsfw": true,
  "webhook_url": "string",
  "webhook_kind": "generic"
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.threadapi.dev/v1/monitors/<id>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "keywords": [
    "string"
  ],
  "exclude": [
    "string"
  ],
  "subreddits": [
    "string"
  ],
  "posts": true,
  "comments": true,
  "nsfw": true,
  "webhook_url": "string",
  "webhook_kind": "generic"
}
'
```

### TypeScript

```typescript
const url = 'https://api.threadapi.dev/v1/monitors/<id>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'string',
    keywords: ['string'],
    exclude: ['string'],
    subreddits: ['string'],
    posts: true,
    comments: true,
    nsfw: true,
    webhook_url: 'string',
    webhook_kind: 'generic'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.threadapi.dev/v1/monitors/<id>"

payload = {
    "name": "string",
    "keywords": ["string"],
    "exclude": ["string"],
    "subreddits": ["string"],
    "posts": True,
    "comments": True,
    "nsfw": True,
    "webhook_url": "string",
    "webhook_kind": "generic"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Updated monitor

#### Example

```json
{
  "monitor": {
    "id": "string",
    "name": "string",
    "keywords": [
      "string"
    ],
    "exclude": [
      "string"
    ],
    "subreddits": [
      "string"
    ],
    "include_posts": true,
    "include_comments": true,
    "nsfw": true,
    "webhook_url": "string",
    "webhook_kind": "generic",
    "status": "active",
    "webhook_failing": true,
    "next_charge_at": "2019-08-24T14:15:22Z",
    "last_match_at": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
```

- `monitor` (`updateMonitor.response.200.monitor`; object, optional)
  - `id` (`updateMonitor.response.200.monitor.id`; string, required)
  - `name` (`updateMonitor.response.200.monitor.name`; string, required)
  - `keywords` (`updateMonitor.response.200.monitor.keywords`; array<string>, required)
  - `include_posts` (`updateMonitor.response.200.monitor.include_posts`; boolean, required)
  - `include_comments` (`updateMonitor.response.200.monitor.include_comments`; boolean, required)
  - `nsfw` (`updateMonitor.response.200.monitor.nsfw`; boolean, required)
  - `status` (`updateMonitor.response.200.monitor.status`; string, required)
    - one of `"active"`, `"paused"`, `"paused_balance"`, `"deleted"`
  - `next_charge_at` (`updateMonitor.response.200.monitor.next_charge_at`; string, required)
    - format `date-time`
  - `created_at` (`updateMonitor.response.200.monitor.created_at`; string, required)
    - format `date-time`
  - `updated_at` (`updateMonitor.response.200.monitor.updated_at`; string, required)
    - format `date-time`
  - `exclude` (`updateMonitor.response.200.monitor.exclude`; array<string>, optional)
  - `subreddits` (`updateMonitor.response.200.monitor.subreddits`; array<string>, optional)
  - `webhook_url` (`updateMonitor.response.200.monitor.webhook_url`; string | null, optional)
  - `webhook_kind` (`updateMonitor.response.200.monitor.webhook_kind`; string | null, optional)
    - one of `"generic"`, `"slack"`, `"discord"`, `"telegram"`, `null`
  - `webhook_failing` (`updateMonitor.response.200.monitor.webhook_failing`; boolean, optional)
  - `last_match_at` (`updateMonitor.response.200.monitor.last_match_at`; string | null, optional)
    - format `date-time`

### 400

Bad request (invalid parameter or unknown action)

#### Example

```json
{
  "error": "unauthorized: missing or invalid credentials",
  "error_code": "insufficient_credits"
}
```

One of:

- `ErrorResponse`
- `Error`

### 401

Missing or invalid API key or OAuth access token

#### Example

```json
{
  "error": "unauthorized: missing or invalid credentials",
  "error_code": "insufficient_credits"
}
```

One of:

- `ErrorResponse`
- `Error`

### 404

Requested user or resource not found

#### Example

```json
{
  "error": "unauthorized: missing or invalid credentials",
  "error_code": "insufficient_credits"
}
```

One of:

- `ErrorResponse`
- `Error`


Source: https://staging.threadapi.dev/api/Monitors/updateMonitor/index.md
