Piloterr

Manage deliveries

Change, remove or send a delivery again, and what happens when a delivery fails.

Change or remove a delivery

GET /v1/projects/{id}/deliveries lists a project's deliveries. PATCH /v1/projects/{id}/deliveries/{delivery_id} changes the fields of its type: frequency, recipients and direct_link for an email, connection_id and path for cloud storage, and enabled for both. New addresses in recipients get their confirmation email. DELETE /v1/projects/{id}/deliveries/{delivery_id} removes one; what was already sent stays where it is.

Deliver a run again

curl -X POST https://dataflow.piloterr.com/v1/projects/PROJECT_ID/deliveries/DELIVERY_ID/send \
  -H "x-api-key: YOUR_API_KEY" -H "content-type: application/json" \
  -d '{"run_id": "RUN_ID"}'
{ "run_id": "RUN_ID" }

Queues the delivery of a finished run: to retry after a failure, or to check the delivery. Without a body, the project's latest finished run (completed or failed) goes. A daily or weekly email sends that run's email at once.

The answer, 202, only says the delivery is queued. It is then skipped when the delivery is off, when the run's results have expired, or, for cloud storage, when the run did not complete.

Failures and retries

Each delivery of a run is sent on its own: a slow bucket never holds an email back. A failed attempt is retried for about 30 minutes (after 30 seconds, then 1, 2, 4, 8 and 16 minutes). A retry does not email again the recipients who already got the email.

When the last attempt fails:

  • the delivery records last_error and last_error_at, and failure_count goes up by one; the next successful delivery sets failure_count back to 0 and clears last_error;
  • the delivery.failed event goes to your alerts and webhooks, with data.delivery_id, data.delivery (email or cloud) and data.error;
  • the run itself stays completed.

A daily or weekly summary is not retried: a failure is recorded on the delivery, and the next summary covers the following period.

last_sent_at is when the last daily or weekly summary was sent.

Errors

StatusCodeMeaning
422validation_failedA field is missing or wrong: an invalid address, more than 20 recipients, a path without {format} or with an unknown variable, no such cloud connection (path connection_id), a field of the other delivery type, an endpoint that is not https or not reachable from the internet, an invalid bucket name, or only one of the two keys.
404project_not_found, delivery_not_found, connection_not_found, address_not_foundNo such project, delivery, connection or address for your workspace.
404run_not_foundDelivering again: no such run in this project, or no finished run yet.
409run_not_finishedDelivering again: the run has not finished yet.
409deliveries_limitThe project already has 10 deliveries.
409connections_limitThe workspace already has 20 connections.
429rate_limitedMore than 10 connection tests this minute, or 60 this hour, for the workspace (Retry-After). A failed test is not an error: it answers 200 with ok: false (see Test the permissions).
429confirmation_quotaThe confirmation emails a new or changed email delivery needs would pass the workspace's 50 a day or 100 addresses waiting: nothing was saved or sent. See Addresses outside the workspace.
503encryption_unavailableEmails and connections cannot be set up on this server right now.

On this page