Skip to main content

Import trusted devices

Import trusted devices. POST /api/openapi/v1/trusted-devices/imports, 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/imports
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. CSV/XLSX: at most 10 MiB and 1,000 data rows. Each row needs SN or MAC. Existing identity resolution, conflict checks and per-row results are unchanged.

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: optional; Content-Type: multipart/form-data. Runtime requirement: send a multipart/form-data body with a file part. The current generated contract marks the body optional, which differs from runtime validation; this does not permit omitting the file.
NameLocationTypeRequiredDescriptionExample
Idempotency-KeyheaderstringYesIdempotency-Key minLength=1 maxLength=128-
filebodystring · binaryYesfile Part Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv-

Response statuses

HTTP statusTriggerResponse structureClient action
200Request 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
failed_rowsinteger · int64YesNumber of failed import rows.-
rowsarray\<object\>YesImport result for each row.-
success_rowsinteger · int64YesNumber of successful import rows.-
total_rowsinteger · int64YesTotal number of processed import rows.-

rows[]

FieldTypeRequiredDescription
device_idstring · uuid | nullNoDevice ID associated with the imported row.
reasonstringNoReason this row failed to import.
row_numberinteger · int64YesData row number in the imported file.
successbooleanYesWhether this row was imported successfully.

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

File safety: uploads remain limited to 10 MiB and 1,000 data rows. XLSX expanded size is limited to 64 MiB; worksheet and shared-string XML over 8 MiB uses parser temporary files. These parser protections retain user resolution, trust-state and row-result rules. Oversized or unparseable files return 422. The parser is pinned to a security-fixed revision; workbook formulas are not evaluated.