# Starts a new query and returns the query id and info

Starts a new query and returns the query id and info

Endpoint: POST /queries/{tenantId}/start/{queryType}/{outputFormat}
Version: v1-2025-04-18
Security: knox-authorizer

## Security:

  - `knox-authorizer` (unknown)
    http bearer JWT

## Path parameters:

  - `tenantId` (string, required)
    The current tenant

  - `queryType` (string, required)
    The type of query

  - `outputFormat` (string, required)
    The output format of the query

## Request body:

  - `application/json` (unknown)
    The query

## Request fields (application/json):

  - `context_id` (string)

  - `criteria` (object)

  - `limit` (number)
    The maximum number of rows to return

  - `name` (string)
    Optional name of the query

  - `offset` (number)
    The starting rows

  - `output_fields` (array, required)

  - `output_fields.alias` (string)

  - `output_fields.label` (string)

  - `output_fields.name` (string, required)

  - `sort_fields` (array)

  - `sort_fields.descending` (boolean)

  - `sort_fields.name` (string, required)

## Response 200:

  - `200` (unknown)
    The query was started successfully.

## Response 200 fields (application/json):

  - `id` (string)
    The id of the query

## Response 200 headers (application/json):

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 400:

  - `400` (unknown)
    The query supplied was not valid.

## Response 400 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 404:

  - `404` (unknown)
    The query definition could not be found.

## Response 404 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 429:

  - `429` (unknown)
    Limit exceeded... unable to merge contact based on tenant limits.

## Response 429 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 500:

  - `500` (unknown)
    General server error.

## Response 500 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

