# Gets the definition for a specific type of query including the available fields

Gets the definition for a specific type of query including the available fields

Endpoint: GET /queries/{tenantId}/public/description/{queryType}
Version: v1-2025-04-18

## Path parameters:

  - `tenantId` (string, required)
    Parameters to the query

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

## Query parameters:

  - `contextId` (string)
    Optional query type

## Response 200:

  - `200` (unknown)
    The contact was merged successfully.

## Response 200 fields (application/json):

  - `common_table_expressions` (array)

  - `common_table_expressions.alias` (string, required)

  - `common_table_expressions.materialized` (boolean)

  - `common_table_expressions.sql` (string, required)

  - `context` (object)

  - `context.display_name` (string)

  - `context.field` (string, required)

  - `context.help_text` (string)

  - `context.required` (boolean)

  - `context.service` (string, required)

  - `default_output_fields` (array, required)

  - `default_output_fields.applies_when_context` (string)
    Enum: "both", "is given", "is not given"

  - `default_output_fields.label` (string)

  - `default_output_fields.name` (string, required)

  - `default_sort_fields` (array, required)

  - `default_sort_fields.applies_when_context` (string)
    Enum: "both", "is given", "is not given"

  - `default_sort_fields.descending` (boolean)

  - `default_sort_fields.name` (string, required)

  - `description` (string)

  - `fields` (array)

  - `fields.acceptable_values` (array)

  - `fields.acceptable_values.hide_from_portal` (boolean)

  - `fields.acceptable_values.label` (string)

  - `fields.acceptable_values.value` (string, required)

  - `fields.custom_sql` (string)

  - `fields.database_column` (string)

  - `fields.group_name` (string, required)

  - `fields.label` (string)

  - `fields.name` (string, required)

  - `fields.path` (string)

  - `fields.reference_service` (string)

  - `fields.service` (string)
    When set, values can be pulled from this service

  - `fields.table_alias` (string, required)

  - `fields.type` (string, required)

  - `id` (string)

  - `name` (string)

  - `perform_custom_resolution_logic` (boolean)
    If set, the microservice must post process the query before it is completely resolves

  - `primary_table` (string, required)

  - `services` (array)

  - `services.group_name` (string)

  - `services.hints` (object)

  - `services.id_column` (string)

  - `services.join_fragment` (string)
    The fragment of sql to create on join

  - `services.service` (string)

  - `services.table` (string)
    The table in the service; if omitted, the assumption is that its the service with dashes converted to underscores

  - `services.table_alias` (string, required)

## 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 contact 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 contact could not be found.

## Response 404 headers:

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

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

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

## Response 409:

  - `409` (unknown)
    The contact could not be saved because it refers to/depends on a non-existent object.

## Response 409 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)

