Operator API

URnetwork API: Device

Version 2026.9.14 · 187 operations across 14 groups.OpenAPI 规范 ↗

URnetwork 完整实现了 UR 协议运营方规范。 UR 协议 ↗

Device

14 operations
POST/device/addBearer authDevice Add

Add a device, which can either be owned by the network or shared with the network. The code provided can be either adoption code or a share code. Once a code is added, the device becomes an associated device until confirmation. If the device is a shared device, it will remain an associated device after confirmation.

show schema
code
string

share code or adopt code

1 status · show schema
200
code_type
string
enum: share, adopt
code
string
device_name
string

Name of the device shared by the owner

associated_network_name
string

The name of the source network. Only for share codes.

client_id
string

udid. Only for share codes.

duration_minutes
number
error
object
message
string
POST/device/create-share-codeBearer authDevice Create Share Code

Creates a code to share a device.

show schema
client_id
string

udid

device_name
string

Name of the device that will be shared to the guest

1 status · show schema
200
share_code
string
error
object
message
string
GET/device/share-code/{code}/qr.pngBearer authDevice Share Code QR

A QR code that maps to a URL to add the shared device. Send it to someone to scan to add the device.

code(path)
string

Share code

required
1 status · show schema
200
string (binary)
POST/device/share-statusBearer authDevice Share Status

The status of the shared device. The status can be one of:

  • unassociated
  • associated pending confirmation
  • associated
show schema
share_code
string
1 status · show schema
200
pending
boolean
associated_network_name
string
error
object
message
string
POST/device/confirm-shareBearer authDevice Confirm Share

Confirm the share of a device. This must be called from the side that initiates the share.

show schema
share_code
string
associated_network_name
string
1 status · show schema
200
associated_network_name
string
error
object
message
string
POST/device/create-adopt-codePublicDevice Create Adopt Code

Creates a code to adopt a device. The adopt code is valid for a limited time.

show schema
device_name
string

Name of the device that will be shared to the adopter

device_spec
string
1 status · show schema
200
adopt_code
string
adopt_secret
string

keep this secret locally to use with confirm

duration_minutes
number
error
object
message
string
GET/device/adopt-code/{code}/qr.pngPublicDevice Adopt Code QR

A QR code that maps to a URL to adopt the device. Send it to someone to scan to adopt the device.

code(path)
string

Adopt code

required
1 status · show schema
200
string (binary)
POST/device/adopt-statusPublicDevice Adopt Status

The status of the adopt-code device. The status can be one of:

  • unassociated
  • associated pending confirmation
  • associated
show schema
adopt_code
string
1 status · show schema
200
pending
boolean
associated_network_name
string
error
object
message
string
POST/device/confirm-adoptPublicDevice Confirm Adopt

Confirm the adoption of a device. This must be called from the side that initiates the adoption.

show schema
adopt_code
string
adopt_secret
string
associated_network_name
string
1 status · show schema
200
by_client_jwt
string

client auth

error
object
message
string
POST/device/remove-adopt-codePublicRemove Adopt Code

Remove an adopt code. This must be called from the side that initiates the adoption.

show schema
adopt_code
string
adopt_secret
string
1 status · show schema
200
error
object
message
string
GET/device/associationsBearer authDevice Associations

The devices associated with the caller network. Associated devices are:

  • pending adoption devices
  • incoming shared devices (not owned by the caller network)
  • outgoing shared devices (owned by the caller network)
1 status · show schema
200
pending_adoption_devices
array<DeviceAssociation>

devices pending adoption that need to be confirmed by the offerer

array
pending
boolean

The association still needs confirming. Always true on pending_adoption_devices; on the two shared lists it is the negation of the stored confirmation.

code
string

The adopt code or share code the association is keyed by.

device_name
string

Name of the device

client_id
string

udid of the shared device. Set on incoming_shared_devices and outgoing_shared_devices; a pending adoption has no client yet, so it is omitted there.

network_name
string

The other network in the share -- the owner for an incoming share, the guest for an outgoing one. Set on the two shared lists, and omitted there too while the far side is not yet named. Never set on pending_adoption_devices.

duration_minutes
number

Minutes until the adopt code expires, counted from the moment the request was served. Set on pending_adoption_devices only; a share does not expire, so it is omitted on the two shared lists.

incoming_shared_devices
array<DeviceAssociation>

devices owned by another network shared to the caller network

array
pending
boolean

The association still needs confirming. Always true on pending_adoption_devices; on the two shared lists it is the negation of the stored confirmation.

code
string

The adopt code or share code the association is keyed by.

device_name
string

Name of the device

client_id
string

udid of the shared device. Set on incoming_shared_devices and outgoing_shared_devices; a pending adoption has no client yet, so it is omitted there.

network_name
string

The other network in the share -- the owner for an incoming share, the guest for an outgoing one. Set on the two shared lists, and omitted there too while the far side is not yet named. Never set on pending_adoption_devices.

duration_minutes
number

Minutes until the adopt code expires, counted from the moment the request was served. Set on pending_adoption_devices only; a share does not expire, so it is omitted on the two shared lists.

outgoing_shared_devices
array<DeviceAssociation>

devices owned by the caller network shared to another network

array
pending
boolean

The association still needs confirming. Always true on pending_adoption_devices; on the two shared lists it is the negation of the stored confirmation.

code
string

The adopt code or share code the association is keyed by.

device_name
string

Name of the device

client_id
string

udid of the shared device. Set on incoming_shared_devices and outgoing_shared_devices; a pending adoption has no client yet, so it is omitted there.

network_name
string

The other network in the share -- the owner for an incoming share, the guest for an outgoing one. Set on the two shared lists, and omitted there too while the far side is not yet named. Never set on pending_adoption_devices.

duration_minutes
number

Minutes until the adopt code expires, counted from the moment the request was served. Set on pending_adoption_devices only; a share does not expire, so it is omitted on the two shared lists.

POST/device/remove-associationBearer authDevice Remove Association

Remove a device association. The association can be any of:

  • pending adoption device
  • incoming shared device (not owned by the caller network)
  • outgoing shared device (owned by the caller network)
show schema
code
string
1 status · show schema
200
error
object
message
string
POST/device/set-association-nameBearer authDevice Set Association Name

Set the name of the association. To set the name of devices owned by the network, use /device/set-name.

show schema
code
string
device_name
string

Name of the device

1 status · show schema
200
error
object
message
string
POST/device/set-nameBearer authNetwork Set Device Name

Sets the name of a device owned by the network. To set the name of devices shared with the network, use /device/set-association-name.

show schema
device_id
string

udid

device_name
string
1 status · show schema
200
error
object
message
string