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

# Query assets

> Filters, sorts and selects fields; loads details on request
(`expands`). Large results come page by page through a cursor.

**Queryable fields.** Only known fields are accepted; an unknown field
is rejected. Available are `id`, `entityId`, `schemaId`, `parentId`,
`name`, `objectType`, `type`, `iconId`, `sourceType`,
`organizationId`, `locationId`, `platformId`, `domainId`, `version`,
`status`, `isManually`, `createdAt`, `createdBy`,
`createdByDisplayName`, and the corresponding `modified*` and
`deleted*` fields.

**`data.` paths.** Paths with the prefix `data.` address the type's
data inside an expand. The data type follows the type's data
definition; a field not defined there is treated as a string. A
filter on `schemaId` narrows the resolution and speeds it up.

**Paging.** If an expand returns more rows than its `limit`, the
response carries a cursor under `incompleteExpands` for
`POST /assets/expand` or `POST /cursor/continue`.

Permission: *Read*.




## OpenAPI

````yaml /api-reference/openapi.en.yaml post /assets/query
openapi: 3.0.4
info:
  title: Docusnap365 REST API
  version: v1
  description: |
    Public REST API of Docusnap365. Read access to a tenant's assets with
    filtering, sorting, cursor-based paging and loading of asset details;
    write access through creating and updating assets.

    **Authentication.** API key in the `x-api-key` header. You create keys in
    Docusnap365 under *Administration › API keys*. Every key carries the
    *Read* permission; *Write* can be granted in addition. Read endpoints
    require *Read*, write endpoints require *Write*.

    **Visibility.** The key belongs to a user, and that user's rights apply.
    Only what the user's filters on organization, platform, domain and
    location allow is returned. Missing rights do not raise an error — they
    yield a smaller result set.

    Only **active** assets are returned. Deleted, archived and hidden assets
    cannot be reached, not even through a filter on `status`. Assets of a
    deactivated type are not returned.
servers:
  - url: https://api.docusnap365.com/api/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Assets
    description: Read, query, create and update assets.
