# Queries

Queries from an extraction. Learn more about queries [here](https://docs.secoda.com/features/queries).

## List Queries

> \> \*\*Warning\*\*: This endpoint is deprecated. Please use the \[List Resources]\(#tag/Resources/paths/\~1resource\~1catalog/get) endpoint instead with \`filter={"operator":"exact","field":"type","value":"query"}\`.<br>

```json
{"openapi":"3.0.0","info":{"title":"Secoda API","version":"8.22.33"},"tags":[{"name":"Queries","description":"Queries from an extraction. Learn more about queries [here](https://docs.secoda.com/features/queries).\n"}],"servers":[{"url":"https://api.secoda.co","description":"Base URL for all US cloud based workspaces"},{"url":"https://eapi.secoda.co","description":"Base URL for all EU cloud based workspaces"},{"url":"https://aapi.secoda.co","description":"Base URL for all APAC cloud based workspaces"},{"url":"https://{customer_domain}.secoda.co","description":"Base URL for On Premise Secoda workspaces","variables":{"customer_domain":{"default":"customer_domain","description":"The specific domain set up for your On Premise Secoda workspace."}}}],"security":[{"ApiKeyAuth":[]}],"paths":{"/api/v1/query/queries":{"get":{"summary":"List Queries","deprecated":true,"description":"> **Warning**: This endpoint is deprecated. Please use the [List Resources](#tag/Resources/paths/~1resource~1catalog/get) endpoint instead with `filter={\"operator\":\"exact\",\"field\":\"type\",\"value\":\"query\"}`.\n","tags":["Queries"],"responses":{"200":{"description":"List of queries.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/v1_ListResponse"},{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/v1_QueryResponse"}}}}]}}}},"400":{"description":"Bad Request"},"500":{"description":"Internal Server Error"}}}}},"components":{"schemas":{"v1_ListResponse":{"type":"object","properties":{"links":{"type":"object","description":"Indicates Links to associated pages.","properties":{"next":{"type":"string","description":"The link to the next page (null if there are no more pages)."},"previous":{"type":"string","description":"The link to the previous page (null if on the first page)."}}},"meta":{"type":"object","description":"Reprents the meta data of the response.","properties":{"page":{"type":"integer","description":"The current page number."},"previous_page":{"type":"integer","description":"The previous page number (null if on the first page)."},"next_page":{"type":"integer","description":"The next page number (null if on the last page)."}}},"count":{"type":"integer","description":"The total count of items returned."},"total_pages":{"type":"integer","description":"The total number of pages."}}},"v1_QueryResponse":{"allOf":[{"$ref":"#/components/schemas/v1_BaseResponse"},{"type":"object","properties":{"type":{"type":"string","description":"Indicates the type of query. Currently this is returned as None."},"freq":{"type":"integer","description":"Represents the frequency with which the query is running. Currently this will be returned as 0."}}}]},"v1_BaseResponse":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the resource."},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the resource was created in Secoda in UTC format."},"updated_at":{"type":"string","format":"date-time","description":"The timestamp when the resource was last updated in Secoda in UTC format."},"entity_type":{"type":"string","description":"The type of resource in Secoda."},"native_type":{"type":"string","description":"The native type of the resource as it is referred to in the integration."},"bookmarked_by":{"type":"array","items":{"type":"string"},"description":"List of member IDs that have bookmarked the resource."},"icon":{"type":"string","description":"The icon associated with the resource."},"title":{"type":"string","description":"The title of the resource."},"title_full":{"type":"string","description":"The full title of the resource, including its ancestry."},"title_cased":{"type":"string","description":"The title in a cased format."},"description":{"type":"string","description":"A description of the resource."},"definition":{"type":"string","format":"markdown","description":"The documentation of the resource, written in Mark Down format."},"definition_version":{"type":"integer","description":"The version of the resource's documentation."},"multiplayers":{"type":"array","items":{"type":"string"},"description":"List of members who have opened or worked with the resource recently."},"multiplayer_last_modified_by":{"type":"string","description":"The last member who modified this resource."},"multiplayer_last_modified":{"type":"string","format":"date-time","description":"The timestamp when the multiplayer was last modified in UTC format."},"owners":{"type":"array","items":{"type":"string"},"description":"List of owner IDs for the resource."},"owners_groups":{"type":"array","items":{"type":"string"},"description":"List of owner group IDs for the resource."},"collections":{"type":"array","items":{"type":"string"},"description":"List of IDs representing the collection(s) that the resource has been added to."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tag IDs added to the resource."},"workspace_id":{"type":"string","description":"The ID of the workspace."},"total_usage":{"type":"integer","description":"The total usage count for the resource."},"published":{"type":"boolean","description":"Indicates if the resource is published and can be seen by Viewers."},"archived":{"type":"boolean","description":"Indicates if the resource is deleted."},"pii":{"type":"boolean","description":"Indicates if the resource contains Personally Identifiable Information (PII). Values can be - <ul> <li> True <li> False</ul>"},"verified":{"type":"boolean","description":"Indicates if the resource is verified. Values can be - <ul><li> True <li> False</ul>"},"url":{"type":"string","description":"The URL associated with the resource."},"parent":{"type":"string","description":"The parent resource's ID."},"children_count":{"type":"integer","description":"The count of children entities of the resource."},"integration":{"type":"string","description":"The integration ID associated with the resource."},"external_updated_at":{"type":"string","format":"date-time","description":"The timestamp of the last update for the resource in the source."},"internal_usage":{"type":"integer","description":"The internal usage count for the resource."},"internal_users":{"type":"array","items":{"type":"string"},"description":"List of internal user IDs for the resource."},"external_users":{"type":"array","items":{"type":"string"},"description":"List of external user IDs for the resource extracted from the integration."},"external_usage":{"type":"integer","description":"The external usage count for the resource extracted from the source source. This is what is used to calculate Popularity of a resource."},"databuilder_id":{"type":"string","description":"The databuilder ID associated with the resource. This is a generated field."},"search_metadata":{"type":"object","description":"Metadata related to indexing the resource for optimizing search."},"sources":{"type":"array","items":{"type":"string"},"description":"List of other integrations associated with the resource. For example, if a description is pulled in from DBT for a Snowflake table, this field will reference DBT."},"subscribers":{"type":"array","items":{"type":"string"},"description":"List of User IDs who subscribe to the resource."},"teams":{"type":"array","items":{"type":"string"},"description":"List of team IDs associated with the resource."},"stale":{"type":"boolean","description":"Indicates if the resource is stale. This means this resource no longer exists in the source, as of the last extraction."},"current_user_permissions":{"type":"object","description":"Permissions of the current user for this resource.","properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"execute":{"type":"boolean"}}}}}}}}
```

## Get Query

> This endpoint allows you to retrieve a query by its unique identifier (query\_id).<br>

```json
{"openapi":"3.0.0","info":{"title":"Secoda API","version":"8.22.33"},"tags":[{"name":"Queries","description":"Queries from an extraction. Learn more about queries [here](https://docs.secoda.com/features/queries).\n"}],"servers":[{"url":"https://api.secoda.co","description":"Base URL for all US cloud based workspaces"},{"url":"https://eapi.secoda.co","description":"Base URL for all EU cloud based workspaces"},{"url":"https://aapi.secoda.co","description":"Base URL for all APAC cloud based workspaces"},{"url":"https://{customer_domain}.secoda.co","description":"Base URL for On Premise Secoda workspaces","variables":{"customer_domain":{"default":"customer_domain","description":"The specific domain set up for your On Premise Secoda workspace."}}}],"security":[{"ApiKeyAuth":[]}],"paths":{"/api/v1/query/queries/{query_id}":{"get":{"summary":"Get Query","description":"This endpoint allows you to retrieve a query by its unique identifier (query_id).\n","tags":["Queries"],"parameters":[{"in":"path","name":"query_id","description":"The unique identifier of the query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Query retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1_QueryResponse"}}}},"404":{"description":"Query not found"},"500":{"description":"Internal Server Error"}}}}},"components":{"schemas":{"v1_QueryResponse":{"allOf":[{"$ref":"#/components/schemas/v1_BaseResponse"},{"type":"object","properties":{"type":{"type":"string","description":"Indicates the type of query. Currently this is returned as None."},"freq":{"type":"integer","description":"Represents the frequency with which the query is running. Currently this will be returned as 0."}}}]},"v1_BaseResponse":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the resource."},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the resource was created in Secoda in UTC format."},"updated_at":{"type":"string","format":"date-time","description":"The timestamp when the resource was last updated in Secoda in UTC format."},"entity_type":{"type":"string","description":"The type of resource in Secoda."},"native_type":{"type":"string","description":"The native type of the resource as it is referred to in the integration."},"bookmarked_by":{"type":"array","items":{"type":"string"},"description":"List of member IDs that have bookmarked the resource."},"icon":{"type":"string","description":"The icon associated with the resource."},"title":{"type":"string","description":"The title of the resource."},"title_full":{"type":"string","description":"The full title of the resource, including its ancestry."},"title_cased":{"type":"string","description":"The title in a cased format."},"description":{"type":"string","description":"A description of the resource."},"definition":{"type":"string","format":"markdown","description":"The documentation of the resource, written in Mark Down format."},"definition_version":{"type":"integer","description":"The version of the resource's documentation."},"multiplayers":{"type":"array","items":{"type":"string"},"description":"List of members who have opened or worked with the resource recently."},"multiplayer_last_modified_by":{"type":"string","description":"The last member who modified this resource."},"multiplayer_last_modified":{"type":"string","format":"date-time","description":"The timestamp when the multiplayer was last modified in UTC format."},"owners":{"type":"array","items":{"type":"string"},"description":"List of owner IDs for the resource."},"owners_groups":{"type":"array","items":{"type":"string"},"description":"List of owner group IDs for the resource."},"collections":{"type":"array","items":{"type":"string"},"description":"List of IDs representing the collection(s) that the resource has been added to."},"tags":{"type":"array","items":{"type":"string"},"description":"List of tag IDs added to the resource."},"workspace_id":{"type":"string","description":"The ID of the workspace."},"total_usage":{"type":"integer","description":"The total usage count for the resource."},"published":{"type":"boolean","description":"Indicates if the resource is published and can be seen by Viewers."},"archived":{"type":"boolean","description":"Indicates if the resource is deleted."},"pii":{"type":"boolean","description":"Indicates if the resource contains Personally Identifiable Information (PII). Values can be - <ul> <li> True <li> False</ul>"},"verified":{"type":"boolean","description":"Indicates if the resource is verified. Values can be - <ul><li> True <li> False</ul>"},"url":{"type":"string","description":"The URL associated with the resource."},"parent":{"type":"string","description":"The parent resource's ID."},"children_count":{"type":"integer","description":"The count of children entities of the resource."},"integration":{"type":"string","description":"The integration ID associated with the resource."},"external_updated_at":{"type":"string","format":"date-time","description":"The timestamp of the last update for the resource in the source."},"internal_usage":{"type":"integer","description":"The internal usage count for the resource."},"internal_users":{"type":"array","items":{"type":"string"},"description":"List of internal user IDs for the resource."},"external_users":{"type":"array","items":{"type":"string"},"description":"List of external user IDs for the resource extracted from the integration."},"external_usage":{"type":"integer","description":"The external usage count for the resource extracted from the source source. This is what is used to calculate Popularity of a resource."},"databuilder_id":{"type":"string","description":"The databuilder ID associated with the resource. This is a generated field."},"search_metadata":{"type":"object","description":"Metadata related to indexing the resource for optimizing search."},"sources":{"type":"array","items":{"type":"string"},"description":"List of other integrations associated with the resource. For example, if a description is pulled in from DBT for a Snowflake table, this field will reference DBT."},"subscribers":{"type":"array","items":{"type":"string"},"description":"List of User IDs who subscribe to the resource."},"teams":{"type":"array","items":{"type":"string"},"description":"List of team IDs associated with the resource."},"stale":{"type":"boolean","description":"Indicates if the resource is stale. This means this resource no longer exists in the source, as of the last extraction."},"current_user_permissions":{"type":"object","description":"Permissions of the current user for this resource.","properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"execute":{"type":"boolean"}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.secoda.co/api/reference/queries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
