---
title: "Perform a ValueSet expansion"
method: POST
path: "/ValueSet/"
---

# Perform a ValueSet expansion

`POST /ValueSet/`

## Overview
To retrieve a subset of records from an individual CodeSystem, you will need to perform a 'POST' operation, in which you will provide the details of the CodeSystem you are searching, along with any filters to be applied and properties you wish to include in the results.

When you make a 'POST' operation, you perform an expansion on a ValueSet and provide a requestBody. The endpoint will return a successful (200) response code along with the search results, which may be an empty array if no records match your criteria. or an unsuccesful (4xx/5xx) response.

For example:

  `/ValueSet/$expand`
  
in the example request body below we filter on lastChangeDate and limit the response to 2 records with `count`.
searches which generate more than 50,000 results will generate an error, so we recommend that you use count and offset together to ensure you have collected all the required results.

## Response `200`

a valid

## Other responses

- `4XX` — An error occurred as follows: | HTTP Code | issue.severity | issue.code | issue.details.code | issue.details.display | |------------ |----------------|---------------|---------------------|--------------------- | |400 |error |invalid |HAPI-1940 |Invalid Date/Time/Quantity format | |400 |error |invalid |HAPI-0524 |Unknown Search Parameter| |404 |error |invalid |HAPI-2001 |Organization not found | |405 |error |method not allowed|HAPI-0427 |Method Not Allowed | |422 |unprocessable |too-costly |Too many records requested (Use _count and _offset)|Invalid parameter | |422 |unprocessable |processing |No declared filter on Codesystem |An input field has an invalid value for its type |

---

[API](https://skmtc.net/nhs/apis/organisation-data-terminology-api-2.md) · [All operations](https://skmtc.net/nhs/apis/organisation-data-terminology-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nhs/organisation-data-terminology-api-2/versions/c2df8e70fcf4/schema)
