# openEHR Query API

**Canonical:** https://apis.io/apis/openehr/openehr-query-api/  
**Provider:** openEHR — https://apis.io/providers/openehr/  
**Documentation:** https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html

openEHR Query API is one of 16 APIs that [openEHR](https://apis.io/providers/openehr/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. This API exposes 2 JSON Schema definitions. Tagged areas include Query. The published artifact set on APIs.io includes an OpenAPI specification and 2 JSON Schemas.

Management of stored (registered) queries in the system, including creation of new versions and retrieval by qualified name and version. These endpoints enable registration and lifecycle management of reusable queries available for later execution. Stored queries are identified by their [qualified name and version](query.html#tag/Qualified_query_name). They can be executed using the [query endpoint](query.html#tag/Query/operation/query_execute_stored_query_body).

## Operations (10)

| Method | Path | Summary |
|---|---|---|
| GET | `/definition/query/{qualified_query_name}` | List stored queries |
| PUT | `/definition/query/{qualified_query_name}` | Store a query |
| PUT | `/definition/query/{qualified_query_name}/{version}` | Store a query version |
| GET | `/definition/query/{qualified_query_name}/{version}` | Get stored query at version |
| GET | `/query/aql` | Execute ad-hoc AQL |
| POST | `/query/aql` | Execute ad-hoc AQL (POST) |
| GET | `/query/{qualified_query_name}` | Execute stored AQL |
| POST | `/query/{qualified_query_name}` | Execute stored AQL (POST) |
| GET | `/query/{qualified_query_name}/{version}` | Execute stored AQL version |
| POST | `/query/{qualified_query_name}/{version}` | Execute stored AQL version (POST) |

## Machine-readable artifacts (15)

- **OpenAPI** — https://raw.githubusercontent.com/api-evangelist/openehr/refs/heads/main/openapi/openehr-query-api-openapi.yml
- **Specification** — https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html
- **SourceCode** — https://github.com/openEHR/specifications-ITS-REST/blob/master/computable/OAS/ehr-validation.openapi.yaml
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/openehr/refs/heads/main/json-schema/openehr-rm-1.1.0-all.json
- **JSONSchema** — https://specifications.openehr.org/releases/ITS-JSON/latest/components/openehr_rm_1.1.0_all.json
- **Specification** — https://specifications.openehr.org/releases/ITS-REST/latest/query.html
- **SourceCode** — https://github.com/openEHR/specifications-ITS-REST/blob/master/computable/OAS/query-validation.openapi.yaml
- **Specification** — https://specifications.openehr.org/releases/ITS-REST/latest/definition.html
- **SourceCode** — https://github.com/openEHR/specifications-ITS-REST/blob/master/computable/OAS/definition-validation.openapi.yaml
- **Specification** — https://specifications.openehr.org/releases/ITS-REST/latest/overview.html
- **SourceCode** — https://github.com/openEHR/specifications-ITS-REST/blob/master/computable/OAS/system-validation.openapi.yaml
- **Specification** — https://specifications.openehr.org/releases/ITS-REST/latest/demographic.html
- **SourceCode** — https://github.com/openEHR/specifications-ITS-REST/blob/master/computable/OAS/demographic-validation.openapi.yaml
- **Specification** — https://specifications.openehr.org/releases/ITS-REST/latest/admin.html
- **SourceCode** — https://github.com/openEHR/specifications-ITS-REST/blob/master/computable/OAS/admin-validation.openapi.yaml

## Other openEHR APIs (12)

- [openEHR ADL1.4 API](https://apis.io/apis/openehr/openehr-adl1-4-api/)
- [openEHR ADL2 API](https://apis.io/apis/openehr/openehr-adl2-api/)
- [openEHR AGENT API](https://apis.io/apis/openehr/openehr-agent-api/)
- [openEHR COMPOSITION API](https://apis.io/apis/openehr/openehr-composition-api/)
- [openEHR CONTRIBUTION API](https://apis.io/apis/openehr/openehr-contribution-api/)
- [openEHR DIRECTORY API](https://apis.io/apis/openehr/openehr-directory-api/)
- [openEHR EHR API](https://apis.io/apis/openehr/openehr-ehr-api/)
- [openEHR EHR STATUS API](https://apis.io/apis/openehr/openehr-ehr-status-api/)
- [openEHR GROUP API](https://apis.io/apis/openehr/openehr-group-api/)
- [openEHR ITEM TAG API](https://apis.io/apis/openehr/openehr-item-tag-api/)
- [openEHR Options API](https://apis.io/apis/openehr/openehr-options-api/)
- [openEHR ORGANISATION API](https://apis.io/apis/openehr/openehr-organisation-api/)

## Tags

Query

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/openehr/openehr-query-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/openehr/.
