> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leen.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Device by ID

> Retrieve a device by its ID (Leen's UUID).



## OpenAPI

````yaml get /entities/devices/{device_id}
openapi: 3.1.0
info:
  title: Leen Security API
  version: 0.0.1
servers:
  - url: https://api.leen.dev/v1
    description: Production API
  - url: https://api.eu-c1.leen.dev/v1
    description: Production API (EU Region)
  - url: https://api.ap-se2.leen.dev/v1
    description: Production Api (APAC Region)
security: []
paths:
  /entities/devices/{device_id}:
    get:
      tags:
        - entities
      summary: Get Device by ID
      description: Retrieve a device by its ID (Leen's UUID).
      operationId: get_device_by_id
      parameters:
        - name: device_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Device Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceRespModel'
        '404':
          description: Device not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorException'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Connection-ID: []
          API-Key: []
components:
  schemas:
    DeviceRespModel:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/DeviceStatus'
        platform:
          anyOf:
            - $ref: '#/components/schemas/DevicePlatform'
            - type: 'null'
        hostnames:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Hostnames
        os_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Os Version
        os_major_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Os Major Version
        os_minor_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Os Minor Version
        fqdns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Fqdns
        ipv4s:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Ipv4S
        ipv6s:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Ipv6S
        mac_addresses:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Mac Addresses
        last_seen:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen
        first_seen:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: First Seen
        source_vendors:
          items:
            $ref: '#/components/schemas/DeviceVendor'
          type: array
          title: Source Vendors
        installed_software:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Installed Software
        ad_info:
          anyOf:
            - $ref: '#/components/schemas/DeviceADInfo'
            - type: 'null'
        cloud_metadata:
          anyOf:
            - $ref: '#/components/schemas/AWSMetadata'
            - type: 'null'
          description: CloudMetadata, currently only AWS is supported
        tags:
          anyOf:
            - items:
                $ref: '#/components/schemas/DeviceTags'
              type: array
            - type: 'null'
          title: Tags
        identities:
          anyOf:
            - items:
                $ref: '#/components/schemas/DeviceIdentity'
              type: array
            - type: 'null'
          title: Identities
        vendor_data:
          anyOf:
            - type: object
            - type: 'null'
          title: Vendor Data
          description: Vendor specific pass through data, values can vary based on vendor
      type: object
      required:
        - id
        - status
        - last_seen
        - first_seen
        - source_vendors
        - installed_software
        - ad_info
      title: Device
    ErrorException:
      properties:
        detail:
          type: string
          title: Detail
          description: Error message
      type: object
      required:
        - detail
      title: ErrorException
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DeviceStatus:
      type: string
      enum:
        - active
        - offline
        - quarantined
        - unknown
        - deleted
      title: DeviceStatus
    DevicePlatform:
      type: string
      enum:
        - mac
        - windows
        - linux
        - unknown
      title: DevicePlatform
    DeviceVendor:
      properties:
        vendor:
          type: string
          title: Vendor
        vendor_id:
          type: string
          title: Vendor Id
        agent_info:
          anyOf:
            - $ref: '#/components/schemas/DeviceAgentInfo'
            - type: 'null'
      type: object
      required:
        - vendor
        - vendor_id
      title: DeviceVendor
    DeviceADInfo:
      properties:
        org_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Unit
        site_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Site Name
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
      type: object
      title: DeviceADInfo
    AWSMetadata:
      properties:
        cloud_provider:
          allOf:
            - $ref: '#/components/schemas/CloudProvider'
          default: aws
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
        availability_zone:
          anyOf:
            - type: string
            - type: 'null'
          title: Availability Zone
        instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance Id
        instance_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance Type
        image_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Id
        kernel_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Kernel Id
        vpc_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Vpc Id
        subnet_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subnet Id
      type: object
      title: AWSMetadata
    DeviceTags:
      properties:
        key:
          type: string
          title: Key
        value:
          type: string
          title: Value
        source:
          $ref: '#/components/schemas/DeviceTagSource'
      type: object
      required:
        - key
        - value
        - source
      title: DeviceTags
    DeviceIdentity:
      properties:
        username:
          type: string
          title: Username
        user_sid:
          anyOf:
            - type: string
            - type: 'null'
          title: User Sid
      type: object
      required:
        - username
      title: DeviceIdentity
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DeviceAgentInfo:
      properties:
        agent_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Version
        signature_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Signature Version
        policies:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Policies
      type: object
      title: DeviceAgentInfo
    CloudProvider:
      type: string
      enum:
        - aws
      const: aws
      title: CloudProvider
    DeviceTagSource:
      type: string
      enum:
        - aws
        - qualys
        - wiz_vms
      title: DeviceTagSource
  securitySchemes:
    Connection-ID:
      type: apiKey
      in: header
      name: X-CONNECTION-ID
    API-Key:
      type: apiKey
      in: header
      name: X-API-KEY

````