> ## Documentation Index
> Fetch the complete documentation index at: https://docs.frankieone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Key Value Pairs

> While our APIs aim to provide dedicated named attributes for most data points, some data requires more flexibility. For these cases, we use **Key-Value Pairs (KVPs)** - an array of additional data that allows for dynamic attribute storage.

<Info>
  These KVPs are "loosely typed" - all values are stored as strings, though you
  can specify a type to provide usage hints. Note that type specifications are
  generally not strictly enforced.
</Info>

## Understanding KVP Types

KVP types help describe the data content and its intended use. Here's what you need to know about the different categories:

<AccordionGroup>
  <Accordion title="Basic Types">
    * `general.*` - For common data types (string, integer, float, etc.)
    * `raw.*` - For storing binary or unprocessed data (Base64 encoded)
  </Accordion>

  {" "}

  <Accordion title="Identifier Types">
    * `id.*` - For data that can be used to create document objects/entities
    * `id.external` - For capturing external service IDs (searchable in the index)

    <Callout icon="thumbtack" color="#1A6CFF" iconType="regular">
      `id.external` is distinct from `result.id`. When attached to an entity's
      extraData KVP array, `id.external` values become searchable via the /search
      API.
    </Callout>
  </Accordion>

  <Accordion title="Special Purpose Types">
    * `defunct` - Marks deleted KVPs where value retention is required
    * `result.*` - Captures external service responses and transaction IDs
    * `error.*` - Handles non-critical error information
    * `transient.*` - Temporary values that exist only during the initial service call
  </Accordion>
</AccordionGroup>

## Complete Type Reference

<Tabs>
  <Tab title="Basic Types">
    ```plaintext theme={null}
      - defunct 
      - general.string 
      - general.integer 
      - general.float 
      - general.bool 
      - general.date 
      - general.datetime 
    ```
  </Tab>

  <Tab title="Raw Data Types">
    ```plaintext theme={null}
    - raw.json.base64 
    - raw.xml.base64 
    - raw.base64 
    ```
  </Tab>

  <Tab title="Result & Error Types">
    ```plaintext theme={null}
    - error.code 
    - error.message 
    - result.code 
    - result.id 
    ```
  </Tab>

  <Tab title="ID Types">
    ```plaintext theme={null}
    - id.external 
    - id.number.primary 
    - id.number.additional 
    - id.msisdn 
    - id.email 
    - id.device 
    ```
  </Tab>

  <Tab title="PII Types">
    ```plaintext theme={null}
    - pii.name.full 
    - pii.name.familyname 
    - pii.name.givenname 
    - pii.name.middlename 
    - pii.gender 
    - pii.dob 
    ```
  </Tab>

  <Tab title="Address Types">
    ```plaintext theme={null}
    - pii.address.longform
    - pii.address.street1 
    - pii.address.street2 
    - pii.address.postalcode 
    - pii.address.town 
    - pii.address.suburb 
    - pii.address.region 
    - pii.address.state - pii.address.country 
    ```
  </Tab>
</Tabs>

<Callout icon="star" color="#3DD892" iconType="regular">
  ##### Best Practice

  When working with sensitive data that needs to be used only once, consider
  using `transient.*` types. These values are processed during the initial call
  but aren't persisted in storage.
</Callout>
