We use cookies to ensure you get the best experience on our website. Some of these cookies are provided by third parties. You are free to decide which categories you would like to permit and can withdraw this consent at any time (via cookie preferences link on the footer).
By accepting the necessary cookies, you agree to our privacy policy and terms of service, both located in the footer of the website.
Learn more on our terms of service and privacy policy.
Put a question on a schedule. An alert runs on a cron schedule, gathers what is new, and either checks whether a condition you described is met or writes a DeepNews report, then delivers the result by email, webhook, Google Docs or a Resend broadcast. AskNews runs the schedule, so there is nothing for you to operate.
Every parameter and the full response schema are in the API reference.
Use it when something should run on a schedule without you operating it: a daily report, or a notification when a condition is met. For a one-off answer, use DeepNews. For results your code handles straight away, use Live News Search.
Use something else when:
| You need | Use |
|---|---|
| A researched answer now | DeepNews |
| New articles for your own poller | Live News Search |
| Coverage from many outlets, clustered into storylines and followed as they develop | Storylines |
| Endpoints | /v1/chat/alerts: create, list, get, update, delete, run, logs |
| Python SDK | ask.chat.create_alert(), list_alerts(), get_alert(), update_alert(), delete_alert(), run_alert(), list_alert_logs() |
| CLI | asknews alerts |
| Scope | chat |
| Plans | Spelunker, Analyst, Enterprise |
| Cost | 1 credit per API call, and each run is billed for the searches and tokens it uses (costs) |
RileyRisk uses Alerts to watch Telegram channels and send air defense alerts to personnel across Ukraine, and to write a daily air defense report for its team.
At each scheduled time, the alert:
expires_at, or your balance is used up. You get an email when it stops for your balance.query is met, and why. A message that repeats one of the last three it sent counts as not met.A run that fails is retried, and the stages that already finished are not repeated, so a trigger that already went out is not sent twice.
alert_type | Each run | Use it for |
|---|---|---|
ReportAbout | Writes the report and fires the triggers | Daily or weekly briefings |
AlwaysAlertWhen | Checks the condition, and fires every time it is met | "Tell me every time X happens" |
AlertOnceIf | Checks the condition, fires the first time it is met, then pauses itself | "Tell me when X finally happens" |
A ReportAbout alert with a DeepNews report. The report's prompt is the research instruction, and its params take the same controls as DeepNews: model, sources, depth and filter_params.
A report needs no sources: the DeepNews run does its own research. Everything in Prompt deep research applies to the prompt, and the depth should match how much it asks for: a monitor of 20 companies at search_depth=2 skips most of them.
Enforce recency in two places: in the prompt ("last 24 hours only") and in filter_params (hours_back matching the schedule, with time_filter="pub_date").
| Field | What it does | Default |
|---|---|---|
prompt | The research instruction | Required |
params.model | The DeepNews model | claude-sonnet-5 |
params.sources | The DeepNews sources | ["asknews", "google", "wiki", "x"] |
params.search_depth, params.max_depth | The research depth | 2 and 4 |
timezone | The time zone for dates in the report | UTC |
include_appendix | Add an appendix of the sources | false |
logo_url | A logo for the top of the report | None |
asknews_watermark | Show the AskNews mark on the report | true |
Set the model and the depth explicitly. Send a list of reports to split a large monitor by theme: each report has its own prompt and depth, and their outputs are joined in order.
The report is published as a PDF at a public link, report_url, which the email links to and the log records.
An AlwaysAlertWhen or AlertOnceIf alert checks a condition on every run. The query is the condition, sources says where to look, and model is the small model that checks it.
alert = ask.chat.create_alert(
CreateAlertRequest(
title="Paris protests",
alert_type="AlwaysAlertWhen",
query="Alert me if there is a protest or demonstration happening in Paris.",
cron="*/15 * * * *",
model="gpt-4o-mini",
sources=[
{
"identifier": "asknews",
"params": {
"query": "protest, demonstration, rally, march, strike",
"entity_guarantee": ["Location:Paris"],
"hours_back": 1,
"n_articles": 20,
},
}
],
triggers=[
{
"action": "webhook",
"params": {
"url": "https://example.com/hooks/asknews",
"payload": {"text": "Paris protest alert: {message}"},
},
}
],
)
)identifier | Searches | params |
|---|---|---|
asknews | News | News search filters. Written from the query if you leave them out |
web | The live web | queries (required), domains, strict (default true), lookback in hours (default 24) |
deepnews | A DeepNews run, which also makes the check | The DeepNews controls; at most one per alert |
telegram | A public Telegram channel | channel_name (required) |
bluesky | Bluesky posts | query. Written from the alert's query if you leave it out |
Each run searches what is new since the last successful run, so a source's hours_back only sets the window for the first run.
model is the model that decides whether the condition is met. It defaults to gpt-4o. A small model such as gpt-4o-mini or gpt-5-mini is enough for most conditions and costs less per run. The API reference lists every value.
triggers lists what happens when the alert fires. An alert needs at least one.
action | What it does | params |
|---|---|---|
email | Emails the report, or the alert's message, from no-reply@email.asknews.app | to (one address), subject, subject_date, asknews_watermark |
webhook | POSTs your payload as JSON | url (required), headers, payload |
google_docs | Writes the report to a new Google Doc | client_json (required), emails, asknews_watermark |
resend_broadcast | Sends the report as a broadcast from your Resend account | sender, audience_id, resend_api_key (all required), reply_to, subject |
Email. Without a subject, a subject is written for each email. subject_date=true adds the date to the subject. For several recipients, add one email trigger per address.
Webhook. In payload, these placeholders are replaced before the call: {message}, {reasoning}, {query}, {report}, {report_url}, {share_link} and {alert_id}. The call times out after 20 seconds. A response that is not 2xx does not fail the run: its status and body are saved in the log's webhook field. Any chat tool that accepts an incoming webhook, such as Slack or Discord, works this way.
Google Docs. Runs only when the alert has a report. The doc is created with the service account in client_json, readable by anyone with the link, and editable by each address in emails.
Resend broadcast. Sends to an audience in your own Resend account. It takes no payload.
cron is a standard cron expression, in UTC. 0 13 * * 1-5 is 13:00 UTC on weekdays, and */15 * * * * every 15 minutes. crontab.run helps you write one.
Every run costs what it does, so the schedule sets the bill: a report every 15 minutes runs 96 DeepNews reports a day. Match a condition alert's frequency to how fast the answer matters, and match each source's window to the schedule.
expires_at stops an alert at a date. repeat=false pauses a condition alert after it first fires, as AlertOnceIf does.
Run an alert now instead of waiting for the schedule. This is the quickest way to test a prompt or a condition:
ask.chat.run_alert(alert_id=alert.id)Then read the logs, one entry per run:
logs = ask.chat.list_alert_logs(alert_id=alert.id, per_page=5)
for log in logs.items:
print(log.created_at, "fired" if log.alert else "not fired", log.report_url)
print(log.reasoning)| Log field | What it is |
|---|---|
alert | Whether the condition was met |
reasoning | Why the check decided as it did |
report, report_url | The report, and its PDF |
article_ids | The articles the run used |
webhook | The webhook's response status and body |
Logs are kept for 7 days. A run that stops early, because the alert is paused or expired, access is denied, or the sources found nothing new, writes no log. The alert's status shows the latest run: pending, processing, finished or failed.
from asknews_sdk.dto.alert import UpdateAlertRequest
# List your alerts
for a in ask.chat.list_alerts(all=True).items:
print(a.id, a.title, a.cron, "active" if a.active else "paused")
# Change only the fields you set
ask.chat.update_alert(alert_id=alert.id, payload=UpdateAlertRequest(cron="30 12 * * 1-5"))
# Pause, and resume with active=True
ask.chat.update_alert(alert_id=alert.id, payload=UpdateAlertRequest(active=False))
# Delete
ask.chat.delete_alert(alert_id=alert.id)An update changes only the fields you send, and the result must still be a valid alert. Set report or sources to None to remove them. Without a title, the alert gets one written from its query or prompt.
Creating, reading, updating and running alerts through the API costs 1 credit per call. Each scheduled run is billed for what it does:
| Part of the run | Cost |
|---|---|
asknews or bluesky source | 1 credit |
telegram source | 0.25 credits |
web source | 15 credits |
deepnews source, DeepNews report | DeepNews pricing: tokens, plus credits for its searches |
| The condition check | Tokens for the check model |
On an organization account, runs are billed to the organization.
| Symptom | Cause | Fix |
|---|---|---|
403 with a plan message | Alerts need Spelunker, Analyst or Enterprise | Upgrade your plan |
422 when creating | A rule is broken: for example sources without a query, or a report without identifier | Read the error's loc, and see the examples above |
| The report misses things | The depth is too low for what the prompt asks | Raise search_depth and max_depth, or split the report |
| Old developments in a daily report | The window is wider than the schedule | Set hours_back to the interval, and say "last 24 hours only" in the prompt |
| The alert never fires | The condition is never met, or the run stops early | Run it with run_alert and read reasoning in the logs |
| Nothing in the logs | Runs that stop early write no log | Check that the alert is active and not expired, and your balance |
| The run ran at the wrong hour | cron is in UTC | Convert the time to UTC |
asknews alerts create, run and the rest from the terminal.