alerts

Create an alert

Create an alert.

post/v1/chat/alerts

Request body

querystring nullable

The query to run for retrieving information from sources, and for checking the alert. If you have defined one or more reports, specify each report's individual query in the report prompt.

alert_type'AlwaysAlertWhen' | 'AlertOnceIf' | 'ReportAbout' nullable

The type of alert. If specified, overrides repeat and always_trigger. 'AlwaysAlertWhen': trigger alert actions any time the alert query is satisfied (repeat=True, always_trigger=False). Add Report model if you want a report when this is triggered. 'AlertOnceIf': trigger alert actions when the alert query is satisfied and then disable the alert (repeat=False, always_trigger=False). Add Report model if you want a report when this is triggered. 'ReportAbout': always trigger alert actions according to cron schedule and write a report (repeat=True, always_trigger=True). Defaults to using DeepNews for the report unless specified.

model'meta-llama/Meta-Llama-3.1-8B-Instruct' | 'gpt-4o-mini' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-4o' | 'o3-mini' | 'meta-llama/Meta-Llama-3.3-70B-Instruct' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'claude-sonnet-5'

The model that is used to check if the alert conditions are satisfied by sources (this is not the same as the model used to write the report.)Defaults to gpt-4o.

cronstring required

How often or when to check sources for this alert, specified as a cron expression. Examples: '0 * * * *' (hourly), '0 9 * * *' (daily at 9am), '0 9 * * 1' (Mondays at 9am). See https://crontab.run/ for more examples.

always_triggerboolean

Whether to always trigger the actions when sources are scanned. This skips the check for if the alert conditions are satisfied and run triggers immediately. Defaults to False.

repeatboolean

Whether to repeat the alert. Default is True. If False, the alert will be disabled after it triggers once.

activeboolean

Whether the alert is active or not. Default is True.

expires_atstring date-time nullable

The expiration date for the alert. Default is None. If set, the alert will be disabled after this date.

titlestring nullable

The title of the alert. If not provided, no title will be used.

share_linkstring uri nullable

The newsplunker share link to update when the alert triggers.

Example request

{
  "query": "I want to be alerted if the president of the US says something about the economy",
  "model": "gpt-4o-mini",
  "cron": "'0 0 * * *' (daily at midnight UTC)",
  "report": {
    "model": "gpt-4o"
  },
  "title": "Alert for US President's statements on the economy"
}

Response

Created alert.

idstring uuid required
created_atstring date-time nullable
updated_atstring date-time nullable
expires_atstring date-time nullable
user_idstring uuid required
querystring nullable
cronstring required
modelstring nullable required
share_linkstring nullable
sourcesobject[] nullable
triggersobject[] required
always_triggerboolean
repeatboolean
activeboolean
alert_type'AlwaysAlertWhen' | 'AlertOnceIf' | 'ReportAbout' nullable
titlestring nullable
seat_idstring uuid nullable
api_key_idstring nullable

Changes

No recorded changes to this endpoint across all 1 revision of this API.