> For the complete documentation index, see [llms.txt](https://docs.shiftiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shiftiq.com/developers/getting-started/queries-and-commands.md).

# Queries and commands

Lions, and tigers, and bears — oh my!

## Introduction

Queries and commands are a fundamental concept to working with the API.

A **query** is an interrogative to request data. It is expressed as a verb or as a verb-noun phrase. For example:

* Count Answers
* Search Groups

A **command** is an imperative to execute a function. It is expressed as a verb or as a verb-noun phrase. For example:

* Add Question
* Delete
* Join Group
* Send Email

## Queries

The API provides support for several distinct types of query. Here is a summary of the purpose and intended developer use case for each type:

<table><thead><tr><th width="135">Query Type</th><th width="398">Query Purpose</th><th>API Endpoint Template</th></tr></thead><tbody><tr><td><i class="fa-check">:check:</i> <strong>Assert</strong></td><td>Check for the existence of one specific item in a collection using a key value (returns true or false)</td><td><p><strong>HEAD</strong></p><p>api/collection/{id}</p></td></tr><tr><td><i class="fa-album-collection">:album-collection:</i> <strong>Collect</strong></td><td>Collect the list of items that match specific criteria in a collection (returns a paged list of heavyweight models, suitable for a detailed view of each item in a user interface; also suitable for integration with other systems)</td><td><strong>POST</strong> (or GET)<br>api/collection/collect</td></tr><tr><td><i class="fa-tally">:tally:</i> <strong>Count</strong></td><td>Count the list of items that match specific criteria in a collection (returns an integer)</td><td><strong>POST</strong> (or GET)<br>api/collection/count</td></tr><tr><td><i class="fa-download">:download:</i> <strong>Download</strong></td><td>Download the list of items that match specific criteria in a collection (returns an unpaged list of heavyweight models, suitable for a detailed view of each item in a user interface; also suitable for integration with other systems)</td><td><strong>POST</strong> (or GET)<br>api/collection/download</td></tr><tr><td><i class="fa-file-export">:file-export:</i> <strong>Export</strong></td><td>Export the list of items that match specific criteria in a collection (returns a private and secure link to download the export file; link expires after 1 hour)</td><td><strong>POST</strong><br>api/collection/export</td></tr><tr><td><i class="fa-album">:album:</i> <strong>Retrieve</strong></td><td>Retrieve one specific item in a collection using a key value (returns a heavyweight model suitable for a detailed view of the item in a user interface)</td><td><p><strong>GET</strong></p><p>api/collection/{id}</p></td></tr><tr><td><i class="fa-magnifying-glass">:magnifying-glass:</i> <strong>Search</strong></td><td>Search for the list of items that match specific criteria in a collection (returns a paged list of lightweight models intended for search results, combo boxes, lookups, etc.)</td><td><strong>POST</strong> (or GET)<br>api/collection/search</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.shiftiq.com/developers/getting-started/queries-and-commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
