Create trusted device. POST /api/openapi/v1/trusted-devices, scope admin.v1.trusted-devices.manage.
- Scope:
admin.v1.trusted-devices.manage - Permission: trusted devices manage
- Permission type: manage
- Endpoint: POST
/api/openapi/v1/trusted-devices
Authorization: Bearer \<API_KEY\>. This endpoint requires an application with subject_scope={"mode":"all"}. Restricted or invalid user scopes return 403 openapi_subject_scope_denied before business execution.
Scopes do not imply each other. Organization and application actor come from verified authentication, not request parameters.
Common request headers
Apply the “Authentication and headers” section in “Configure the QwenWork console through APIs”: Authorization is required and X-Request-Id is optional. See this page for the required scope.
Whether Idempotency-Key applies and is required is specified in this page’s request parameters; a tracing identifier does not replace an idempotency key.
Request parameters
Request body: required; Content-Type: application/json.
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
Idempotency-Key | header | string | Yes | Idempotency-Key minLength=1 maxLength=128 | - |
device_name | body | string | Yes | device name maxLength=255 | - |
login_username | body | string | No | login username maxLength=255 | - |
mac_address | body | string | null | No | mac address maxLength=32 | - |
model | body | string | No | model maxLength=255 | - |
operating_system | body | string | No | operating system maxLength=128 | - |
serial_number | body | string | null | No | serial number maxLength=255 | - |
trusted | body | boolean | Yes | trusted | - |
user_id | body | string · uuid | Yes | user id | - |
Response statuses
| HTTP status | Trigger | Response structure | Client action |
|---|---|---|---|
201 | Request succeeded | See “Response” on this page | Read the response. |
default | Other authentication, authorization, validation or dependency errors | See “General error” in “Configure the QwenWork console through APIs” | Handle the status and code; verify the result and idempotency requirements before retrying writes. |
Response
Content-Type: application/json
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
created_at | string · date-time | Yes | Creation time. | - |
created_by | string · uuid | null | No | Creator user ID. | - |
created_by_email | string | No | Creator email. | - |
created_by_name | string | No | Creator display name. | - |
device_name | string | Yes | Device name. | - |
id | string · uuid | Yes | Trusted device ID. | - |
login_username | string | Yes | Device owner's login account. | - |
mac_address | string | null | Yes | Device MAC address. | - |
model | string | Yes | Device model. | - |
operating_system | string | Yes | Device operating system. | - |
serial_number | string | null | Yes | Device serial number. | - |
source | string | Yes | Source of the device trust record. Values: "approval", "first_device_auto_trust", "import", "single" | - |
trusted | boolean | Yes | Whether the device is currently trusted. | - |
updated_at | string · date-time | Yes | Last update time. | - |
updated_by | string · uuid | null | No | Last updater user ID. | - |
updated_by_email | string | No | Last updater email. | - |
updated_by_name | string | No | Last updater display name. | - |
user | object | Yes | User associated with the device or request. | - |
version | integer · int64 | Yes | Record version for concurrent-update validation. | - |
user
| Field | Type | Required | Description |
|---|---|---|---|
department_id | string | null | Yes | Department ID. |
department_name | string | Yes | Department name. |
department_path | string | Yes | Department hierarchy path. |
departments | array\<object\> | Yes | Departments the user belongs to. |
email | string | Yes | User email. |
employee_no | string | Yes | Employee number. |
org_id | string · uuid | Yes | Organization ID. |
user_id | string · uuid | Yes | User ID. |
user_name | string | Yes | User display name. |
user.departments[]
| Field | Type | Required | Description |
|---|---|---|---|
id | string · uuid | Yes | Department ID. |
name | string | Yes | Department name. |
path | string | Yes | Department hierarchy path. |
Errors
Uses the existing {error, detail, code} error envelope. Invalid credentials: 401/403; missing Scope or non-all user scope: 403; missing resource: 404; conflict/stale version: 409; invalid input: 400/422; unavailable dependency: 503. Business errors retain Console semantics.