# Finding QC Flags in Aggregate QC (Library Validation) via REST API

When running the Aggregate QC step in Clarity LIMS, the QC pass and fail flags for the samples display in the Record Details screen.

This section explains how to use the API instead to find the samples that passed or failed QC aggregation.

Query the API and filter the results list based on the qc-flag parameter value. For more on filtering, see [*Filtering List Resources*](/clarity-lims/api-and-database/api-docs/rest/filtering-list-resources.md) section.

* To filter the list by QC flag with a value of PASSED, use the following example:

  ```
  http[s]://<hostname/IP address>:<port>/api/<version of api>/artifacts?qc-flag=PASSED 
  ```
* To find an individual QC flag result for an individual sample, use the LIMS ID of the sample:\\

  ```
  http[s]://<hostname/IP address>:<port>/api/<version of api>/artifacts/<analyte
      artifact lims id>
  ```
* Then search for the value of the element of the endpoint payload for the artifact.

The \<qc-flag> element of the input analyte (sample) artifact is sent into the Aggregate QC step.

To demonstrate this detail, review the following steps:

1. In the API, find a single analyte artifact (derived sample) that has passed QC. The XML QC flag value is PASSED.
2. In Clarity LIMS, find the same sample and change the value of the element from PASSED to FAILED. Save the change.
3. In the API, find the sample again. See that the XML QC flag value is set to FAILED.


---

# 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://help.connected.illumina.com/clarity-lims/api-and-database/api-docs/tips-and-tricks/finding-qc-flags-in-aggregate-qc-library-validation-via-rest-api.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.
