> ## Documentation Index
> Fetch the complete documentation index at: https://hc.saas-manager.biz.nuro.jp/llms.txt
> Use this file to discover all available pages before exploring further.

# Search devices for an organization



## OpenAPI

````yaml https://api.itmc.i.moneyforward.com/public-api/docs/v1-json post /api/v1/organizations/{organizationId}/devices/search
openapi: 3.0.0
info:
  title: Admina Public API
  description: >-
    Admina API is a RESTfull API providing programmatic access to much of the
    data in the system. It provides predictable URLs for accessing resources,
    and uses built-in HTTP features to receive commands and return responses.
    This makes it easy to communicate with from a wide variety of environments,
    from command-line utilities to gadgets to the browser URL bar itself.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.itmc.i.moneyforward.com
security: []
tags:
  - name: Organizations
    description: ''
  - name: Users
    description: ''
  - name: Directory
    description: ''
  - name: Departments
    description: ''
  - name: Locations
    description: ''
  - name: Companies
    description: ''
  - name: People
    description: ''
  - name: Workspaces
    description: ''
  - name: Custom Service and Workspace
    description: ''
  - name: Workspace Accounts
    description: ''
  - name: Accounts
    description: ''
  - name: Contracts
    description: ''
  - name: Devices
    description: ''
  - name: Devices (alpha)
    description: ''
  - name: Alerts
    description: ''
  - name: Spends
    description: ''
  - name: Usage Optimization
    description: ''
  - name: Services
    description: ''
  - name: Requests
    description: ''
  - name: AuditLogs
    description: ''
  - name: EventLogs
    description: ''
paths:
  /api/v1/organizations/{organizationId}/devices/search:
    post:
      tags:
        - Devices
      summary: Search devices for an organization
      operationId: publicSearchDevices
      parameters:
        - name: organizationId
          required: true
          in: path
          schema:
            type: number
        - name: limit
          required: false
          in: query
          description: Maximum number of items to return per page
          schema:
            example: 50
            type: number
        - name: cursor
          required: false
          in: query
          description: >-
            Base64-encoded cursor for pagination. Use the cursor from the
            previous response to get the next page.
          schema:
            type: string
        - name: sortBy
          required: false
          in: query
          description: >-
            The `sortBy` value is a string that contains two parts separated by
            a dot. The first part is either `preset` or `custom` and the second
            part is the unique field name. Additionally the following fields can
            be used for sorting: `people.displayName`.
          schema:
            example: <preset | custom>.<unique field name>
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort order for the results (asc or desc)
          schema:
            $ref: '#/components/schemas/SortOrder'
        - name: expands
          required: false
          in: query
          description: >-
            Expand other datasets when fetching devices. Accepts multiple
            options.
          schema:
            type: array
            items:
              $ref: '#/components/schemas/DeviceExpand'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicSearchDevicesRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicSearchDevicesResponseDto'
        '418':
          description: >-
            The feature isn't available for the organization. Please contact the
            support team.
      security:
        - API-Key: []
