---
title: "Add metadata value to document"
method: POST
path: "/documents/{document}/metadata-values"
tags: ["Document Operations"]
---

# Add metadata value to document

`POST /documents/{document}/metadata-values`

<small>Requires an API token with the **Document Manager** role.</small>

Adds a [metadata](/#metadata) field to a [document](/#documents) and optionally sets its value.

> Alternatively: if your use case involves setting values for multiple metadata fields, and you have all the new
> values available at once, the [bulk update metadata values](/operations/v1.documents.metadata-values.bulk-update)
> request is likely to be a better fit.

## Value format

The content of the `value` parameter depends on the `value_type` of the metadata. The table below lists the
available types and shows how values of each type should be sent.

| Descriptive name | API `type` | Example values | Description |
|------------------|------------|----------------|-------------|
| Email | `email` | `"user@example.com"` | An email address. |
| Number | `number` | `1234.56` | A numeric value. |
| Currency | `currency` | `"EUR;1234.56"`, `"EUR;1234"` | A string containing a currency code and numeric value concatenated with a semicolon. |
| Currency over time | `currency_duration` | `"EUR;1234.56;monthly"`, `"EUR;123456;yearly"` | A string containing a currency code, numeric value and period (one of `monthly` or `yearly`) concatenated with a semicolon. |
| Select | `select` | `"Blue"` | One of the values from the field's `select_values` list. |
| Multi-select | `multi_select` | `["Red","Blue"]` | Array containing one or more values from the field's `select_values` list. |
| Date | `date` | `"2025-12-31"` | A date in the format "YYYY-MM-DD". |
| Yes / No | `bool` | `true`, `false` | A boolean value. |
| Duration | `duration` | `"P6D"` (6 days), `"P2W"` (2 weeks), `"PT12H"` (12 hours) | A string containing a [duration specification](https://www.php.net/manual/en/dateinterval.construct.php). |
| Text | `text` | `"Vienna"` | Up to 4096 characters of text. |
| Multi-line text | `textarea` | `"Dublin"` | Up to 4096 characters of text. |
| Timestamp | `timestamp` | `"2025-06-02T14:30:00+00:00"` | A date/time value. |
| Clause | `clause` | `true`, `false` | Indicates presence of a particular clause in the document. |

## Path parameters

- `document` string, required

## Request body

- object
  - `metadata_uuid` string — UUID of the metadata to add a value for
  - `value` union — The new value for the field
    - unknown[]
      - unknown
    - boolean
    - string

## Response `201`

`MetadataValueResource`

- object
  - `data` MetadataValueResource, required
    - `uuid` string, required
    - `metadata` MetadataResource, required
      - `uuid` string, required
      - `type` 'system_autofilled' | 'system_computed' | 'system' | 'system_reference' | 'account', required
      - `value_type` 'id' | 'uuid' | 'bool' | 'date' | 'duration' | 'email' | 'list' | 'number' | 'currency' | 'currency_duration' | 'clause' | 'select' | 'multi_select' | 'text' | 'textarea' | 'timestamp' | 'array' | 'enum', required
      - `name` string, required
      - `display_name` string, required
      - `settings` MultiFieldSettingsResource, required
        - `currencies` string[], required — For `currency` or `currency_duration` fields, defines the currencies that can be assigned to the field's values
      - `select_values` string[], nullable, required — When `value_type` is `select`, defines the possible values for the metadata's value
      - `always_exists` boolean, required
      - `description` string, nullable, required
      - `keywords` string, nullable, required — Keywords to help with metadata identification.
      - `prompt` string, nullable, required — An AI prompt used for metadata extraction.
      - `is_contract_value` boolean, required — If true, this metadata will be included in the calculated "contract value" if it is present in a document. Only relevant when the value type is one of: `currency`, `currency_duration`
      - `relevant_document_type_uuids` string[], nullable, required — UUIDs of document types this metadata is relevant for. `null` means not relevant to any. `[]` means relevant to all.
    - `reference_dynamic_field_uuid` string, nullable, required
    - `value_source` 'user' | 'ai_analysis' | 'computed' | 'autofilled' | 'dynamic_field' | 'linked_document', required
    - `value` union, required — The metadata's value
      - string
      - boolean
      - unknown[]
        - unknown
    - `value_currency_monthly` string, nullable, required
    - `value_currency_yearly` string, nullable, required
    - `computed_status` 'missing_information' | 'conflicting_information' | 'not_applicable' | 'computed', required
    - `computed_value` union, required
      - string
      - boolean
      - unknown[]
        - unknown
    - `is_attached` boolean, required
    - `computed_at` string, date-time, nullable, required

## Other responses

- `401` — Unauthenticated
- `403` — Authorization error
- `404` — Not found
- `422` — Validation error

---

[API](https://skmtc.dev/fynk/apis/fynk-api-reference.md) · [All operations](https://skmtc.dev/fynk/apis/fynk-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fynk/fynk-api-reference/revisions/9657a6757f59/schema)
