All Products
Search
Document Center

Identity as a Service:GenerateDeviceCode

Last Updated:Mar 30, 2026

Generates a device code.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /v2/{instanceId}/{applicationId}/oauth2/device/code HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The instance ID.

idaas_ue2jvisn35ea5lmthk267xxxxx

applicationId

string

Yes

The application ID.

app_mkv7rgt4d7i4u7zqtzev2mxxxx

Request parameters

Parameter

Type

Required

Description

Example

scope

string

No

The authorization scope.

xxx

Response elements

Element

Type

Description

Example

object

The response parameters.

device_code

string

The device code.

xxxxx

user_code

string

The user authorization code.

xxxxx

verification_uri

string

The verification URI.

https://example.com/authorize/device

verification_uri_complete

string

The complete verification URI.

https://example.com/authorize/device?user_code= xxxx

expires_in

integer

The remaining validity period of the device code. Unit: seconds.

1200

expires_at

integer

The time when the token expires. This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1653288641

interval

integer

The timeout period of the request token. Unit: seconds.

5

Examples

Success response

JSON format

{
  "device_code": "xxxxx",
  "user_code": "xxxxx",
  "verification_uri": "https://example.com/authorize/device",
  "verification_uri_complete": "https://example.com/authorize/device?user_code=\nxxxx",
  "expires_in": 1200,
  "expires_at": 1653288641,
  "interval": 5
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.