Browse Platform API
Platform APIEnterprise

Overview

Copy

The timer module lets a backend register delayed tasks that call a configured business handler at the scheduled time. It is suitable for message reminders, scheduled operations, and business compensation, but it is not a high-frequency real-time scheduler.

Capabilities

Resource representations

TimerTaskCallbackConfig

PropertyTypeDescription
callbackMethodstringCallback strategy. See TimerTaskCallbackMethod.
callbackPayloadstringBusiness payload passed to the callback handler.

TimerTask

PropertyTypeDescription
taskIDstringTimer task ID.
taskNamestringDisplay name.
taskCategorystringBusiness-defined task category.
srcUserIDstringUser associated with the task.
executeAtintScheduled execution time as a Unix timestamp in milliseconds.
executeBeforeintLatest permitted execution time as a Unix timestamp in milliseconds.
maxRetryintMaximum retries after execution failure.
callbackConfigTimerTaskCallbackConfigCallback method and payload.
createdAtintCreation time in Unix milliseconds.
updatedAtintLast update time in Unix milliseconds.
dedupKeystringBusiness idempotency key used to prevent duplicate creation.

Enumerations

TimerTaskStatus

ValueNameDescription
0PendingWaiting for execution.
1ProcessingCurrently executing.

TimerTaskCallbackMethod

ValueDescription
openim-messageInvoke an OpenIM message operation.
openim-httpInvoke a configured HTTP handler.
openim-rpcInvoke a preconfigured RPC handler.
presetInvoke a server-side preset handler.

Integration guidance

  • Call timer endpoints from an authorized business backend.
  • Validate the target user, callback destination, and tenant boundary before creating or changing a task.
  • Use a stable dedupKey for retryable task creation.