---
title: "List Authorized Devices"
method: GET
path: "/api/v1/devices"
tags: ["authorized_devices"]
---

# List Authorized Devices

`GET /api/v1/devices`

Gets a page of OAuth2 authorized devices belonging to the current user.

Args:
    filter_model: Filter model used for pagination, sorting,
        filtering.
    hydrate: Flag deciding whether to hydrate the output model(s)
        by including metadata fields in the response.
    auth_context: The current auth context.

Returns:
    Page of OAuth2 authorized device objects.

## Query parameters

- `hydrate` boolean
- `sort_by` string
- `logical_operator` 'or' | 'and' — Logical Ops to use to combine filters on list methods.
- `page` integer
- `size` integer
- `id` union
  - string, uuid
  - string
- `created` union
  - string, date-time
  - string
- `updated` union
  - string, date-time
  - string
- `scope_user` string, uuid, nullable
- `expires` union
  - string, date-time
  - string
- `client_id` union
  - string, uuid
  - string
- `status` union
  - 'pending' | 'verified' | 'active' | 'locked' — The OAuth device status.
  - string
- `trusted_device` union
  - boolean
  - string
- `failed_auth_attempts` union
  - integer
  - string
- `last_login` union
  - string, date-time
  - string

## Response `200`

Successful Response

- PageOAuthDeviceResponse
  - `index` integer, required
  - `max_size` integer, required
  - `total_pages` integer, required
  - `total` integer, required
  - `items` OAuthDeviceResponse[], required
    - `body` OAuthDeviceResponseBody — Response body for OAuth2 devices.
      - `created` string, date-time, required
      - `updated` string, date-time, required
      - `user` UserResponse — Response model for user and service accounts. This returns the activation_token that is required for the user-invitation-flow of the frontend. The email is returned optionally as well for use by the analytics on the client-side.
        - `body` UserResponseBody — Response body for users.
          - `created` string, date-time, required
          - `updated` string, date-time, required
          - `active` boolean
          - `activation_token` string, nullable
          - `full_name` string
          - `email_opted_in` boolean, nullable — `null` if not answered, `true` if agreed, `false` if skipped.
          - `is_service_account` boolean, required
          - `is_admin` boolean, required
        - `metadata` UserResponseMetadata — Response metadata for users.
          - `email` string, nullable
          - `external_user_id` string, uuid, nullable
          - `user_metadata` object
        - `resources` UserResponseResources — Class for all resource models associated with the user entity.
        - `id` string, uuid, required
        - `permission_denied` boolean
        - `name` string, required
      - `client_id` string, uuid, required — The client ID of the OAuth2 device.
      - `expires` string, date-time, nullable — The expiration date of the OAuth2 device after which the device is no longer valid and cannot be used for authentication.
      - `trusted_device` boolean, required — Whether the OAuth2 device was marked as trusted. A trusted device has a much longer validity time.
      - `status` 'pending' | 'verified' | 'active' | 'locked', required — The OAuth device status.
      - `os` string, nullable — The operating system of the device used for authentication.
      - `ip_address` string, nullable — The IP address of the device used for authentication.
      - `hostname` string, nullable — The hostname of the device used for authentication.
    - `metadata` OAuthDeviceResponseMetadata — Response metadata for OAuth2 devices.
      - `python_version` string, nullable — The Python version of the device used for authentication.
      - `zenml_version` string, nullable — The ZenML version of the device used for authentication.
      - `city` string, nullable — The city where the device is located.
      - `region` string, nullable — The region where the device is located.
      - `country` string, nullable — The country where the device is located.
      - `failed_auth_attempts` integer, required — The number of failed authentication attempts.
      - `last_login` string, date-time, nullable, required — The date of the last successful login.
    - `resources` OAuthDeviceResponseResources — Class for all resource models associated with the OAuthDevice entity.
    - `id` string, uuid, required
    - `permission_denied` boolean

## Other responses

- `401` — Unauthorized
- `404` — Not Found
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/zenml-io/apis/zenml-2.md) · [All operations](https://skmtc.net/zenml-io/apis/zenml-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zenml-io/zenml-2/versions/febb01b8bce3/schema)
