mySDRDocs

API reference

Update a monitor

Changes a monitor: send what changes, and what you leave out stays. keywords replaces the whole list: GET the monitor, change what you need and send the list back (paused: true on a keyword pauses only that keyword). max_credits_per_day: null removes the cap. Each field you send is checked like POST /monitors; what the monitor already has is not checked again, so pausing always works. A new schedule moves the next run to at most one new period away. Changing a monitor never charges and does not touch the mentions it already delivered; a later run charges per new mention, as before.

PATCHhttps://mysdr.app/api/v1/monitors/{monitor_id}
View Markdown

Authentication

Send Authorization: Bearer gtk_…. Create the key under Connect assistant → API keys. A missing, invalid or revoked key is 401. A valid key while this API is not enabled for your organization answers 403 api_not_enabled, with what the key can do instead. Every response includes mySDR-Api-Version, mySDR-Request-Id and Cache-Control: no-store, and a response to an accepted key also X-RateLimit-* (so not a 401, a 405, an OPTIONS or a 404 for an unknown path).

Path parameters

  • monitor_id string · required — The monitor.

Body parameters

  • name string — 1 to 120 characters.
  • status string — active or paused. Resuming is 403 while the key is read-only. One of: active, paused.
  • keywords array — The whole new list: 1 to 10 keywords, as in Create a monitor, each with paused if you want.
  • schedule string — daily. hourly is not available yet (400); a monitor that already runs hourly keeps it. One of: daily, hourly.
  • min_relevance string — high, medium or low. One of: high, medium, low.
  • tags string[] — Tags to keep; an empty list keeps every tag.
  • max_credits_per_day integer | null — The daily cap, at least the price of one mention, or null for no cap.

Response

  • id string · required — Monitor id, mon_….
  • object string · required — Always monitor. One of: monitor.
  • name string · required — The name you gave it.
  • status string · required — active, paused, or deleted after DELETE. One of: active, paused, deleted.
  • schedule string · required — daily. hourly is not available yet. One of: daily, hourly.
  • keywords object[] · required — Each keyword with all its settings, exact_match and case_sensitive included, and paused.
  • min_relevance string · required — high, medium or low. One of: high, medium, low.
  • max_credits_per_day integer | null — Daily cap, or null for none.
  • credits_today integer · required — Credits this monitor spent today (Europe/Brussels calendar day).
  • credits_charged integer · required — Credits charged so far.
  • next_run_at string | null · required — When the next run starts; null while the monitor is paused or deleted.
  • last_run object | null · required — What the last run did: at, mentions_delivered, credits_charged and stopped_by. stopped_by is null when the run read everything it found, or max_credits_per_day (the monitor’s cap), daily_limit (the organization’s daily limit), balance (the wallet), or paused or deleted (the monitor was paused or deleted during the run, which stops the charging). A run that a cap or the balance stopped before it read anything shows 0 mentions with that reason. Null before the first run.
  • deleted_at string | null · required — When DELETE stopped the monitor.
  • mentions_readable_until string | null · required — For a deleted monitor: until when it and its mentions stay readable (30 days after DELETE).

Credits

Free.

Errors

  • 400 invalid_request — A field is unknown, name is empty, a keyword is not valid, the cap is below the price of one mention, or webhook_endpoint_id is an id.
  • 409 invalid_state — The monitor is deleted.
  • 404 not_found — No monitor with this id exists for your organization.
  • 401 authentication_error — The Authorization header is missing, or the key is unknown or revoked.
  • 403 permission_error — API access is not part of your plan, or your account is suspended.
  • 403 api_not_enabled — The key is valid, but the Signals API or the Company API is not enabled for your organization yet. The error says what this key can do.
  • 429 rate_limit_error — More than 60 requests per minute, or more than 3 at the same time, on one key. Wait for the Retry-After header.
  • 500 internal_error — Something went wrong on our side.

Example

cURL

curl -X PATCH "https://mysdr.app/api/v1/monitors/mon_01J9Z6P8C8V0K3W6T2N8R5M1XF" \
  -H "Authorization: Bearer $MYSDR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": [
      {
        "keyword": "Acme Analytics",
        "paused": true
      },
      "Acme reporting"
    ],
    "max_credits_per_day": 25
  }'

JavaScript

const response = await fetch('https://mysdr.app/api/v1/monitors/mon_01J9Z6P8C8V0K3W6T2N8R5M1XF', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.MYSDR_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "keywords": [
      {
        "keyword": "Acme Analytics",
        "paused": true
      },
      "Acme reporting"
    ],
    "max_credits_per_day": 25
  })
});
const body = await response.json();

Python

import json
import os
import urllib.request

payload = {
  "keywords": [
    {
      "keyword": "Acme Analytics",
      "paused": True
    },
    "Acme reporting"
  ],
  "max_credits_per_day": 25
}

request = urllib.request.Request(
    "https://mysdr.app/api/v1/monitors/mon_01J9Z6P8C8V0K3W6T2N8R5M1XF",
    headers={
    "Authorization": f"Bearer {os.environ['MYSDR_API_KEY']}",
    "Content-Type": "application/json"
    },
    data=json.dumps(payload).encode(),
    method="PATCH",
)
with urllib.request.urlopen(request) as response:
    body = json.load(response)

Example response

{
  "id": "mon_01J9Z6P8C8V0K3W6T2N8R5M1XF",
  "object": "monitor",
  "status": "active",
  "max_credits_per_day": 25
}