Platform APIEnterprise
Create a timer task
Schedule a task that invokes a configured business handler at the specified time.
HTTP request
POST {API_ADDRESS}/timer/create_timer_taskRequest example
curl --request POST "${API_ADDRESS}/timer/create_timer_task" --header "Content-Type: application/json" --header "operationID: ${OPERATION_ID}" --header "token: ${TOKEN}" --data-raw '{"taskName":"Reminder","taskCategory":"reminder","executeAt":1719800000000,"executeBefore":1719800060000,"maxRetry":1,"callbackConfig":{"callbackMethod":"openim-http","callbackPayload":"{\"event\":\"reminder\"}"},"userID":"user_001","dedupKey":"reminder_001"}'Request body
| Parameter | Required | Type | Description |
|---|---|---|---|
| taskName | Yes | string | Task name. |
| taskCategory | Yes | string | Business-defined category. |
| executeAt | Yes | int | Scheduled Unix time in milliseconds. |
| executeBefore | Yes | int | Latest permitted execution time in milliseconds. |
| maxRetry | Yes | int | Maximum retry count. |
| callbackConfig | Yes | TimerTaskCallbackConfig | See TimerTaskCallbackConfig. |
| userID | Yes | string | Associated OpenIM user ID. |
| dedupKey | Yes | string | Stable business idempotency key. |
Response
data.task contains the created TimerTask.
Errors
See Error codes.
Permissions and limits
- Available only in OpenIM Enterprise.
- Reuse
dedupKeywhen retrying the same logical creation request.
Related pages
Was this page helpful?