Batch Process Trigger Daily API
The batch process runs only once per UTC dayAll date comparisons use UTC. The batch process runs once per day, whether it was started on demand or at its scheduled hour. After a successful trigger, any further trigger on the same UTC day returns
400 Bad RequestwithCannot trigger daily — it was already triggered today. Plan your trigger timing around the UTC day boundary, not your local time.
The TriggerDaily endpoint lets you trigger your tenant's batch process on demand, instead of waiting for the fixed time configured during onboarding. Use it when a daily file has finished uploading and you want Optimove to start processing the new data right away.
The batch process can be triggered once per day. The endpoint does not check whether your data files have finished uploading — it starts the batch process immediately. It is your responsibility to call it only after all files for the day have been uploaded; otherwise the process runs against incomplete data. The endpoint is protected by API key authentication, role-based authorization, and per-tenant rate limiting.
For how and when your daily data should be delivered, see the Optimove Data Delivery Guide.
BetaThis capability is in Beta. The batch process must already be configured for your tenant during onboarding before you can trigger it on demand.
Using the TriggerDaily Endpoint
Endpoint
POST <BASE_URL>/BatchProcessAPI/TriggerDaily
Replace <BASE_URL> with the base URL for your region.
For the regional base URLs (hostnames), see General Information.
Authentication
API key authentication is required. Include your key in the request header:
| Header | Description |
|---|---|
X-API-KEY | Identifies the calling tenant and carries its role and permission claims. |
If the key is missing or invalid, the endpoint returns 401 Unauthorized.
Authorization
Access is controlled by the role attached to the API key. Callers with the 3rdParty role are explicitly blocked.
| Role | Access |
|---|---|
ApiRole (admin) | Allowed |
TransactionalMail | Allowed |
3rdParty | Blocked — returns 401 Unauthorized |
Rate Limiting
A per-tenant rate limit applies to all API-key-authenticated requests:
- Window: 600 seconds (10 minutes).
- Only one request per tenant is allowed within the window.
- Exceeding the limit returns
429 Too Many Requests. Wait for the current 10-minute window to expire before retrying.
Request Body Parameters
Content-Type: application/json
The request body must be minified (compact) JSON, with no spaces. A request that is not minified will fail.
{"WaitTimeForValidationSeconds":50}Here's a breakdown of the request body parameters:
| Parameter | Type | Mandatory/Optional | Description | How it Affects Results |
|---|---|---|---|---|
WaitTimeForValidationSeconds | Integer (nullable) | Optional | Number of seconds the service waits while validating that the batch task has transitioned to a Running state (or finished) after being triggered. Always set this value to 50. | Holds the connection open until the task starts, completes, or the validation wait ends. |
Always send
50. This is the value the batch process is tuned for — other values are not supported.
Response Codes
| Status Code | Description |
|---|---|
200 OK | Daily task was triggered successfully (empty body). |
202 Accepted | The trigger request was sent successfully, but the task had not started by the end of the 50-second validation wait. The request is queued and the batch process can still start afterwards. This is not a failure — do not retry. |
400 Bad Request | Validation failed. The response body contains a plain-text error message describing the reason. |
401 Unauthorized | Invalid or missing API key, or the caller's role is not permitted. |
403 Forbidden | The authentication token has expired. |
429 Too Many Requests | Rate limit exceeded. Wait for the current 10-minute window to expire before retrying. |
500 Internal Server Error | An unexpected error occurred. |
504 Gateway Timeout | The request exceeded the maximum timeout of 60 seconds. |
Validation Rules
Before triggering the batch, the endpoint checks the following preconditions. When a condition is not met, it returns 400 Bad Request with the corresponding plain-text error message.
| Condition | Error Message |
|---|---|
| Batch task not found for tenant | Cannot trigger daily — task not found |
| Task is already running | Cannot trigger daily — it is already running |
| Task is not in a triggerable state | Cannot trigger daily — it is not in correct state for running |
| Task was already triggered today (UTC) | Cannot trigger daily — it was already triggered today |
| Task schedule is misconfigured | Cannot trigger daily — task configured not correctly |
Triggering Before the Scheduled Hour
Every tenant has a fixed batch process hour configured during onboarding. TriggerDaily exists for the case where your daily files land well before that hour and you don't want to wait — call the endpoint and Optimove starts processing immediately.
The sequence is:
- Upload all daily files for the current UTC day.
- Confirm on your side that every file has finished uploading. The endpoint does not check this for you.
- Call
TriggerDailywith{"WaitTimeForValidationSeconds":50}. - A
200 OKmeans the batch task has started. A202 Acceptedmeans the request was queued and the task will start shortly. Both are successful outcomes.
What Happens to the Scheduled Run
The batch process runs once per UTC day. Triggering it on demand does not add an extra run — it replaces the scheduled one.
Response to your TriggerDaily call | Does the scheduled run still fire? |
|---|---|
200 OK — task started | No. The scheduled run is suppressed for that UTC day. |
202 Accepted — request queued | No. The scheduled run is suppressed for that UTC day. |
| Any error response | Yes. The scheduled run fires at its configured hour as normal. |
The 202 Accepted row is the one to understand. A 202 does not mean the trigger was rejected. It means the start request was accepted and queued, but the task had not reached a Running state by the time the 50-second validation wait ended — the task can still start afterwards. Because the request is already queued, the scheduled run is suppressed and does not act as a backup. Treat a 202 as a success and do not retry.
Every error response means the request was not queued, so your tenant's scheduled run is untouched and will fire at its normal hour.
Call it before the scheduled hour, not afterOnce the scheduled hour has passed, the task is either already running or already triggered for the UTC day. In both cases
TriggerDailyreturns400 Bad Request—Cannot trigger daily — it is already runningorCannot trigger daily — it was already triggered today.
Keep the rate limit in mind when timing the call. Only one API-key-authenticated request per tenant is accepted per 600-second window, so a call that fails validation costs you the window — you cannot immediately retry with corrected timing.
Triggering After a Failed Run
TriggerDaily does not recover a failed run. It only starts a batch process that has not yet run today, so calling it against a failed task returns 400 Bad Request with Cannot trigger daily — it is not in correct state for running.
When the batch process has stopped because its ETL (extract, transform, load) step failed, use the ResumeETLFailedDaily endpoint instead. That endpoint resumes the existing run from the point of failure — either retrying the failed ETL action or skipping it — rather than starting a new one.
| Situation | Endpoint to call |
|---|---|
| Files have landed early and the batch process has not run yet today | TriggerDaily |
| Batch process has stopped in a failed state because of an ETL failure | ResumeETLFailedDaily |
| Batch process is currently running | Neither — wait for it to finish |
| Batch process already completed successfully today | Neither — the next run is tomorrow's scheduled run |
For the resume commands, validation rules, and examples, see the Batch Process Resume ETL Failed Daily API guide.
Examples
Example Request
POST <BASE_URL>/BatchProcessAPI/TriggerDaily HTTP/1.1
X-API-KEY: <YOUR_API_KEY>
Content-Type: application/json
{"WaitTimeForValidationSeconds":50}Example Response (Success)
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
(empty body)Example Response (Queued)
HTTP/1.1 202 Accepted
Content-Type: text/plain; charset=utf-8
(empty body)Example Response (Validation Error)
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
Cannot trigger daily — it is already runningNotes & Best Practices
- Always send
50. SetWaitTimeForValidationSecondsto50on every request. - Minify the payload. The request body must contain no spaces:
{"WaitTimeForValidationSeconds":50}. 202 Acceptedis a success, not a failure. It means your request was sent and queued, but the batch task had not started by the end of the 50-second validation wait. The task can still start afterwards. Do not retry — a retry will be rejected as already triggered, and it consumes your rate-limit window.- One run per UTC day. A successful on-demand trigger —
200 OKor202 Accepted— suppresses that day's scheduled run. The batch process does not run twice. - Uploads are your responsibility. The endpoint does not validate that files have finished uploading — it starts the batch process immediately. Trigger it only after all files for the day are uploaded, or the process may run against incomplete data.
- Empty body on success. On success, the response body is empty. Only validation failures return a plain-text message body.
- Synchronous validation wait. The endpoint holds the connection open until the batch task starts, completes, or the 60-second server timeout is reached.
- This endpoint does not recover failures. To resume a run that stopped because of an ETL failure, use
ResumeETLFailedDaily.
Using retries or still completing onboarding? Trigger your batch process right after your files land, instead of waiting for the scheduled time — see the Optimove Data Delivery Guide for the full data delivery workflow.
Updated 11 days ago
