Add or replace one of a keyword's sources
keyword_source_setAdd a Source to a keyword, or replace one Source's searches, interval or enabled state, leaving every other Source untouched. Two calls. The first, with mode "estimate" and no estimateToken, writes nothing and returns the estimate of the change: monthlyCredits before and after, and resetSearches, the searches whose criteria change and whose next check starts from a fresh baseline without emitting what it finds. Show both to the person. The second, with mode "write", the same arguments and that estimateToken, writes it, and fails if the save started over a search the estimate did not announce. applied says which of the two happened: only applied=true is a save. Example, AI answers: source "ai_answers", refreshIntervalSeconds 604800, one search per prompt with overridesEnabled true and overrides {"filters": {"prompt": "...", "brands": ["YourBrand"], "engines": ["chatgpt", "gemini", "perplexity"]}}; switch coBrandsEnabled with keyword_update. Starts or changes polling that is charged per check at each Source's credit rate (AI answers per engine asked) until the keyword or the Source is paused. Call keyword_estimate first, show the person the monthlyCredits it returns, and send its estimateToken only after they agree.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Keyword id, from list_keywords. Another account's id is a 404, never a 403. | |
| mode | Yes | estimate writes nothing and returns the price of this change with its estimateToken; it takes no estimateToken. write saves the change and requires the estimateToken of an estimate made with the same arguments. | |
| source | Yes | ||
| enabled | Yes | false switches the Source off and removes its checks; its searches stay stored. To stop it for a while, use keyword_source_manage instead. | |
| searches | No | Replaces this Source's searches. Keep the id of each search you keep. Absent keeps the stored searches. | |
| estimateToken | No | mode "write" only, and required there: the estimateToken the mode "estimate" call returned for these same arguments. Valid 15 minutes. | |
| refreshIntervalSeconds | No | This Source's own seconds between checks. null goes back to the keyword's refreshIntervalSeconds. Each Source has its own band: AI answers runs between 6 hours (21600) and 7 days (604800). |