---
title: "Get COMPOSITION"
method: GET
path: "/ehr/{ehr_id}/composition/{uid_based_id}"
tags: ["COMPOSITION"]
---

# Get COMPOSITION

`GET /ehr/{ehr_id}/composition/{uid_based_id}`

Retrieves a version of the COMPOSITION identified by `uid_based_id` and associated with the EHR identified by `ehr_id`.

The `uid_based_id` can take a form of an OBJECT_VERSION_ID identifier taken from VERSION.uid.value (i.e. a `version_uid`), or a form of a HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a `versioned_object_uid`).
The former is used to retrieve a specific known version of the COMPOSITION (e.g. one identified by `8849182c-82ad-4088-a07f-48ead4180515::openEHRSys.example.com::1`), whereas the latter (e.g. an identifier like `8849182c-82ad-4088-a07f-48ead4180515`) is be used to retrieve a version from the version container whenever the _version_tree_id_ is unknown or irrelevant (such as when most recent version is requested).

When the `uid_based_id` has the form of a HIER_OBJECT_ID, if the `version_at_time` is supplied, retrieves the version extant _at specified time_, otherwise retrieves the _latest_ COMPOSITION version.

See [Resource identification](overview.html#tag/Resources/Resource-identification) for more details about the identifiers usage and meaning.

When there are ITEM_TAGs associated with the retrieved COMPOSITION, they will be returned as `openehr-item-tag` and `openehr-version-item-tag` response headers, respectively - see [item tags headers](overview.html#tag/Requests_and_responses/HTTP-headers/openehr-item-tag-and-openehr-version-item-tag) for more details.

## Path parameters

- `ehr_id` string, uuid, required
- `uid_based_id` string, required

## Query parameters

- `version_at_time` string, datetime

## Headers

- `Accept` 'application/json' | 'application/xml' | 'application/openehr.wt.flat+json' | 'application/openehr.wt.structured+json'

## Response `200`

`200 OK` is returned when the requested COMPOSITION is successfully retrieved.

- Composition
  - `_type` string

## Other responses

- `204` — `204 No Content` is returned when the resource identified by the request parameters (at specified `version_at_time`) time has been deleted.
- `404` — `404 Not Found` is returned when an EHR with `ehr_id` does not exist, or when a version of the resource identified by the request parameters (at specified `version_at_time`) does not exist.

---

[API](https://skmtc.net/openehr/apis/ehr-api.md) · [All operations](https://skmtc.net/openehr/apis/ehr-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openehr/ehr-api/versions/a0e37a217524/schema)
