> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Query a DataSet

> Queries the data in an existing Domo DataSet



## OpenAPI

````yaml /openapi/platform/dataset.yaml POST /v1/datasets/query/execute/{dataset_id}
openapi: 3.0.0
info:
  title: DataSet API
  description: >
    ## The DataSet Object


    ---


    The DataSet API allows you to create, replace, append to, export, and manage
    DataSets, as well as manage data permissions for DataSets within Domo. Most
    of its calls return a DataSet object.



    <!-- theme: info -->


    > #### Best Practice

    >

    > The DataSet API should be used to create and update small DataSets that
    occasionally need their data updated. For creating and updating massive,
    constantly changing, or rapidly growing DataSets, the Stream API is
    recommended.


    <!-- theme: info -->


    > #### Permissions

    >

    > To update or write to a DataSet via API, you must have the Manage DataSet
    grant enabled.


    ### Attributes


    | Property Name | Type | Description |

    | --- | --- | --- |

    | id | String | ID of the DataSet |

    | name | String | Name of the DataSet |

    | description | String | Description of DataSet |

    | owner.id | String | ID of the owner |

    | owner.name | String | Name of the owner |

    | columns | Number | The number of columns currently in the DataSet |

    | createdAt | String | An ISO-8601 representation of the creation date of
    the DataSet |

    | updatedAt | String | AN ISO-8601 representation of the time the DataSet
    was last updated |

    | dataCurrentAt | String | An ISO-8601 representation of the time the
    DataSet was current |

    | schema | Object | The current schema associated with this DataSet |

    | schema.columns | Array | Array of columns in the DataSet |

    | schema.columns\[\].name | String | Column name in the DataSet schema |

    | schema.columns\[\].type | String | Column type in the DataSet schema.
    Valid types are STRING, DECIMAL, LONG, DOUBLE, DATE, DATETIME. |

    | pdpEnabled | Boolean | Indicates if PDP \[Personalized Data Permission\]
    policy filtering on data is active on this DataSet |

    | policies | Array | List of policies attached to DataSet |

    | policies\[\].filters\[\].column | String | Name of the column to filter on
    |

    | policies\[\].filters\[\].not | Boolean | Determines if NOT is applied to
    the filter operation |

    | policies\[\].filters\[\].operator | String | Matching operator (EQUALS) |

    | policies\[\].filters\[\].values\[\] | String | Values to filter on |

    | policies\[\].groups | Array | List of group IDs the policy applies to |

    | policies\[\].id | Number | ID of the Policy |

    | policies\[\].name | String | Name of the Policy |

    | policies\[\].type | String | Type of policy (user or system) |

    | policies\[\].users | Array | List of user IDs the policy applies to |

    | rows | Number | The number of rows currently in the DataSet |
  version: 1.0.0
servers:
  - url: https://api.domo.com
    description: Domo API
security:
  - bearerAuth: []
paths:
  /v1/datasets/query/execute/{dataset_id}:
    post:
      summary: Query a DataSet
      description: Queries the data in an existing Domo DataSet
      parameters:
        - name: dataset_id
          in: path
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-examples:
                Example 1:
                  sql: SELECT * FROM table
              properties:
                sql:
                  type: string
              required:
                - sql
            examples:
              Example 1:
                value:
                  sql: SELECT * FROM table
        description: ''
      responses:
        '200':
          description: Returns data from the DataSet based on your SQL query.
          content:
            application/json:
              schema:
                type: object
                properties:
                  datasource:
                    type: string
                  columns:
                    type: array
                    items:
                      type: string
                  metadata:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        dataSourceId:
                          type: string
                        maxLength:
                          type: integer
                        minLength:
                          type: integer
                        periodIndex:
                          type: integer
                  rows:
                    type: array
                    items:
                      type: string
                  numRows:
                    type: integer
                  numColumns:
                    type: integer
                  fromcache:
                    type: boolean
                x-examples:
                  Example 1:
                    datasource: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                    columns:
                      - Description
                      - '% of Inventory Value'
                      - Cost
                      - Total Inventory Value
                      - _BATCH_ID_
                      - _BATCH_LAST_RUN_
                    metadata:
                      - type: STRING
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: DOUBLE
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: LONG
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: LONG
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: DOUBLE
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: DATETIME
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                    rows:
                      - - Maintenance
                        - 0.0035
                        - 35000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                      - - Labor
                        - 0.007
                        - 70000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                      - - Utilities
                        - 0.0087
                        - 87000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                      - - Space
                        - 0.025
                        - 250000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                    numRows: 4
                    numColumns: 6
                    fromcache: true
              examples:
                Example 1:
                  value:
                    datasource: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                    columns:
                      - Description
                      - '% of Inventory Value'
                      - Cost
                      - Total Inventory Value
                      - _BATCH_ID_
                      - _BATCH_LAST_RUN_
                    metadata:
                      - type: STRING
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: DOUBLE
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: LONG
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: LONG
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: DOUBLE
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                      - type: DATETIME
                        dataSourceId: ce79d23f-ef7d-4318-9787-ebde54a8c5b4
                        maxLength: -1
                        minLength: -1
                        periodIndex: 0
                    rows:
                      - - Maintenance
                        - 0.0035
                        - 35000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                      - - Labor
                        - 0.007
                        - 70000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                      - - Utilities
                        - 0.0087
                        - 87000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                      - - Space
                        - 0.025
                        - 250000
                        - 10000000
                        - 410
                        - '2019-03-19T18:49:02'
                    numRows: 4
                    numColumns: 6
                    fromcache: true
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````