Skip to main content

更新待执行下线任务接口

修改尚未执行的定时强制下线任务,包括人员范围、计划时间和提示内容。需提交完整任务设置及最新 version;已执行的任务不能修改,也不能通过此更新接口改为立即执行。

  • Scope:admin.v1.force-logout-tasks.execute
  • 权限项:强制下线任务执行(force-logout-tasks)
  • 权限类型:执行
  • 接口:PATCH/api/openapi/v1/force-logout-tasks/{taskId}

认证与请求头

使用应用 API Key 调用。当前接口只校验上方独立 Scope;读取、管理与执行权限互不隐含。
名称位置类型必填说明示例
Authorizationheaderstring是应用 API Key,使用 Bearer 方式传递。Bearer qwk_***
X-Request-Idheaderstring否可选的调用追踪标识;未传入时由服务端生成。req-20260831-001

请求参数

名称位置类型必填说明示例
taskIdpathstring · uuid必填任务 ID"<uuid>"
execution_modebodystring必填执行时间(立即执行或定时执行)"immediate"
promptbodystring必填用户提示语"<string>"
reasonbodystring必填任务原因"<string>"
scheduled_atbodystring | null · date-time否定时执行时间"2026-08-27T10:00:00Z"
scope_typebodystring必填下线范围类型"all"
subjectsbodyarray | null必填下线范围-
target_clientbodystring必填下线目标端"pc"
versionbodyinteger · int64必填版本号,用于并发更新校验1

subjects[] 字段

以下必填性针对对象存在时的子字段;父对象可否省略或为 null,以上层字段表为准。
字段类型必填说明
idstring · uuid是范围对象 ID
namestring是范围对象名称
typestring是对象类型;可选值:department, user_group, user

请求示例

curl --request PATCH \
  --url 'https://example.invalid/api/openapi/v1/force-logout-tasks/<taskId>' \
  --header 'Authorization: Bearer <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
  "execution_mode": "immediate",
  "prompt": "<string>",
  "reason": "<string>",
  "scheduled_at": "2026-08-27T10:00:00Z",
  "scope_type": "all",
  "subjects": [
    {
      "id": "<uuid>",
      "name": "<string>",
      "type": "department"
    }
  ],
  "target_client": "pc",
  "version": 1
}'

响应

200 OK

名称类型必填说明示例
created_atstring · date-time是创建时间"2026-08-27T10:00:00Z"
created_bystring | null · uuid否创建人 ID"<uuid>"
created_by_emailstring否创建人邮箱"<string>"
created_by_namestring否创建人"<string>"
executed_atstring | null · date-time是执行时间"2026-08-27T10:00:00Z"
execution_modestring是执行时间(立即执行或定时执行)"immediate"
expires_atstring | null · date-time是到期时间"2026-08-27T10:00:00Z"
idstring · uuid是任务 ID"<uuid>"
promptstring是用户提示语"<string>"
reasonstring是任务原因"<string>"
scheduled_atstring | null · date-time是定时执行时间"2026-08-27T10:00:00Z"
scope_typestring是下线范围类型"all"
statusstring是执行状态"pending"
subjectsarray<OpenapifacadeScopeSubject>是下线范围-
target_clientstring是下线目标端"pc"
updated_atstring · date-time是更新时间"2026-08-27T10:00:00Z"
updated_bystring | null · uuid否更新人 ID"<uuid>"
updated_by_emailstring否更新人邮箱"<string>"
updated_by_namestring否更新人"<string>"
versioninteger · int64是版本号,用于并发更新校验0

subjects[] 字段

以下必填性针对对象存在时的子字段;父对象可否省略或为 null,以上层字段表为准。
字段类型必填说明
idstring · uuid是范围对象 ID
namestring是范围对象名称
typestring是对象类型;可选值:department, user_group, user
{
  "created_at": "2026-08-27T10:00:00Z",
  "created_by": "<uuid>",
  "created_by_email": "<string>",
  "created_by_name": "<string>",
  "executed_at": "2026-08-27T10:00:00Z",
  "execution_mode": "immediate",
  "expires_at": "2026-08-27T10:00:00Z",
  "id": "<uuid>",
  "prompt": "<string>",
  "reason": "<string>",
  "scheduled_at": "2026-08-27T10:00:00Z",
  "scope_type": "all",
  "status": "pending",
  "subjects": [
    {
      "id": "<uuid>",
      "name": "<string>",
      "type": "department"
    }
  ],
  "target_client": "pc",
  "updated_at": "2026-08-27T10:00:00Z",
  "updated_by": "<uuid>",
  "updated_by_email": "<string>",
  "updated_by_name": "<string>",
  "version": 0
}

default Flat business error

名称类型必填说明示例
codestring否Stable business error code"<string>"
detailstring是Human-readable error description"<string>"
detailsOpenapiErrorDetails否错误详情-
errorstring是Stable HTTP error type"<string>"

details 字段

以下必填性针对对象存在时的子字段;父对象可否省略或为 null,以上层字段表为准。
字段类型必填说明
fieldstring否校验失败的请求字段
reasonstring否校验失败的原因代码
suggestionstring否建议使用的规范化值
{
  "code": "<string>",
  "detail": "<string>",
  "details": {
    "field": "<string>",
    "reason": "<string>",
    "suggestion": "<string>"
  },
  "error": "<string>"
}