/api/collection

GET /api/collection/root/items

Changed on

Fetch objects that the current user should see at their root level. As mentioned elsewhere, the 'Root' Collection doesn't actually exist as a row in the application DB: it's simply a virtual Collection where things with no collection_id exist. It does, however, have its own set of Permissions.

This endpoint will actually show objects with no collection_id for Users that have Root Collection permissions, but for people without Root Collection perms, we'll just show the objects that have an effective location of /.

This endpoint is intended to power a 'Root Folder View' for the Current User, so regardless you'll see all the top-level objects you're allowed to access.

By default, this will show the 'normal' Collections namespace; to view a different Collections namespace, such as snippets, you can pass the ?namespace= parameter.

By default, library collections are excluded from the results; to include them, pass ?include-library=true.

Pass ?q= to filter items by name or last editor. Pass ?include-available-models=true to include the models that have at least one visible item in the requested scope.

Note that this endpoint should return results in a similar shape to /api/dashboard/:id/items, so if this is changed, that should too.

get/api/collection/root/items

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Query parameters

collection-type'remote-synced'
include-libraryboolean nullable

value must be a valid boolean string ('true' or 'false').

qstring nullable
pinned-state'is_not_pinned' | 'is_pinned' | 'all' nullable
archivedboolean nullable

value must be a valid boolean string ('true' or 'false').

sort-direction'desc' | 'asc' nullable
show-dashboard-questionsboolean nullable

value must be a valid boolean string ('true' or 'false').

show-exploration-documentsboolean nullable

value must be a valid boolean string ('true' or 'false').

include-available-modelsboolean nullable

value must be a valid boolean string ('true' or 'false').

namespacestring nullable

value must be a non-blank string.

modelsstring[] nullable
official-collections-firstboolean nullable

value must be a valid boolean string ('true' or 'false').

sort-column'model' | 'name' | 'last_edited_by' | 'last_edited_at' | 'description' nullable

Request body

object required

Response

Successful response

dataobject[] required
limitinteger nullable

value must be an integer greater or equal to than zero.

offsetinteger nullable

value must be an integer greater or equal to than zero.

totalinteger required

value must be an integer greater or equal to than zero.

Changes

    • warning

      deleted the query request parameter collection_type

    • warning

      deleted the query request parameter include_can_run_adhoc_query

    • warning

      deleted the query request parameter include_library

    • warning

      deleted the query request parameter official_collections_first

    • warning

      deleted the query request parameter pinned_state

    • warning

      deleted the query request parameter show_dashboard_questions

    • warning

      deleted the query request parameter sort_column

    • warning

      deleted the query request parameter sort_direction

    • info

      added the new optional query request parameter collection-type

    • info

      added the new optional query request parameter include-available-models

    • info

      added the new optional query request parameter include-library

    • info

      added the new optional query request parameter official-collections-first

    • info

      added the new optional query request parameter pinned-state

    • info

      added the new optional query request parameter q

    • info

      added the new optional query request parameter show-dashboard-questions

    • info

      added the new optional query request parameter show-exploration-documents

    • info

      added the new optional query request parameter sort-column

    • info

      added the new optional query request parameter sort-direction

    • info

      added optional request body

    • info

      the query request parameter archived became optional

    • info

      added the media type application/json for the response with the status

    • info

      added the enum value measure to the property oneOf[subschema #1]/items/ of the query request parameter models