paths:
  /assets/query:
    post:
      tags:
        - Assets
      summary: Query assets
      description: |
        Filters, sorts and selects fields; loads details on request
        (`expands`). Large results come page by page through a cursor.

        **Queryable fields.** Only known fields are accepted; an unknown field
        is rejected. Available are `id`, `entityId`, `schemaId`, `parentId`,
        `name`, `objectType`, `type`, `iconId`, `sourceType`,
        `organizationId`, `locationId`, `platformId`, `domainId`, `version`,
        `status`, `isManually`, `createdAt`, `createdBy`,
        `createdByDisplayName`, and the corresponding `modified*` and
        `deleted*` fields.

        **`data.` paths.** Paths with the prefix `data.` address the type's
        data inside an expand. The data type follows the type's data
        definition; a field not defined there is treated as a string. A
        filter on `schemaId` narrows the resolution and speeds it up.

        **Paging.** If an expand returns more rows than its `limit`, the
        response carries a cursor under `incompleteExpands` for
        `POST /assets/expand` or `POST /cursor/continue`.

        Permission: *Read*.
      operationId: queryAssets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiQueryRequest'
            example:
              select:
                - id
                - name
                - status
              filter:
                logic: And
                conditions:
                  - path: schemaId
                    op: Eq
                    value: 00000000-0000-0000-0000-000000000000
                  - path: data.cpuCores
                    op: Gte
                    value: 4
              sort:
                - path: name
                  desc: false
              limit: 50
              expands:
                - name: object_data
                  select:
                    - data.cpuCores
      responses:
        '200':
          $ref: '#/components/responses/AssetResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ApiQueryRequest:
      type: object
      description: Query across the assets.
      properties:
        select:
          type: array
          items:
            type: string
          description: Fields to return. All if omitted.
        filter:
          $ref: '#/components/schemas/ApiFilterGroup'
        sort:
          type: array
          items:
            $ref: '#/components/schemas/ApiSortField'
        cursor:
          type: string
          description: Cursor of a previous response to load the next page.
        limit:
          type: integer
          format: int32
          default: 50
          description: Maximum number of rows per page.
        expands:
          type: array
          items:
            $ref: '#/components/schemas/ApiExpandDefinition'
      additionalProperties: false
    ApiFilterGroup:
      type: object
      description: Conditions joined with `And` or `Or`. Groups can be nested.
      properties:
        logic:
          $ref: '#/components/schemas/FilterLogic'
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ApiFilterCondition'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/ApiFilterGroup'
      additionalProperties: false
    ApiSortField:
      type: object
      required:
        - path
      properties:
        path:
          type: string
        desc:
          type: boolean
          default: false
        nulls:
          $ref: '#/components/schemas/NullsPosition'
      additionalProperties: false
    ApiExpandDefinition:
      type: object
      description: >
        Details to load along. The names are fixed:


        | Name | Cardinality | Content |

        | --- | --- | --- |

        | `object_data` | 1:1 | data of the type |

        | `object_essentials` | 1:n | quick view, one row per `essentialType`
        (`statistics`, `quickinfo`) |

        | `object_blocks` | 1:n | typed blocks |

        | `children` | 1:n | child assets (`parentId`) |


        `object_blocks` is the expensive case: an asset carries several

        thousand blocks on average, over 95,000 in the extreme. Do not request

        this expand without `limit` or `filter`.
      required:
        - name
      properties:
        name:
          type: string
          example: object_data
        select:
          type: array
          items:
            type: string
        filter:
          $ref: '#/components/schemas/ApiFilterGroup'
        sort:
          type: array
          items:
            $ref: '#/components/schemas/ApiSortField'
        limit:
          type: integer
          format: int32
          default: 50
      additionalProperties: false
    FilterLogic:
      type: string
      enum:
        - And
        - Or
      default: And
    ApiFilterCondition:
      type: object
      required:
        - path
        - op
      properties:
        path:
          type: string
          description: >-
            Field path. The prefix `data.` addresses the type's data inside an
            expand.
          example: data.cpuCores
        op:
          $ref: '#/components/schemas/FilterOperator'
        value:
          description: Comparison value; the data type follows the field.
        arrayFilter:
          $ref: '#/components/schemas/ApiFilterGroup'
          description: Filter for the array operators `ArrayAny` and `ArrayAll`.
      additionalProperties: false
    NullsPosition:
      type: string
      enum:
        - Default
        - First
        - Last
      default: Default
    FilterOperator:
      type: string
      description: |
        Comparison: `Eq`, `Neq`, `Gt`, `Gte`, `Lt`, `Lte` ·
        Text: `Contains`, `StartsWith`, `EndsWith`, `Like` ·
        Set: `In`, `NotIn` ·
        Null: `IsNull`, `IsNotNull` ·
        Array: `ArrayAny`, `ArrayAll`, `ArrayContains`
      enum:
        - Eq
        - Neq
        - Gt
        - Gte
        - Lt
        - Lte
        - Contains
        - StartsWith
        - EndsWith
        - Like
        - In
        - NotIn
        - IsNull
        - IsNotNull
        - ArrayAny
        - ArrayAll
        - ArrayContains
  responses:
    AssetResult:
      description: >
        Result set. If an expand was not delivered completely,
        `incompleteExpands` carries one cursor per expand for `POST
        /assets/expand` or `POST /cursor/continue`.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: true
    BadRequest:
      description: >
        Invalid request — unknown field, invalid expression in `select` or
        `search`, missing required value.
      content:
        text/plain:
          schema:
            type: string
    Forbidden:
      description: API key missing or without the required permission.
      content:
        text/plain:
          schema:
            type: string
    ServerError:
      description: Unexpected error.
      content:
        text/plain:
          schema:
            type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >
        API key from Docusnap365 (*Administration › API keys*). Read endpoints
        require the *Read* permission, write endpoints require *Write*.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.