Batch Process Trigger Daily API

⚠️

The batch process runs only once per UTC day

All 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 Request with Cannot 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.

📘

Beta

This 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:

HeaderDescription
X-API-KEYIdentifies 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.

RoleAccess
ApiRole (admin)Allowed
TransactionalMailAllowed
3rdPartyBlocked — 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:

ParameterTypeMandatory/OptionalDescriptionHow it Affects Results
WaitTimeForValidationSecondsInteger (nullable)OptionalNumber 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 CodeDescription
200 OKDaily task was triggered successfully (empty body).
202 AcceptedThe 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 RequestValidation failed. The response body contains a plain-text error message describing the reason.
401 UnauthorizedInvalid or missing API key, or the caller's role is not permitted.
403 ForbiddenThe authentication token has expired.
429 Too Many RequestsRate limit exceeded. Wait for the current 10-minute window to expire before retrying.
500 Internal Server ErrorAn unexpected error occurred.
504 Gateway TimeoutThe 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.

ConditionError Message
Batch task not found for tenantCannot trigger daily — task not found
Task is already runningCannot trigger daily — it is already running
Task is not in a triggerable stateCannot 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 misconfiguredCannot 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:

  1. Upload all daily files for the current UTC day.
  2. Confirm on your side that every file has finished uploading. The endpoint does not check this for you.
  3. Call TriggerDaily with {"WaitTimeForValidationSeconds":50}.
  4. A 200 OK means the batch task has started. A 202 Accepted means 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 callDoes the scheduled run still fire?
200 OK — task startedNo. The scheduled run is suppressed for that UTC day.
202 Accepted — request queuedNo. The scheduled run is suppressed for that UTC day.
Any error responseYes. 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 after

Once the scheduled hour has passed, the task is either already running or already triggered for the UTC day. In both cases TriggerDaily returns 400 Bad RequestCannot trigger daily — it is already running or Cannot 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.

SituationEndpoint to call
Files have landed early and the batch process has not run yet todayTriggerDaily
Batch process has stopped in a failed state because of an ETL failureResumeETLFailedDaily
Batch process is currently runningNeither — wait for it to finish
Batch process already completed successfully todayNeither — 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 running

Notes & Best Practices

  • Always send 50. Set WaitTimeForValidationSeconds to 50 on every request.
  • Minify the payload. The request body must contain no spaces: {"WaitTimeForValidationSeconds":50}.
  • 202 Accepted is 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 OK or 202 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.


Did this page help you?