> For the complete documentation index, see [llms.txt](https://simprints.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simprints.gitbook.io/docs/development/simprints-for-developers/integrating-with-simprints/metadata.md).

# Metadata

### What is Metadata?

Metadata is any added information that you would like **Simprints ID** to capture alongside the biometrics. It is really helpful to capture **metadata** collecting important metrics for your project. The **metadata** is stored as a [JSON](https://www.json.org/json-en.html) string of key-value pairs, and **Simprints ID's Metadata** class only supports values of **Double**, **Long, Boolean,** and **String**.

### Using Metadata

To create the metadata you intend to use for your app, you can create an Instance of the **Metadata** class and pass your **key-value** pairs using the **put** method:

```kotlin

// Note: This is the recommended approach, in order to avoid Invalid_JSON errors.
// create an instance of Metadata and attach the key-value pairs using 'put'
val metadata = Metadata()
    .put("identificationReason", "postnatal care visit")
    .put("childPresent", true)
    .put("childAge", 3)

// pass the Metadata object to the request data
simprintsLauncher.launch(SimprintsRequest.Enrol(
  projectId = "Project ID", 
  userId = "User ID",
  moduleId = "Module ID",
  metadata = metadata,
))

```

### Invalid JSON object

The Metadata class will throw an exception for two reasons:

* The JSON String is not a valid JSON object
* The JSON object contains parameters that are invalid for Simprints, such as a dictionary or array.

```json
// Invalid JSON string: arrays are not allowed
{
    "identificationReason": "postnatal care visit",
    "childPresent": true,
    "required": [        // Dictionaries and arrays are not allowed 
        "firstName", 
        "lastName"
    ]
}
```

### Subject Age metadata parameter

For projects that have age restrictions (e.g. only work with subjects between 9 and 60 months old) **Simprints ID** will expect the subject's age to be passed along in the **Metadata** for Enrollment and Verification callouts. The name of the parameter is **subjectAge**, it should be of type **Long** and contain the subject's age **in months**:

```kotlin
val metadata = Metadata().put("subjectAge", 30) // subject is 30 months old
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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 following URL with the `ask` and `goal` query parameters:

```
GET https://simprints.gitbook.io/docs/development/simprints-for-developers/integrating-with-simprints/metadata.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
