subscriptions

Embed
Preview of the card
<a href="https://lucida.15-204-158-166.sslip.io/docs/ref-subscriptions"><img src="https://lucida.15-204-158-166.sslip.io/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/9d209864-26f4-4148-98e8-096c0f6f0030/social-card.svg?v=3e7ae33eec8b" alt="subscriptions" width="600" height="315"></a>
GEThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions

Parameters

project_idstringpathrequired
tabstringquery
qstringquery
channelstringquery
creatorstringquery
sortstringquery
dirstringquery
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of Subscription
400
404
POSThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions

Parameters

project_idstringpathrequired

Request body

application/json
ai_summaryboolean
Insight and dashboard subscriptions: an AI summary above the tables. Delivery goes out without it when no model is configured. Not for format: pdf.
channelstringrequired
email | slack
cronstring
Five-field cron in UTC, e.g. 0 9 * * 1; runs at most hourly. Give cron or schedule.
dashboard_idstring
digestboolean
formatstring
table (default) or pdf: a dashboard subscription attaches the rendered PDF to the email (Slack gets the message and link only). pdf needs channel: email.
insight_idstring
Exactly one of insight_id, dashboard_id, digest: true, web_report: true or prompt.
insight_idsarray
Dashboard subscriptions: the insights to send, in order (1 to 20, default the first 20).
messagestring
Optional personal message shown above the report (at most 1000 characters).
promptstring
Prompt subscription: a natural-language question the assistant answers at each delivery (at most 2000 characters). Needs prompt_window_days.
prompt_window_daysinteger
Prompt subscription: the analysis window in days (1 to 365, e.g. 7 or 30) the prompt is asked over.
recipientsarray
Email: up to 20 addresses; each newly added one gets a notice mail.
scheduleobject
Structured schedule: {"every": 2, "unit": "day|week|month", "time": "09:00", "timezone"?: "Europe/Berlin" (default: the project's), "weekdays"?: [1, 5], "monthly"?: {"date": 15} | {"ordinal": {"which": "first|second|third|fourth|last", "day": "mon..sun|any|weekday"}}}.
slack_channelobject
Slack channel picked from the installed app (GET .../subscriptions/slack-channels).
targetstring
Slack: the incoming-webhook URL (stored sealed). Email: a single address (or use recipients).
titlestring
variablesobject
Dashboard variable values for a PDF, a JSON object of strings.
web_reportboolean
The project's web analytics report: last 7 days against the 7 before, with top pages, referrers, channels, countries and devices.
{
  "ai_summary": true,
  "channel": "string",
  "cron": "string",
  "dashboard_id": "string",
  "digest": true,
  "format": "string",
  "insight_id": "string",
  "insight_ids": [
    "string"
  ],
  "message": "string",
  "prompt": "string",
  "prompt_window_days": 0,
  "recipients": [
    "string"
  ],
  "schedule": {},
  "slack_channel": {},
  "target": "string",
  "title": "string",
  "variables": {},
  "web_report": true
}

Code samples

cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions" \
  -H "Content-Type: application/json" \
  -d '{"ai_summary":true,"channel":"string","cron":"string","dashboard_id":"string","digest":true,"format":"string","insight_id":"string","insight_ids":["string"],"message":"string","prompt":"string","prompt_window_days":0,"recipients":["string"],"schedule":{},"slack_channel":{},"target":"string","title":"string","variables":{},"web_report":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
Example
{
  "ai_summary": true,
  "channel": "string",
  "consecutive_failures": 0,
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "creator": "string",
  "cron": "string",
  "dashboard_id": "string",
  "digest": true,
  "disabled_at": "2024-01-01T00:00:00Z",
  "disabled_reason": "string",
  "enabled": true,
  "format": "string",
  "id": "string",
  "insight_id": "string",
  "insight_ids": [
    "string"
  ],
  "last_run_at": "2024-01-01T00:00:00Z",
  "message": "string",
  "next_run_at": "2024-01-01T00:00:00Z",
  "project_id": "string",
  "prompt": "string",
  "prompt_window_days": 0,
  "schedule": {},
  "slack_channel": {},
  "target": "string",
  "title": "string",
  "variables": {},
  "web_report": true
}
Schema
ai_summarybooleanrequired
An AI summary of the tables is placed above them (insight and dashboard subscriptions).
channelstringrequired
email | slack | teams | discord
consecutive_failuresintegerrequired
Failed runs in a row; reset by a delivery, switches the subscription off at the cut-off.
created_atstringrequired
created_bystring
Whose access the run renders with; a PDF run needs it.
creatorstring
Email of the creator.
cronstring
Five-field cron, UTC.
dashboard_idstring
digestbooleanrequired
The weekly recommendations digest instead of an insight or dashboard.
disabled_atstring
disabled_reasonstring
Why delivery was switched off by a permanent failure; None for a manual pause.
enabledbooleanrequired
formatstringrequired
table (inline) or pdf (dashboard subscriptions: the rendered PDF as an attachment).
idstringrequired
insight_idstring
insight_idsarray
Dashboard subscriptions: the insights sent, in order (at most 20); None is the first 20.
last_run_atstring
messagestringrequired
Optional personal message shown above the report.
next_run_atstringrequired
project_idstringrequired
promptstring
Prompt subscription: the natural-language question answered at delivery time.
prompt_window_daysinteger
Prompt subscription: the analysis window in days the prompt is asked over.
scheduleobject
Structured schedule (Schedule JSON) instead of cron.
slack_channelobject
Slack channel picked from the installed app: {connector_id, id, name}.
targetstringrequired
Email address, or the sealed Slack webhook URL (serialised as empty).
titlestringrequired
variablesobjectrequired
Dashboard variable values the PDF is rendered with (name to string).
web_reportbooleanrequired
The project's web analytics report (last 7 days against the 7 before).
400
403
404
POSThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/schedule-preview

Parameters

project_idstringpathrequired

Request body

application/json
countinteger
How many upcoming deliveries (1 to 5, default 3).
cronstring
scheduleobject
{
  "count": 0,
  "cron": "string",
  "schedule": {}
}

Code samples

cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/schedule-preview" \
  -H "Content-Type: application/json" \
  -d '{"count":0,"cron":"string","schedule":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "next": [
    "2024-01-01T00:00:00Z"
  ]
}
Schema
nextstring[]required
400
404
GEThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/slack-channels

