Devices
Gets a list of active OAuth2 authorized devices belonging to a user.
Args: offset: Offset for pagination. limit: Limit for pagination. user: The authorized user. user_manager: The user manager.
Returns: List of OAuth2 authorized device objects.
0100Successful Response
Validation Error
GET /devices HTTP/1.1
Host:
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"created": "2025-12-07T23:38:07.629Z",
"updated": "2025-12-07T23:38:07.629Z",
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"client_id": "123e4567-e89b-12d3-a456-426614174000",
"expires": "2025-12-07T23:38:07.629Z",
"trusted_device": true,
"status": "pending",
"os": "text",
"ip_address": "text",
"hostname": "text",
"city": "text",
"region": "text",
"country": "text",
"last_login": "2025-12-07T23:38:07.629Z",
"device_metadata": {}
}
]Gets a specific OAuth2 authorized device using its unique ID.
Args: device_id_or_user_code: The ID or user code of the OAuth2 authorized device to get. user: The authorized user. user_manager: The user manager.
Returns: A specific OAuth2 authorized device object.
Raises: OAuthDeviceNotFound: If the device with the given ID does not exist, does not belong to the current user or could not be verified using the given user code.
Successful Response
Validation Error
GET /devices/{device_id_or_user_code} HTTP/1.1
Host:
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"created": "2025-12-07T23:38:07.629Z",
"updated": "2025-12-07T23:38:07.629Z",
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"client_id": "123e4567-e89b-12d3-a456-426614174000",
"expires": "2025-12-07T23:38:07.629Z",
"trusted_device": true,
"status": "pending",
"os": "text",
"ip_address": "text",
"hostname": "text",
"city": "text",
"region": "text",
"country": "text",
"last_login": "2025-12-07T23:38:07.629Z",
"device_metadata": {}
}Updates a specific OAuth2 authorized device using its unique ID.
Args: device_id: The ID of the OAuth2 authorized device to update. update: The model containing the attributes to update. user: The authorized user. user_manager: The user manager.
Returns: The updated OAuth2 authorized device object.
Raises: OAuthDeviceNotFound: If the device with the given ID does not exist or does not belong to the current user.
OAuth2 device update model.
The new name of the OAuth2 device.
The new metadata of the OAuth2 device.
Successful Response
Validation Error
PUT /devices/{device_id} HTTP/1.1
Host:
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 36
{
"name": "text",
"device_metadata": {}
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"created": "2025-12-07T23:38:07.629Z",
"updated": "2025-12-07T23:38:07.629Z",
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"client_id": "123e4567-e89b-12d3-a456-426614174000",
"expires": "2025-12-07T23:38:07.629Z",
"trusted_device": true,
"status": "pending",
"os": "text",
"ip_address": "text",
"hostname": "text",
"city": "text",
"region": "text",
"country": "text",
"last_login": "2025-12-07T23:38:07.629Z",
"device_metadata": {}
}Deletes a specific OAuth2 authorized device using its unique ID.
Args: device_id: The ID of the OAuth2 authorized device to delete. user: The authorized user. user_manager: The user manager.
Raises: OAuthDeviceNotFound: If the device with the given ID does not exist or does not belong to the current user.
Successful Response
Validation Error
DELETE /devices/{device_id} HTTP/1.1
Host:
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
No content
Last updated
Was this helpful?