# Create document metadata

Creates a new document metadata field for the specified organization.

Endpoint: POST /api/v1/organizations/{organizationId}/document-metadata
Version: v1
Security: Bearer, PersonalAccessToken

## Security:

  - `Bearer` (unknown)
    http bearer JWT

  - `PersonalAccessToken` (unknown)
    apiKey in header Personal-Access-Token

## Path parameters:

  - `organizationId` (string, required)
    Unique identifier of the organization

## Request fields (application/json):

  - `name` (string, required)

  - `options` (array)
    The predefined selectable options. Must be non-empty.

  - `options.value` (string, required)
    The option value.
    Example: Invoice

  - `options.parentId` (string)
    The ID of the parent metadata field's option value this option is tied to, when the field has a parent.
    Example: 048f2e2c-0f48-498b-953d-02d414c60baf

  - `parentId` (string)
    The ID of an existing metadata field of type ListOptionType to set as this field's parent, or omit for no parent. Must not be this field itself or one of its children.

## Request examples:

  - `StringType` (unknown)

  - `NumberType` (unknown)

  - `DateType` (unknown)

  - `ListOptionType` (unknown)

## Response 201:

  - `201` (unknown)
    Created

## Response 201 fields (application/json):

  - `id` (string, required)

  - `options` (array)
    The predefined selectable options.

  - `options.id` (string, required)
    The option ID.
    Example: 048f2e2c-0f48-498b-953d-02d414c60baf

  - `options.value` (string, required)
    The option value.
    Example: Invoice

  - `options.parentId` (string)
    The ID of the parent metadata field's option value this option is tied to, when the field has a parent.
    Example: 048f2e2c-0f48-498b-953d-02d414c60baf

  - `parentId` (string)
    The ID of the parent metadata field this field depends on, when defined.

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `errors` (array, required)

  - `errors.errorId` (string, required)

  - `errors.field` (string)

  - `errors.message` (any, required)

  - `errors.messageEn` (any, required)

  - `errors.additionalData` (object)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `errors` (array, required)

  - `errors.errorId` (string, required)

  - `errors.field` (string)

  - `errors.message` (any, required)

  - `errors.messageEn` (any, required)

  - `errors.additionalData` (object)

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `errors` (array, required)

  - `errors.errorId` (string, required)

  - `errors.field` (string)

  - `errors.message` (any, required)

  - `errors.messageEn` (any, required)

  - `errors.additionalData` (object)

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `errors` (array, required)

  - `errors.errorId` (string, required)

  - `errors.field` (string)

  - `errors.message` (any, required)

  - `errors.messageEn` (any, required)

  - `errors.additionalData` (object)

## Response 422:

  - `422` (unknown)
    Unprocessable Content

## Response 422 fields (application/json):

  - `errors` (array, required)

  - `errors.errorId` (string, required)

  - `errors.field` (string)

  - `errors.message` (any, required)

  - `errors.messageEn` (any, required)

  - `errors.additionalData` (object)

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `errors` (array, required)

  - `errors.errorId` (string, required)

  - `errors.field` (string)

  - `errors.message` (any, required)

  - `errors.messageEn` (any, required)

  - `errors.additionalData` (object)