Parameters

project_idstringpathrequired

Code samples

cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/slack-channels"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Channels of the installed Slack workspace: {data, connector_id}
404 Slack app not installed
502
DELETEhttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/{id}

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
403
404
PATCHhttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/{id}

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
ai_summaryboolean
cronstring
enabledboolean
Pause (false) or resume (true). Resuming resets the next delivery date; resuming one that was switched off by a permanent failure first sends a confirmation delivery and answers 409 while that still fails.
insight_idsarray
Dashboard insight subset; null goes back to the first 20.
messagestring
promptstring
Prompt subscriptions only.
prompt_window_daysinteger
recipientsarray
scheduleobject
slack_channelobject
titlestring
{
  "ai_summary": true,
  "cron": "string",
  "enabled": true,
  "insight_ids": [
    "string"
  ],
  "message": "string",
  "prompt": "string",
  "prompt_window_days": 0,
  "recipients": [
    "string"
  ],
  "schedule": {},
  "slack_channel": {},
  "title": "string"
}

Code samples

cURL
curl -X PATCH "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/{id}" \
  -H "Content-Type: application/json" \
  -d '{"ai_summary":true,"cron":"string","enabled":true,"insight_ids":["string"],"message":"string","prompt":"string","prompt_window_days":0,"recipients":["string"],"schedule":{},"slack_channel":{},"title":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
409
POSThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/{id}/test

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/subscriptions/{id}/test"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204 Delivered now; the schedule is untouched
404
409 Switched off by a failure
502 Delivery failed
Updated