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

# Create a Query Result

> Kick off processing of a Query to then get back the Query Results.
Once the Query Result has been created, the query will be run asynchronously, allowing the result data to be fetched from the GET query result endpoint.
A maximum duration of 7 days of data can be queried. Any queries with a `start_time`, `end_time`, or `time_range` resulting in a duration longer than 7 days will result in a `400` error response.




## OpenAPI

````yaml /api/openapi-public.yaml post /1/query_results/{datasetSlug}
openapi: 3.1.0
info:
  title: Honeycomb API
  version: 1.0.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    email: support@honeycomb.io
  description: >
    The API allows programmatic management of many resources within Honeycomb.


    Please report any discrepancies with actual API behavior in <a
    href="https://docs.honeycomb.io/troubleshoot/community/">Pollinators
    Slack</a> or to <a href="https://support.honeycomb.io/">Honeycomb
    Support</a>.
servers:
  - url: https://api.honeycomb.io
  - url: https://api.eu1.honeycomb.io
security: []
tags:
  - name: Auth
    description: >
      API Keys have various scopes permissions and belong to a specific Team or
      Environment.


      Any valid Honeycomb ingest or configuration API Key will work with this
      endpoint. Learn more about [API
      keys](https://docs.honeycomb.io/get-started/best-practices/api-keys).


      These endpoints can be used to validate authentication for a key, to
      determine what authorizations have been granted

      to a key, and to determine the Team and Environment that a key belongs to.
  - name: Boards
    description: >
      Boards are a place to pin and save useful queries/graphs, SLO panels, text
      panels, and views you want to retain for later reuse and reference.


      Boards can contain multiple panel types:

      - **Query panels**: Display saved queries/graphs

      - **SLO panels**: Monitor Service Level Objectives

      - **Text panels**: Add markdown-formatted text and documentation

      - **Views**: Filtered perspectives of board data (limited to 50 views per
      board)


      Boards also support preset filters (limited to 5 per board) to apply
      consistent filtering across the board.


      This API allows you to list, create, update, and delete boards, as well as
      manage board views.


      ## Authorization


      The API key must have the **Manage Public Boards** permission. Learn more
      about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Burn Alerts
    description: >
      This feature is available as part of the [Honeycomb Pro and Enterprise
      plans](https://www.honeycomb.io/pricing/).


      Burn Alerts notify you when issues impact your SLO budget. Learn more
      about [Burn Alerts
      here](https://docs.honeycomb.io/notify/alert/slos/monitor/).


      This API allows you to list, create, update, and delete burn alerts.


      ## Authorization


      The API key must have the **Manage SLOs** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Calculated Fields
    description: >
      Calculated Fields (also called Derived Columns) allow you to run queries
      based on the value of an expression that is calculated from the fields in
      an event.


      This API allows you to list, create, update, and delete Calculated Fields
      in a dataset or across a whole environment, paralleling the behavior of
      the Schema tab within a Dataset's or Environment's Settings UI.


      ## Authorization


      The API key must have the **Manage Queries and Columns** permission. Learn
      more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Columns
    description: >
      Columns are fields in the events you send to Honeycomb.


      This API allows you to list, create, update, and delete columns in a
      dataset.


      ## Authorization


      The API key must have the **Manage Queries and Columns** permission. Learn
      more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Datasets
    description: >
      A Dataset represents a collection of related events that come from the
      same source, or are related to the same source.


      This API allows you to list, create, and update datasets.


      ## Authorization


      The API key must have the **Create Datasets** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Dataset Definitions
    description: >
      Dataset definitions describe the fields with special meaning in the
      Dataset.


      Refer to the [Dataset
      Definitions](https://docs.honeycomb.io/configure/datasets/definitions/)
      documentation for more information.


      **Honeycomb automatically creates these Dataset definition fields when the
      Dataset is created.**

      Manual creation of Dataset definitions is **not** needed.


      ## Authorization


      The API key must have the **Create Datasets** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Events
    description: >
      The Events API endpoints are the lowest-level way to send Events to
      Honeycomb. **This should be your last resort!**




      If unsure where to start when instrumenting an application, read about how
      to [Send Data to Honeycomb](https://docs.honeycomb.io/send-data/).



      If you are building a tracing or metrics library, we recommend using
      [OpenTelemetry](https://docs.honeycomb.io/send-data/opentelemetry/).


      ## Authorization


      It is recommended that an Ingest API key is used for sending events.


      A Configuration API key will work, and must have the **Send Events**
      permission.

      Learn more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Environments
    description: >
      This API allows you to list, create, and update, and delete Environments.


      ## Authorization


      This API requires a Management Key passed via the HTTP Authorization
      header. Join the key ID and secret with a colon, like this:
      `Authorization: Bearer <key ID>:<secret>`.
  - name: Key Management
    description: >
      This API allows you to list, create, update, and delete API Keys for a
      Team.



      Learn more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).


      ## Authorization

       This API requires a Management Key passed via the HTTP Authorization header. Join the key ID and secret with a colon, like this: `Authorization: Bearer <key ID>:<secret>`.
  - name: Kinesis Events
    description: >
      The Kinesis Events API endpoints allow Honeycomb to process streaming
      events from Amazon Kinesis.


      Refer to the [Honeycomb AWS
      integrations](https://docs.honeycomb.io/integrations/aws/how-aws-integrations-work/)
      documentation for more information.


      ## Authorization


      It is recommended that an Ingest API key is used for sending events.


      A Configuration API key will work, and must have the **Send Events**
      permission.

      Learn more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Markers
    description: >
      Markers indicate points in time on graphs where interesting things happen,
      such as deploys or outages.


      This API allows you to list, create, update, and delete Markers.


      ## Authorization


      The API key must have the **Manage Markers** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Marker Settings
    description: >
      Marker Settings apply to groups of similar Markers.

      For example, "deploys" markers appear with the same color on a graph.


      This API allows you to list, create, update, and delete Marker Settings.


      ## Authorization


      The API key must have the **Manage Markers** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Queries
    description: >
      Queries in Honeycomb are specifications for queries, and are used to
      identify queries in other parts of the API - in particular: boards,
      triggers, and query annotations.


      This API allows you to create and get query objects.


      ## Authorization


      The API key must have the **Manage Queries and Columns** permission. Learn
      more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Query Annotations
    description: >
      Query Annotations in Honeycomb allow you to associate names and
      descriptions to queries to add additional information in collaboration
      features.


      This API allows you to list, create, update, and delete Query Annotations.


      ## Authorization


      The API key must have the **Manage Queries and Columns** permission. Learn
      more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Query Data
    description: >
      This feature is available as part of the [Honeycomb Enterprise
      plan](https://www.honeycomb.io/pricing/).


      Query Results are the aggregated data from a Query, similar to what is
      displayed in graphs or heatmaps within the Honeycomb UI. Receiving results
      from a Query is a three-step process:


      Create the Query (or Query Spec), which validates that the query
      parameters are valid. Creating a query does not actually run the query to
      get results.

      Run the query asynchronously by creating a Query Result referencing the
      Query’s ID. This returns a Query Result ID.

      Poll the query result endpoint (with the Query Result ID) until the data
      is ready.


      Note that many Query Results can be created from a single Query. This is
      particularly useful when using a relative time_range parameter in the
      Query.

      For example, a Query with `time_range: 7200` and no explicit `start_time`
      or `end_time` can be re-run over and over, with each resulting Query
      Result containing the most recent 2 hours of data.

      This is conceptually similar to clicking Run Query in the Honeycomb UI
      without changing any query parameters.


      **IMPORTANT API RESTRICTIONS:**


      To ensure the stability of Honeycomb systems, we have enabled the
      following API restrictions. These restrictions may change over time.


      * Query Results can only be created for events with timestamps within the
      past 7 days.


      * When creating a Query Result, the time ranges from the Query are
      truncated according to the following rules. For queries with a time range
      of:

          * less than or equal to 6 hours, results are truncated to the nearest 1 minute. For example, a start/end time of 2021-04-22T05:28:12Z will be truncated to 2021-04-22T05:28:00Z.

          * greater than 6 hours and less than or equal to 2 days, results are truncated to the nearest 5 minutes. For example, a start/end time of 2021-04-22T05:28:12Z will be truncated to 2021-04-22T05:25:00Z.

          * greater than 2 days and less than or equal to 7 days, results are truncated to the nearest 30 minutes. For example, a start/end time of 2021-04-22T05:28:12Z will be truncated to 2021-04-22T05:00:00Z.

      * Creating a Query Result is rate limited to 10 requests per minute.
      Status code 429 will be returned when rate limited.


      * Query Results cannot take longer than 10 seconds to run.


      * Creating a Query Result that contains Relational Fields is rate limited
      to 1 request per minute. Status code 429 will be returned when rate
      limited.

        * Query Results with Relational Fields may be more likely to take longer to run.

      * Regardless of whether the `compare_time_offset_seconds` field is
      populated on a query, query run responses will not include comparison
      results.


      ## Authorization


      The API key must have the **Manage Queries and Columns** and **Run
      Queries** permission. Learn more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Recipients
    description: >
      Honeycomb Recipients allow you to define and manage the Recipients that
      will get notified by a Trigger or Burn Alert.


      The types of Recipients supported are: PagerDuty, Email, Webhook,
      Microsoft Teams, and Slack.


      ## Authorization


      The API key must have the **Manage Recipients** permission. Recipients are
      team-wide and NOT environment-specific.

      API Keys with the **Manage Recipients** permission can modify recipients
      used by ALL environments for a given team.


      Learn more about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Reporting
    description: >
      The Reporting API provides access to historical performance data.


      ## Authorization


      The API key must have the **Manage SLOs** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Service Maps
    description: >
      The Service Maps API endpoints allow you to visualize the relationships
      between your services in Honeycomb.


      This API allows you to create and retrieve service Dependency Requests,
      which are used to generate maps of dependencies between services.


      ## Authorization


      The API key must have the **Read Service Maps** permission. Learn more
      about [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: SLOs
    description: >
      This feature is available as part of the [Honeycomb Pro and Enterprise
      plans](https://www.honeycomb.io/pricing).


      Honeycomb SLOs allow you to define and monitor Service Level Objectives
      (SLOs) for your organization.


      This API allows you to list, create, update, and delete SLO objects.


      You can also access historical reporting for your SLOs to analyze
      long-term performance trends. For more information, see [Get SLO
      History](https://api-docs.honeycomb.io/api/reporting/getslohistory)


      ## Authorization


      The API key must have the **Manage SLOs** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
  - name: Triggers
    description: >
      Triggers let you receive notifications when your data in Honeycomb crosses
      the thresholds that you configure.

      The graph on which to alert is as flexible as a Honeycomb query, which
      helps reduce false positives due to known errors.


      Triggers support both standard event-based datasets and metrics datasets.
      Metrics triggers have additional capabilities

      such as granularity control.

      Learn more in the [Triggers
      documentation](https://docs.honeycomb.io/notify/alert/triggers/).


      This API allows you to list, create, update, and delete Triggers.


      ## Authorization


      The API key must have the **Manage Triggers** permission. Learn more about
      [API keys
      here](https://docs.honeycomb.io/configure/environments/manage-api-keys/).
externalDocs:
  url: https://docs.honeycomb.io
paths:
  /1/query_results/{datasetSlug}:
    parameters:
      - $ref: '#/components/parameters/datasetSlugOrAll'
    post:
      tags:
        - Query Data
      summary: Create a Query Result
      description: >
        Kick off processing of a Query to then get back the Query Results.

        Once the Query Result has been created, the query will be run
        asynchronously, allowing the result data to be fetched from the GET
        query result endpoint.

        A maximum duration of 7 days of data can be queried. Any queries with a
        `start_time`, `end_time`, or `time_range` resulting in a duration longer
        than 7 days will result in a `400` error response.
      operationId: createQueryResult
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQueryResultRequest'
        required: true
      responses:
        '201':
          description: Created
          headers:
            Location:
              schema:
                type: string
              description: >-
                The Location header will contain the URL where the results can
                be fetched.
              example: >-
                https://api.honeycomb.io/1/query_results/test-via-curl/HprJhV1fYyr
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResult'
              examples:
                Simple Query:
                  value:
                    query:
                      calculations:
                        - op: COUNT
                      orders:
                        - op: COUNT
                          order: descending
                      limit: 10000
                      time_range: 7200
                    complete: false
                    id: dfg456
                    links:
                      query_url: >-
                        https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/dfg456
                      graph_image_url: >-
                        https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/dfg456/snapshot
                Query with Filter and Group By:
                  value:
                    query:
                      calculations:
                        - op: COUNT
                      breakdowns:
                        - user_agent
                      filters:
                        - op: '>='
                          column: response.status_code
                          value: 400
                      orders:
                        - op: COUNT
                          order: descending
                      limit: 10000
                      time_range: 7200
                    complete: false
                    id: hij678a
                    links:
                      query_url: >-
                        https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/hij678a
                      graph_image_url: >-
                        https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/hij678a/snapshot
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          description: Rate Limit Exceeded
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/DetailedError'
              example:
                status: 429
                type: https://api.honeycomb.io/problems/rate-limited
                title: You have exceeded your rate limit.
                error: You have exceeded your rate limit.
                detail: This endpoint allows 10 requests per minute.
        default:
          $ref: '#/components/responses/GenericError'
      security:
        - configuration_key: []
components:
  parameters:
    datasetSlugOrAll:
      name: datasetSlug
      description: >
        The dataset slug or use `__all__` for endpoints that support
        environment-wide operations.
      in: path
      required: true
      schema:
        type: string
  schemas:
    CreateQueryResultRequest:
      type: object
      description: A Query Result is created with the Query ID.
      required:
        - query_id
      properties:
        query_id:
          type: string
          writeOnly: true
          description: >
            The ID of a query returned from the [Queries
            endpoint](/api/queries/).
          example: mabAMpSPDjH
        disable_series:
          type: boolean
          writeOnly: true
          description: >
            If `true`, timeseries data will not be returned in the `series`
            response field, and only summarized data will be returned in the
            `results` response field.
          default: false
        disable_total_by_aggregate:
          type: boolean
          writeOnly: true
          description: >
            If `true`, data representing each aggregate in the query's total
            value will not be returned. Ensure `disable_series` is false to
            return the timeseries data.
          default: true
        disable_other_by_aggregate:
          type: boolean
          default: true
          writeOnly: true
          description: >
            If true, the "other_by_aggregate" data is excluded from the query
            result.
        limit:
          type: integer
          writeOnly: true
          maximum: 10000
          description: >
            If `disable_series` is `true`, a limit may be optionally given. The
            limit will override the default limit of 1_000 results with a
            maximum available limit of 10_000. If `disable_series` is `false`,
            this field will be ignored.
    QueryResult:
      type: object
      description: A Query Result is created with the Query ID.
      properties:
        query:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/Query'
        id:
          type: string
          description: The unique identifier (ID) of a Query Result.
          readOnly: true
          example: sGUnkBHgRFN
        complete:
          type: boolean
          description: >-
            Indicates if the query results are available yet or not. For
            example, is the query still being processed or complete?
          readOnly: true
          example: false
        links:
          type: object
          description: >-
            An object containing UI links to the query result and query result
            graph
          readOnly: true
          properties:
            query_url:
              type: string
              example: >-
                https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/HprJhV1fYy
            graph_image_url:
              type: string
              example: >-
                https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/HprJhV1fYy/snapshot
    DetailedError:
      x-tags:
        - Errors
      description: An RFC7807 'Problem Detail' formatted error message.
      type: object
      required:
        - error
        - status
        - type
        - title
      properties:
        error:
          type: string
          readOnly: true
          default: something went wrong!
        status:
          type: number
          readOnly: true
          description: The HTTP status code of the error.
        type:
          type: string
          readOnly: true
          description: Type is a URI used to uniquely identify the type of error.
        title:
          type: string
          readOnly: true
          description: >-
            Title is a human-readable summary that explains the `type` of the
            problem.
        detail:
          type: string
          readOnly: true
          description: The general, human-readable error message.
        instance:
          type: string
          readOnly: true
          description: The unique identifier (ID) for this specific error.
    Query:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        breakdowns:
          type: array
          default:
            - user_agent
          maxItems: 100
          items:
            type: string
          description: the columns by which to break events down into groups
        calculations:
          type: array
          description: the calculations to return as a time series and summary table
          maxItems: 100
          items:
            type: object
            required:
              - op
            properties:
              op:
                allOf:
                  - $ref: '#/components/schemas/QueryOp'
                  - default: COUNT
              column:
                type:
                  - 'null'
                  - string
                description: The name of the column
              name:
                type:
                  - 'null'
                  - string
                description: >-
                  The name of the calculation. This is required if using
                  calculation filters. Only available in Metrics Beta.
              filters:
                type: array
                maxItems: 100
                items:
                  type: object
                  required:
                    - column
                    - op
                  properties:
                    op:
                      $ref: '#/components/schemas/FilterOp'
                    column:
                      $ref: '#/components/schemas/FilterColumn'
                    value:
                      $ref: '#/components/schemas/FilterValue'
                description: >-
                  The filters with which to restrict the results of this
                  particular calculation. Does not support relational fields.
                  Only available in Metrics Beta.
              filter_combination:
                $ref: '#/components/schemas/FilterCombination'
        filters:
          type: array
          maxItems: 100
          items:
            type: object
            required:
              - column
              - op
            properties:
              op:
                $ref: '#/components/schemas/FilterOp'
              column:
                $ref: '#/components/schemas/FilterColumn'
              value:
                $ref: '#/components/schemas/FilterValue'
          description: The filters with which to restrict the considered events
        filter_combination:
          $ref: '#/components/schemas/FilterCombination'
        formulas:
          type: array
          description: >-
            Mathematical formulas to be returned as a time series and summary
            table. Formulas operate on the results of calculations and are
            returned in query results instead of calculations. Only available in
            Metrics Beta.
          maxItems: 100
          items:
            type: object
            required:
              - name
              - expression
            properties:
              name:
                type:
                  - string
                description: The name of the formula
              expression:
                type:
                  - string
                description: >-
                  An expression that follows the same syntax as calculated field
                  expressions, but uses the names of items in the calculations
                  list in place of column names.
        granularity:
          type: integer
          minimum: 1
          description: >
            The time resolution of the query's graph, in seconds. Given a query
            time range T, valid values (T/1000...T/1). If left blank,
            granularity may be set to a sub-second value for queries with short
            time ranges.
        orders:
          type: array
          maxItems: 100
          items:
            type: object
            properties:
              column:
                type: string
              op:
                $ref: '#/components/schemas/QueryOp'
              order:
                type: string
                default: ascending
                enum:
                  - ascending
                  - descending
          description: >
            The terms on which to order the query results. Each term must appear
            in the `breakdowns` field, the `calculations` field, or the
            `formulas` field. Formulas and calculations with name properties can
            be referenced by putting the name in the column property.
        limit:
          type: integer
          default: 100
          minimum: 1
          maximum: 10000
          description: >
            The maximum number of unique groups returned in 'results'.
            Aggregating many unique groups across a large time range is
            computationally expensive, and too high a limit with too many unique
            groups may cause queries to fail completely. Limiting the results to
            only the needed values can significantly speed up queries.

            The normal allowed maximum value when creating a query is 1_000.
            When running 'disable_series' queries, this can be overridden to be
            up to 10_000, so the maximum value returned from the API when
            fetching a query may be up to 10_000.
        start_time:
          type: integer
          minimum: 1
          default: 1676399428
          description: >
            Absolute start time of query, in seconds since UNIX epoch. Must be
            <= `end_time`.
        end_time:
          type: integer
          minimum: 1
          default: 1676467828
          description: Absolute end time of query, in seconds since UNIX epoch.
        time_range:
          type: integer
          minimum: 1
          default: 7200
          description: >
            Time range of query in seconds. Can be used with either `start_time`
            (seconds after `start_time`), `end_time` (seconds before
            `end_time`), or without either (seconds before now).
        havings:
          type: array
          description: >
            The Having clause allows you to filter on the results table. This
            operation is distinct from the Where clause, which filters the
            underlying events. Order By allows you to order the results, and
            Having filters them. Formulas and calculations with name properties
            can be referenced by putting the name in the column property.
          maxItems: 100
          items:
            type: object
            required:
              - calculate_op
            properties:
              calculate_op:
                allOf:
                  - $ref: '#/components/schemas/HavingCalculateOp'
              column:
                type:
                  - 'null'
                  - string
                description: >-
                  The name of the column to filter against. This can also be a
                  calculation or formula name.
              op:
                allOf:
                  - $ref: '#/components/schemas/HavingOp'
              value:
                type: number
                default: 10
        calculated_fields:
          type: array
          description: |
            Computed properties that are calculated by a formula.
          maxItems: 100
          items:
            type: object
            required:
              - name
              - expression
            properties:
              name:
                type: string
                description: The field name
              expression:
                type: string
                description: >-
                  The formula for your Calculated Field. To learn more about
                  syntax and available functions, and to explore some example
                  formulas, visit [Calculated Field Formula
                  Reference](https://docs.honeycomb.io/reference/derived-column-formula/).
        compare_time_offset_seconds:
          type: integer
          enum:
            - 1800
            - 3600
            - 7200
            - 28800
            - 86400
            - 604800
            - 2419200
            - 15724800
          description: >
            When set, offsets the query's time range by this number of seconds
            into the past, allowing comparison with historical data from an
            earlier time period. For example, setting this to 86400 (24 hours)
            will compare current results against data from 24 hours ago.

            ##### Note
              - The offset must be greater than or equal to the query's time range duration.

            ##### Allowed values

            - same time range as query time range

            - `1800` - 30 minutes

            - `3600` - 1 hour

            - `7200` - 2 hours

            - `28800` - 8 hours

            - `86400` - 24 hours

            - `604800` - 7 days

            - `2419200` - 28 days

            - `15724800` - 6 months
        usage_mode:
          type: boolean
          description: >
            If `true`, query results will return aggregates without correcting
            for sample rates. This is useful for understanding the actual volume
            of data stored rather than the estimated original event counts. By
            default, aggregates are adjusted to reflect the estimated original
            event volume based on sample rates. Note: This field is not
            supported for triggers.
          default: false
    Error:
      x-tags:
        - Errors
      type: object
      description: A legacy error, containing only a textual description.
      properties:
        error:
          type: string
          readOnly: true
    JSONAPIError:
      x-tags:
        - Errors
      type: object
      description: A JSONAPI-formatted error message.
      properties:
        errors:
          type: array
          items:
            type: object
            readOnly: true
            required:
              - id
              - code
            properties:
              id:
                type: string
                readOnly: true
              status:
                type: string
                readOnly: true
              code:
                type: string
                readOnly: true
              title:
                type: string
                readOnly: true
              detail:
                type: string
                readOnly: true
              source:
                type: object
                readOnly: true
                properties:
                  pointer:
                    type: string
                    readOnly: true
                  header:
                    type: string
                    readOnly: true
                  parameter:
                    type: string
                    readOnly: true
    ValidationError:
      x-tags:
        - Errors
      allOf:
        - $ref: '#/components/schemas/DetailedError'
        - type: object
          properties:
            status:
              type: number
              readOnly: true
              default: 422
            type:
              type: string
              readOnly: true
              default: https://api.honeycomb.io/problems/validation-failed
            title:
              type: string
              readOnly: true
              default: The provided input is invalid.
            type_detail:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    readOnly: true
                  code:
                    type: string
                    readOnly: true
                    enum:
                      - invalid
                      - missing
                      - incorrect_type
                      - already_exists
                  description:
                    type: string
                    readOnly: true
    QueryOp:
      type: string
      enum:
        - COUNT
        - CONCURRENCY
        - SUM
        - AVG
        - COUNT_DISTINCT
        - HEATMAP
        - MAX
        - MIN
        - P001
        - P01
        - P05
        - P10
        - P20
        - P25
        - P50
        - P75
        - P80
        - P90
        - P95
        - P99
        - P999
        - RATE_AVG
        - RATE_SUM
        - RATE_MAX
    FilterOp:
      type: string
      enum:
        - '='
        - '!='
        - '>'
        - '>='
        - <
        - <=
        - starts-with
        - does-not-start-with
        - ends-with
        - does-not-end-with
        - exists
        - does-not-exist
        - contains
        - does-not-contain
        - in
        - not-in
    FilterColumn:
      type:
        - 'null'
        - string
    FilterValue:
      anyOf:
        - type: 'null'
        - type: integer
        - type: number
        - type: string
        - type: boolean
        - type: array
    FilterCombination:
      type: string
      default: AND
      enum:
        - AND
        - OR
      description: Set to "OR" to match ANY filter in the filter list
    HavingCalculateOp:
      type: string
      enum:
        - COUNT
        - CONCURRENCY
        - SUM
        - AVG
        - COUNT_DISTINCT
        - MAX
        - MIN
        - P001
        - P01
        - P05
        - P10
        - P20
        - P25
        - P50
        - P75
        - P80
        - P90
        - P95
        - P99
        - P999
        - RATE_AVG
        - RATE_SUM
        - RATE_MAX
    HavingOp:
      type: string
      enum:
        - '='
        - '!='
        - '>'
        - '>='
        - <
        - <=
  responses:
    BadRequest:
      description: The provided request body was invalid.
      headers:
        Ratelimit:
          $ref: '#/components/headers/RateLimit'
        RateLimitPolicy:
          $ref: '#/components/headers/RateLimitPolicy'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/DetailedError'
          examples:
            DetailedError:
              value:
                status: 400
                type: https://api.honeycomb.io/problems/unparseable
                title: The request body could not be parsed.
                error: invalid gzip data
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            GenericError:
              value:
                error: invalid Query data
        application/vnd.api+json:
          schema:
            $ref: '#/components/schemas/JSONAPIError'
          examples:
            JSONAPIError:
              value:
                errors:
                  - id: 06dcdd6508ca822f0e7e2bb4121c1f52
                    code: invalid
                    title: request body could not be parsed
                    detail: invalid gzip data
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            deny-management-apis:
              description: Team cannot access management APIs.
              value:
                error: >-
                  Your team has been denied access to Management APIs, please
                  contact support to be unblocked.
        application/problem+json:
          schema:
            $ref: '#/components/schemas/DetailedError'
        application/vnd.api+json:
          schema:
            $ref: '#/components/schemas/JSONAPIError'
    NotFound:
      description: Not Found
      headers:
        Ratelimit:
          $ref: '#/components/headers/RateLimit'
        RateLimitPolicy:
          $ref: '#/components/headers/RateLimitPolicy'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: dataset not found
        application/problem+json:
          schema:
            $ref: '#/components/schemas/DetailedError'
          example:
            status: 404
            type: https://api.honeycomb.io/problems/not-found
            title: The requested resource cannot be found.
            error: Dataset not found
            detail: Dataset not found
        application/vnd.api+json:
          schema:
            $ref: '#/components/schemas/JSONAPIError'
    ValidationFailed:
      description: Validation Failed
      headers:
        Ratelimit:
          $ref: '#/components/headers/RateLimit'
        RateLimitPolicy:
          $ref: '#/components/headers/RateLimitPolicy'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ValidationError'
          example:
            status: 422
            type: https://api.honeycomb.io/problems/validation-failed
            error: The provided input is invalid.
            title: The provided input is invalid
            type_detail:
              - field: type
                code: invalid
                description: 'type: must be a valid value'
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
        application/vnd.api+json:
          schema:
            $ref: '#/components/schemas/JSONAPIError'
    GenericError:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    RateLimit:
      description: |
        The (draft07) recommended header from the IETF on rate limiting.
        The value of the header is formatted "limit=X, remaining=Y, reset=Z".
        Where:
          - X is the maximum number of requests allowed in the window
          - Y is the number of requests remaining in the window
          - Z is the number of seconds until the limit resets
      schema:
        type: string
      example: limit=100, remaining=50, reset=60
    RateLimitPolicy:
      description: |
        The (draft07) recommended header from the IETF on rate limiting.
        The value of the header is formatted "X;w=Y".
        Where:
         - X is the maximum number of requests allowed in a window
         - Y is the size of the window in seconds
      schema:
        type: string
      example: 100;w=60
  securitySchemes:
    configuration_key:
      type: apiKey
      name: X-Honeycomb-Team
      in: header
      description: >
        A Honeycomb Configuration Key is required to use this API.

        A Configuration Key can be found in the API Keys section of the
        environment configuration,

        which can be found under Environment Settings -> API Keys ->
        Configuration tab.

        Check out our documentation to [find your API
        Keys](https://docs.honeycomb.io/configure/environments/manage-api-keys/#find-api-keys).


        More information can be found in [Manage
        Environments](https://docs.honeycomb.io/configure/environments/manage-api-keys/).

````