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

# Run a saved query



## OpenAPI

````yaml https://openapi.production.reelevant.io/v1/render/statistics post /query/{id}
openapi: 3.0.0
info:
  title: statistics
  version: 1276740a176d654cb1c3e602b6648d22e3bf52a9
  description: >-
    # Errors

    | Error code | Message | HTTP status code | Payload |

    | :--- | :--- | :--- | :--- |

    |
    9000,9001,9002,9003,9004,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017
    | A tag key with this name already exists | 409 | ```{"name":"string"}``` |
servers:
  - url: https://api.reelevant.com/v2/statistics/
    description: production
security: []
paths:
  /query/{id}:
    post:
      tags: []
      summary: Run a saved query
      operationId: run-saved-query
      parameters:
        - name: id
          in: path
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
          required: true
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - success
                    required:
                      - status
                    additionalProperties: false
                  - $ref: '#/components/schemas/InternalResponse_Array_QueryResult'
      security:
        - password_auth: []
components:
  schemas:
    InternalResponse_Array_QueryResult:
      type: object
      properties:
        program:
          type: string
        version:
          type: string
        datetime:
          type: string
        status:
          type: string
        code:
          type: number
        message:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/QueryResult'
      required:
        - program
        - version
        - datetime
        - status
        - message
        - data
      additionalProperties: false
    QueryResult:
      type: object
      properties:
        series:
          type: array
          items:
            $ref: '#/components/schemas/Serie'
          description: |-
            When querying a dimension, we will get 1 serie per dimension value.
            Otherwise, we will have only 1 serie
      required:
        - series
      additionalProperties: false
    Serie:
      type: object
      properties:
        dimensions:
          type: object
          properties: {}
          additionalProperties:
            type: object
            properties:
              id:
                type: string
              value:
                oneOf:
                  - type: string
                  - type: number
                  - type: boolean
                    enum:
                      - 'false'
                  - type: boolean
                    enum:
                      - 'true'
                nullable: true
              metadata:
                type: object
                properties:
                  link:
                    type: string
                    description: |-
                      Some dimension could link to something
                      (e.g. a workflow, an executed branch on a workflow)
                  formattedValue:
                    type: string
                    description: >-
                      Some dimension could be formatted (e.g. an executed
                      branch),

                      it would be the formatted value here
                additionalProperties: false
            required:
              - id
              - value
              - metadata
            additionalProperties: false
          description: |-
            List of each dimension value for the serie per dimension id.
            Could be empty if no dimension was queried
        measures:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              values:
                type: array
                items:
                  type: object
                  properties:
                    date:
                      type: string
                      format: date-time
                    value:
                      type: number
                    metadata:
                      type: object
                      properties:
                        calculation:
                          type: array
                          items:
                            oneOf:
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - number
                                  value:
                                    type: number
                                  unit:
                                    oneOf:
                                      - type: string
                                        enum:
                                          - currency
                                      - type: string
                                        enum:
                                          - percent
                                required:
                                  - type
                                  - value
                                additionalProperties: false
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - scope
                                  value:
                                    oneOf:
                                      - type: string
                                        enum:
                                          - (
                                      - type: string
                                        enum:
                                          - )
                                required:
                                  - type
                                  - value
                                additionalProperties: false
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - operator
                                  value:
                                    oneOf:
                                      - type: string
                                        enum:
                                          - /
                                      - type: string
                                        enum:
                                          - ×
                                      - type: string
                                        enum:
                                          - '-'
                                      - type: string
                                        enum:
                                          - +
                                required:
                                  - type
                                  - value
                                additionalProperties: false
                      additionalProperties: false
                  required:
                    - date
                    - value
                    - metadata
                  additionalProperties: false
                description: >-
                  When sending query with a granularity (for graphs),

                  we would have multiple values for each day/month/hour.

                  Otherwise, we would have only 1 value with date being the
                  start of the date range.
            required:
              - id
              - values
            additionalProperties: false
      required:
        - dimensions
        - measures
      additionalProperties: false
  securitySchemes:
    password_auth:
      type: oauth2
      flows:
        password:
          tokenUrl: https://api.reelevant.com/v1/auth/token
          refreshUrl: https://api.reelevant.com/v1/auth/token
          scopes: {}

````