Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Devices

List Authorized Devices

get

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.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Query parameters
offsetintegerOptionalDefault: 0
limitinteger · max: 100OptionalDefault: 100
Responses
200

Successful Response

application/json

Response body for OAuth2 devices.

idstring · uuidRequired

The OAuth2 device ID.

namestring · nullableOptional

The name of the OAuth2 device.

createdstring · date-timeRequired

The creation date of the OAuth2 device.

updatedstring · date-timeRequired

The date the OAuth2 device was last updated.

user_idstring · uuid · nullableOptional

The user ID owning the OAuth2 device.

client_idstring · uuidRequired

The client ID of the OAuth2 device.

expiresstring · date-timeRequired

The expiration date of the OAuth2 device after which the device can no longer be used in the OAuth2 authorized device flow.

trusted_devicebooleanRequired

Whether the OAuth2 device was marked as trusted. A trusted device has a much longer validity time.

statusstring · enumRequired

The status of the OAuth2 device.

Possible values:
osstring · nullableOptional

The operating system of the device used for authentication.

ip_addressstring · nullableOptional

The IP address of the device used for authentication.

hostnamestring · nullableOptional

The hostname of the device used for authentication.

citystring · nullableOptional

The city where the device is located.

regionstring · nullableOptional

The region where the device is located.

countrystring · nullableOptional

The country where the device is located.

last_loginstring · date-time · nullableOptional

The date of the last successful login.

get/devices
GET /devices HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "created": "2026-01-01T00:00:00.000Z",
    "updated": "2026-01-01T00:00:00.000Z",
    "user_id": "123e4567-e89b-12d3-a456-426614174000",
    "client_id": "123e4567-e89b-12d3-a456-426614174000",
    "expires": "2026-01-01T00:00:00.000Z",
    "trusted_device": true,
    "status": "pending",
    "os": "text",
    "ip_address": "text",
    "hostname": "text",
    "city": "text",
    "region": "text",
    "country": "text",
    "last_login": "2026-01-01T00:00:00.000Z",
    "device_metadata": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  }
]

Get Authorization Device

get

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.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Path parameters
device_id_or_user_codestringRequired
Responses
200

Successful Response

application/json

Response body for OAuth2 devices.

idstring · uuidRequired

The OAuth2 device ID.

namestring · nullableOptional

The name of the OAuth2 device.

createdstring · date-timeRequired

The creation date of the OAuth2 device.

updatedstring · date-timeRequired

The date the OAuth2 device was last updated.

user_idstring · uuid · nullableOptional

The user ID owning the OAuth2 device.

client_idstring · uuidRequired

The client ID of the OAuth2 device.

expiresstring · date-timeRequired

The expiration date of the OAuth2 device after which the device can no longer be used in the OAuth2 authorized device flow.

trusted_devicebooleanRequired

Whether the OAuth2 device was marked as trusted. A trusted device has a much longer validity time.

statusstring · enumRequired

The status of the OAuth2 device.

Possible values:
osstring · nullableOptional

The operating system of the device used for authentication.

ip_addressstring · nullableOptional

The IP address of the device used for authentication.

hostnamestring · nullableOptional

The hostname of the device used for authentication.

citystring · nullableOptional

The city where the device is located.

regionstring · nullableOptional

The region where the device is located.

countrystring · nullableOptional

The country where the device is located.

last_loginstring · date-time · nullableOptional

The date of the last successful login.

get/devices/{device_id_or_user_code}
GET /devices/{device_id_or_user_code} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "created": "2026-01-01T00:00:00.000Z",
  "updated": "2026-01-01T00:00:00.000Z",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "client_id": "123e4567-e89b-12d3-a456-426614174000",
  "expires": "2026-01-01T00:00:00.000Z",
  "trusted_device": true,
  "status": "pending",
  "os": "text",
  "ip_address": "text",
  "hostname": "text",
  "city": "text",
  "region": "text",
  "country": "text",
  "last_login": "2026-01-01T00:00:00.000Z",
  "device_metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Update Authorized Device

put

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.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Path parameters
device_idstring · uuidRequired
Body

OAuth2 device update model.

namestring · nullableOptional

The new name of the OAuth2 device.

Responses
200

Successful Response

application/json

Response body for OAuth2 devices.

idstring · uuidRequired

The OAuth2 device ID.

namestring · nullableOptional

The name of the OAuth2 device.

createdstring · date-timeRequired

The creation date of the OAuth2 device.

updatedstring · date-timeRequired

The date the OAuth2 device was last updated.

user_idstring · uuid · nullableOptional

The user ID owning the OAuth2 device.

client_idstring · uuidRequired

The client ID of the OAuth2 device.

expiresstring · date-timeRequired

The expiration date of the OAuth2 device after which the device can no longer be used in the OAuth2 authorized device flow.

trusted_devicebooleanRequired

Whether the OAuth2 device was marked as trusted. A trusted device has a much longer validity time.

statusstring · enumRequired

The status of the OAuth2 device.

Possible values:
osstring · nullableOptional

The operating system of the device used for authentication.

ip_addressstring · nullableOptional

The IP address of the device used for authentication.

hostnamestring · nullableOptional

The hostname of the device used for authentication.

citystring · nullableOptional

The city where the device is located.

regionstring · nullableOptional

The region where the device is located.

countrystring · nullableOptional

The country where the device is located.

last_loginstring · date-time · nullableOptional

The date of the last successful login.

put/devices/{device_id}
PUT /devices/{device_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 72

{
  "name": "text",
  "device_metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "created": "2026-01-01T00:00:00.000Z",
  "updated": "2026-01-01T00:00:00.000Z",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "client_id": "123e4567-e89b-12d3-a456-426614174000",
  "expires": "2026-01-01T00:00:00.000Z",
  "trusted_device": true,
  "status": "pending",
  "os": "text",
  "ip_address": "text",
  "hostname": "text",
  "city": "text",
  "region": "text",
  "country": "text",
  "last_login": "2026-01-01T00:00:00.000Z",
  "device_metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Delete Authorized Device

delete

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.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Path parameters
device_idstring · uuidRequired
Responses
200

Successful Response

application/json
anyOptional
delete/devices/{device_id}
DELETE /devices/{device_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

ZenML Scarf

Last updated

Was this helpful?