创建强制下线任务接口
将 <BASE_URL> 替换为所在企业环境的 API 域名。
- Scope:
admin.v1.force-logout-tasks.execute - 权限项:强制下线任务执行(
force-logout-tasks) - 权限类型:执行
- 接口:POST
/api/openapi/v1/force-logout-tasks
认证与请求头
使用应用 API Key 调用。当前接口只校验上方独立 Scope;读取、管理与执行权限互不隐含。
| 名称 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Authorization | header | string | 是 | 应用 API Key,使用 Bearer 方式传递。 | Bearer qwk_*** |
X-Request-Id | header | string | 否 | 可选的调用追踪标识;未传入时由服务端生成。 | req-20260831-001 |
请求参数
| 名称 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Idempotency-Key | header | string | 必填 | - | "<string>" |
execution_mode | body | string | 必填 | - | "immediate" |
prompt | body | string | 必填 | - | "<string>" |
reason | body | string | 必填 | - | "<string>" |
scheduled_at | body | string | null · date-time | 否 | - | "2026-08-27T10:00:00Z" |
scope_type | body | string | 必填 | - | "all" |
subjects | body | array | null | 必填 | - | [{"id":"<uuid>","name":"<string>","type":"department"}] |
target_client | body | string | 必填 | - | "pc" |
请求示例
cURL
curl --request POST \
--url '<BASE_URL>/api/openapi/v1/force-logout-tasks' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Idempotency-Key: <UNIQUE_REQUEST_ID>' \
--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"
}'响应
201 Created
| 名称 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
created_at | string · date-time | 是 | - | "2026-08-27T10:00:00Z" |
created_by | string | null · uuid | 否 | - | "<uuid>" |
created_by_email | string | 否 | - | "<string>" |
created_by_name | string | 否 | - | "<string>" |
executed_at | string | null · date-time | 是 | - | "2026-08-27T10:00:00Z" |
execution_mode | string | 是 | - | "immediate" |
expires_at | string | null · date-time | 是 | - | "2026-08-27T10:00:00Z" |
id | string · uuid | 是 | - | "<uuid>" |
prompt | string | 是 | - | "<string>" |
reason | string | 是 | - | "<string>" |
scheduled_at | string | null · date-time | 是 | - | "2026-08-27T10:00:00Z" |
scope_type | string | 是 | - | "all" |
status | string | 是 | - | "pending" |
subjects | array<OpenapifacadeScopeSubject> | 是 | - | [{"id":"<uuid>","name":"<string>","type":"department"}] |
subjects[].id | string · uuid | 是 | - | "<uuid>" |
subjects[].name | string | 是 | - | "<string>" |
subjects[].type | string | 是 | - | "department" |
target_client | string | 是 | - | "pc" |
updated_at | string · date-time | 是 | - | "2026-08-27T10:00:00Z" |
updated_by | string | null · uuid | 否 | - | "<uuid>" |
updated_by_email | string | 否 | - | "<string>" |
updated_by_name | string | 否 | - | "<string>" |
version | integer · int64 | 是 | - | 0 |
响应示例
{
"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
| 名称 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
code | string | 否 | Stable business error code | "<string>" |
detail | string | 是 | Human-readable error description | "<string>" |
details | OpenapiErrorDetails | 否 | - | {"field":"<string>","reason":"<string>","suggestion":"<string>"} |
details.field | string | 否 | Request field that failed validation | "<string>" |
details.reason | string | 否 | Stable validation failure reason | "<string>" |
details.suggestion | string | 否 | Suggested normalized value | "<string>" |
error | string | 是 | Stable HTTP error type | "<string>" |
响应示例
{
"code": "<string>",
"detail": "<string>",
"details": {
"field": "<string>",
"reason": "<string>",
"suggestion": "<string>"
},
"error": "<string>"
}