# Schedule annual certification emails `POST /api/v1/invoices/send/{year}` Creates and schedules an email campaign for incoming-payment certifications from one fiscal year. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Invoices → Write**. ## Path parameters - `year` (integer, required) — Four-digit fiscal year, from 1970 through 9999. ## Query parameters - `payment_type` (string) — Use incoming. This is also the default. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/invoices/send/${YEAR:?Set YEAR}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --url-query "payment_type=incoming" ``` ## Response **200 OK** Returns the new campaign, the recipient count, and its queue status. Example with fictional data and selected fields. ```json { "status": "success", "message": "Campagna certificazioni creata e schedulata correttamente", "year": 2025, "payment_type": "incoming", "campaign_id": 24, "campaign_name": "Certifications 2025", "total_recipients": 2, "scheduled_at": 1794564000, "job": { "status": "pending" } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The fiscal year or payment type is invalid. - `422` — No eligible recipients were found or the workspace email template is incomplete. - `500` — The campaign could not be created. - `503` — The certification links could not be prepared.