components:
  schemas:
    SortOrder:
      type: string
      enum:
        - DESC
        - ASC
    DeviceExpand:
      type: string
      enum:
        - relatedIdentity
        - customFieldsMetadata
    PublicSearchDevicesRequestDto:
      type: object
      properties:
        peopleId:
          type: number
          example: 5034567
          description: Filter devices by the people ID assigned to them
        type:
          example: pc
          description: Filter devices by device type
          allOf:
            - $ref: '#/components/schemas/DeviceType'
        groupId:
          type: number
          example: 42
          description: >-
            Filter devices to those matching the conditions of the given Device
            Group (restricts results to the group's member devices).
        employeeStatus:
          example: active
          description: Filter devices by the employment status of the assigned person
          allOf:
            - $ref: '#/components/schemas/EmployeeStatus'
        searchTerm:
          type: string
          example: foo
          description: >-
            Search term to filter devices. Searches across fields specified in
            searchFields
        searchFields:
          example:
            - memo
            - people.primaryEmail
            - people.displayName
            - preset.asset_number
            - preset.<unique field name>
            - custom.<unique field name>
          description: >-
            Array of field names to search within when using searchTerm.
            Supports memo, people fields, preset fields, and custom fields
          type: array
          items:
            type: string
        filters:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DeviceFilterOptions'
          description: >-
            The object key is the field name, and the value is the filter
            options. Keys look like `preset.<unique field name>`. There are
            certain extra virtual fields, such as `$age`, please check
            implementation or ask a backend engineer.
    PublicSearchDevicesResponseDto:
      type: object
      properties:
        meta:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/CursorPaginationMeta'
        items:
          readOnly: true
          type: array
          items:
            $ref: '#/components/schemas/DeviceDto'
      required:
        - meta
        - items
    DeviceType:
      type: string
      enum:
        - pc
        - phone
        - other
    EmployeeStatus:
      type: string
      enum:
        - active
        - on_leave
        - draft
        - preactive
        - retired
        - untracked
    DeviceFilterOptions:
      type: object
      properties:
        minDate:
          type: string
          example: '2021-01-01'
          format: date
          description: only supported by fields with `date` kind
        maxDate:
          type: string
          example: '2021-01-01'
          format: date
          description: only supported by fields with `date` kind
        minNumber:
          type: number
          example: 1
          description: >-
            only supported by fields with `number` kind and few special fields
            such as `$age`
        maxNumber:
          type: number
          example: 2
          description: >-
            only supported by fields with `number` kind and few special fields
            such as `$age`
        eq:
          type: string
          example: foo
          description: only supported by fields with `dropdown` kind
    CursorPaginationMeta:
      type: object
      properties:
        nextCursor:
          type: string
          nullable: true
          readOnly: true
          example: F3UdkoSbpBNrjwP93AX2HQ
        totalItems:
          type: number
          nullable: true
          readOnly: true
          example: 1
      required:
        - nextCursor
    DeviceDto:
      type: object
      properties:
        id:
          type: number
          readOnly: true
          example: 123
        memo:
          type: string
          readOnly: true
          example: foo bar
        people:
          nullable: true
          readOnly: true
          type: object
          allOf:
            - $ref: '#/components/schemas/PeopleResponseDto'
        originalPeopleId:
          type: number
          nullable: true
          readOnly: true
          example: 456
        fields:
          type: object
          additionalProperties:
            nullable: true
            oneOf:
              - type: string
              - type: number
          readOnly: true
          example:
            preset.subtype: other
            preset.asset_number: unique value
            preset.model_name: cool gadget
            custom.custom_text_field: foo
            custom.custom_date_field: '2024-01-01'
            custom.custom_number_field: 123
            custom.custom_dropdown_field: Option Displayed Value A
        mdmMetadata:
          nullable: true
          readOnly: true
          type: object
          allOf:
            - $ref: '#/components/schemas/MdmMetadataDto'
        relatedIdentities:
          nullable: true
          readOnly: true
          type: object
          allOf:
            - $ref: '#/components/schemas/RelatedIdentitiesDto'
        customFieldsWithMetadata:
          readOnly: true
          example:
            - id: 1
              attributeCode: custom_text_field
              attributeName: Text field
              value: foo
            - id: 2
              attributeCode: custom_date_field
              attributeName: Date field
              value: '2024-01-01'
            - id: 3
              attributeCode: custom_number_field
              attributeName: Number field
              value: 123
            - id: 4
              attributeCode: custom_dropdown_field
              attributeName: Dropdown field
              value: Option Displayed Value A
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldWithMetadataDto'
      required:
        - id
        - memo
        - people
        - originalPeopleId
        - fields
        - mdmMetadata
        - relatedIdentities
        - customFieldsWithMetadata
    PeopleResponseDto:
      type: object
      properties:
        id:
          type: number
          readOnly: true
          example: 1
        identityId:
          type: string
          nullable: true
          readOnly: true
          example: I3N5HB4B3G
        primaryEmail:
          type: string
          nullable: true
          readOnly: true
          example: foo@gmail.com
        displayName:
          type: string
          nullable: true
          readOnly: true
          example: Yamaha Honda
        avatar:
          type: string
          nullable: true
          readOnly: true
          example: avatar_url
        username:
          type: string
          nullable: true
          readOnly: true
          example: foo
        type:
          type: string
          readOnly: true
          example: employee
        status:
          type: string
          readOnly: true
          example: suspended
        managementType:
          readOnly: true
          example: managed
          allOf:
            - $ref: '#/components/schemas/ManagementType'
        employeeType:
          readOnly: true
          example: full_time_employee
          allOf:
            - $ref: '#/components/schemas/EmployeeType'
        employeeStatus:
          readOnly: true
          example: active
          allOf:
            - $ref: '#/components/schemas/EmployeeStatus'
        suspendedAt:
          type: string
          nullable: true
          readOnly: true
          example: '2021-07-13T19:15:40.000Z'
        createdAt:
          type: string
          nullable: true
          readOnly: true
          example: '2021-07-13T19:15:40.000Z'
        accounts:
          nullable: true
          readOnly: true
          type: array
          items:
            $ref: '#/components/schemas/CompactPeopleAccountDto'
        mergedPeople:
          nullable: true
          readOnly: true
          example:
            - id: 1
              displayName: Ron Lee
              username: ron.lee
              primaryEmail: null
          type: array
          items:
            $ref: '#/components/schemas/MergedPeopleDto'
      required:
        - id
        - identityId
        - primaryEmail
        - displayName
        - avatar
        - username
        - type
        - status
        - managementType
        - employeeType
        - employeeStatus
        - suspendedAt
        - createdAt
        - accounts
        - mergedPeople
    MdmMetadataDto:
      type: object
      properties:
        workspaceId:
          type: number
          readOnly: true
          example: 123
        serviceUniqueName:
          type: string
          readOnly: true
          example: jamf
        url:
          type: string
          nullable: true
          readOnly: true
          example: https://example.com
      required:
        - workspaceId
        - serviceUniqueName
        - url
    RelatedIdentitiesDto:
      type: object
      properties:
        identityHolder:
          nullable: true
          description: Identity holder information
          type: object
          allOf:
            - $ref: '#/components/schemas/RelatedIdentityDto'
        managerHolder:
          nullable: true
          description: Manager holder information
          type: object
          allOf:
            - $ref: '#/components/schemas/RelatedIdentityDto'
    CustomFieldWithMetadataDto:
      type: object
      properties:
        id:
          type: number
          description: The ID of the custom field template
          example: 1
        attributeCode:
          type: string
          description: The unique identifier for the custom field
          example: custom_uuid
        attributeName:
          type: string
          description: The display label for the custom field
          example: custom_text_field
        value:
          type: object
          description: >-
            The value of the custom field (string, number, or date string
            depending on the field type)
          example: foo
      required:
        - id
        - attributeCode
        - attributeName
        - value
    ManagementType:
      type: string
      enum:
        - managed
        - external
        - system
        - unknown
        - unregistered
    EmployeeType:
      type: string
      enum:
        - board_member
        - full_time_employee
        - fixed_time_employee
        - temporary_employee
        - part_time_employee
        - secondment_employee
        - contract_employee
        - collaborator
        - group_address
        - shared_address
        - test_address
        - other
        - unknown
        - unregistered
    CompactPeopleAccountDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
          readOnly: true
          example: 1#foo
        serviceId:
          type: number
          nullable: true
          readOnly: true
          example: 42
        serviceUniqueName:
          type: string
          nullable: true
          readOnly: true
          example: github
        serviceName:
          type: string
          nullable: true
          readOnly: true
          example: GitHub
        workspaceName:
          type: string
          nullable: true
          readOnly: true
          example: mfi
        accountKey:
          type: string
          nullable: true
          readOnly: true
          example: foo@mfi.com
        serviceIsCustom:
          type: boolean
          nullable: true
          readOnly: true
          example: false
      required:
        - id
        - serviceId
        - serviceUniqueName
        - serviceName
        - workspaceName
        - accountKey
        - serviceIsCustom
    MergedPeopleDto:
      type: object
      properties:
        id:
          type: number
          readOnly: true
          example: 1
        primaryEmail:
          type: string
          nullable: true
          readOnly: true
          example: foo@gmail.com
        username:
          type: string
          nullable: true
          readOnly: true
          example: foo
        displayName:
          type: string
          nullable: true
          readOnly: true
          example: Yamaha Honda
      required:
        - id
        - primaryEmail
        - username
        - displayName
    RelatedIdentityDto:
      type: object
      properties:
        id:
          type: string
          description: ID of the employee
        displayName:
          type: string
          example: Display Name
          description: Display name of the employee
          nullable: true
        avatar:
          type: string
          description: URL of the avatar of the employee
          nullable: true
        primaryEmail:
          type: string
          example: primay@email.com
          description: Primary email of the employee
          nullable: true
  securitySchemes:
    API-Key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        For authenticated requests, set the `Authorization: Bearer your_api_key`
        parameter in the header. <br/>You can create and manage your API Keys by
        visiting the **API Keys** tab in the **Settings** page of your
        organization in <a target='_blank'
        href='https://itmc.i.moneyforward.com/'>Admina</a>

````