newsletters

Create a newsletter

Create a newsletter.

post/v1/chat/newsletters

Request body

namestring required

The name of the newsletter.

querystring required

The natural language query to run for the newsletter.

cronstring required

The cron schedule for the newsletter. For example daily at 00:00 UTC is '0 0 * * *'. See https://crontab.run/ for more examples

model'gpt-4o' | 'gpt-4o-mini' | 'claude-3-5-sonnet-latest' | 'meta-llama/Meta-Llama-3.1-405B-Instruct' | 'meta-llama/Meta-Llama-3.3-70B-Instruct' required

The model to use for the newsletter.

subjectstring nullable

The subject of the newsletter. If not provided it will be auto generated.

senderstring required

The sender of the newsletter.

logo_urlstring uri nullable

The logo URL for the newsletter.

reply_tostring nullable

The reply-to address for the newsletter. If not provided, the sender will be used.

audience_idstring nullable

The audience ID to use for the newsletter. If not provided a new audience will be created.

resend_api_keystring nullable

The resend API key to use for the newsletter. If not provided, the newsletter will not be sent.

publicboolean

Whether the newsletter is public or not. If not provided, the newsletter will be public. If you make the newsletter public only title and query will be shown.

activeboolean

Whether the newsletter is active or not. If not provided, the newsletter will be active. If you make the newsletter inactive, it will not be sent.

expires_atstring date-time nullable

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

Example request

{
  "name": "Daily Economy News",
  "query": "Send me the latest news on the economy.",
  "cron": "0 0 * * *",
  "model": "gpt-4o-mini",
  "subject": "Your Daily Economy News",
  "sender": "Your Name <sender@domain.com>",
  "logo_url": "https://example.com/logo.png",
  "reply_to": "Your Name <sender@domain.com>",
  "audience_id": "123e4567-e89b-12d3-a456-426614174000",
  "resend_api_key": "re_123456789"
}

Response

Created newsletter.

idstring uuid required
created_atstring date-time nullable
updated_atstring date-time nullable
user_idstring uuid required
alert_idstring uuid nullable
namestring required
querystring required
cronstring required
modelstring nullable required
subjectstring nullable required
senderstring required
logo_urlstring nullable required
reply_tostring nullable required
audience_idstring nullable required
resend_api_keystring nullable required
publicboolean
activeboolean
expires_atstring date-time nullable

Changes

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