Skip to main content

Create trusted device

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
Use 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.
NameLocationTypeRequiredDescriptionExample
Idempotency-KeyheaderstringYesIdempotency-Key minLength=1 maxLength=128-
device_namebodystringYesdevice name maxLength=255-
login_usernamebodystringNologin username maxLength=255-
mac_addressbodystring | nullNomac address maxLength=32-
modelbodystringNomodel maxLength=255-
operating_systembodystringNooperating system maxLength=128-
serial_numberbodystring | nullNoserial number maxLength=255-
trustedbodybooleanYestrusted-
user_idbodystring · uuidYesuser id-

Response statuses

HTTP statusTriggerResponse structureClient action
201Request succeededSee “Response” on this pageRead the response.
defaultOther authentication, authorization, validation or dependency errorsSee “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
NameTypeRequiredDescriptionExample
created_atstring · date-timeYesCreation time.-
created_bystring · uuid | nullNoCreator user ID.-
created_by_emailstringNoCreator email.-
created_by_namestringNoCreator display name.-
device_namestringYesDevice name.-
idstring · uuidYesTrusted device ID.-
login_usernamestringYesDevice owner's login account.-
mac_addressstring | nullYesDevice MAC address.-
modelstringYesDevice model.-
operating_systemstringYesDevice operating system.-
serial_numberstring | nullYesDevice serial number.-
sourcestringYesSource of the device trust record. Values: "approval", "first_device_auto_trust", "import", "single"-
trustedbooleanYesWhether the device is currently trusted.-
updated_atstring · date-timeYesLast update time.-
updated_bystring · uuid | nullNoLast updater user ID.-
updated_by_emailstringNoLast updater email.-
updated_by_namestringNoLast updater display name.-
userobjectYesUser associated with the device or request.-
versioninteger · int64YesRecord version for concurrent-update validation.-

user

FieldTypeRequiredDescription
department_idstring | nullYesDepartment ID.
department_namestringYesDepartment name.
department_pathstringYesDepartment hierarchy path.
departmentsarray\<object\>YesDepartments the user belongs to.
emailstringYesUser email.
employee_nostringYesEmployee number.
org_idstring · uuidYesOrganization ID.
user_idstring · uuidYesUser ID.
user_namestringYesUser display name.

user.departments[]

FieldTypeRequiredDescription
idstring · uuidYesDepartment ID.
namestringYesDepartment name.
pathstringYesDepartment 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.

Semantics and safety

This administrative registration can create a trusted device directly without an approval request. Supply at least SN or MAC. Existing user validity and identifier conflict checks apply.