Batch Process Trigger Daily API
Overview
The batch process can be triggered only once per UTC dayAll date comparisons use UTC. 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.
This capability is generally available, but 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
POST <BASE_URL>/current/BatchProcessAPI/TriggerDaily
Both routes resolve to the same action. 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. A request that is not minified will fail.
{"WaitTimeForValidationSeconds": 5}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. | Holds the connection open until the task starts, completes, or the timeout is reached. Higher values give the task more time to confirm it started before the response returns. |
The service applies a built-in 5-second default and adds your value as extra wait time (any amount at or below 5 is clamped to 0 extra):
| Value | Effective wait time |
|---|---|
null | 5s (default only) |
<= 5 | 5s (default only; extra clamped to 0) |
10 | 5s default + 5s extra = 10s |
20 | 5s default + 15s extra — recommended maximum |
30 | 5s default + 25s extra — maximum allowed; any larger value returns 504 Gateway Timeout |
Response Codes
| Status Code | Description |
|---|---|
200 OK | Daily task was triggered successfully (empty body). |
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 30 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 |
| Task failed to start within the validation timeout | Cannot trigger daily — validation for Task starting is failed |
Examples
Example Request
POST <BASE_URL>/BatchProcessAPI/TriggerDaily HTTP/1.1
X-API-KEY: <YOUR_API_KEY>
Content-Type: application/json
{"WaitTimeForValidationSeconds": 5}Example Response (Success)
HTTP/1.1 200 OK
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
- 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 (
200 OK). Only validation failures return a plain-text message body. - Synchronous validation wait. If
WaitTimeForValidationSecondsis provided, the endpoint holds the connection open until the batch task starts, completes, or the 30-second maximum timeout is reached.
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.