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

# List Metadata Schemas

> Lists all metadata schemas available in the project.

> 📘 Metadata Documentation
>
> Read [the Getting Started with Metadata](/prepare/metadata) and [Metadata Mapping](/guides/metadata-mapping) articles to learn how metadata work in Voucherify.



## OpenAPI

````yaml /openapi/management.json get /management/v1/projects/{projectId}/metadata-schemas
openapi: 3.0.1
info:
  title: Voucherify API - Management
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /management/v1/projects/{projectId}/metadata-schemas:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterProjectId'
        in: path
        name: projectId
        description: Provide the unique identifier of the project.
        required: true
    get:
      tags:
        - Management
      summary: List Metadata Schemas
      description: >-
        Lists all metadata schemas available in the project.


        > 📘 Metadata Documentation

        >

        > Read [the Getting Started with Metadata](/prepare/metadata) and
        [Metadata Mapping](/guides/metadata-mapping) articles to learn how
        metadata work in Voucherify.
      operationId: list-metadata-schemas-1
      parameters: []
      responses:
        '200':
          description: >-
            Returns the details about the metadata schemas created in the
            project.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ManagementProjectsMetadataSchemasListResponseBody
              examples:
                Example:
                  value:
                    object: list
                    data_ref: data
                    data:
                      - id: ms_bwBVnq2YHcbsfCMfdqfCi4zl
                        related_object: Test-MANAPI-custom-schema-01
                        properties:
                          Test-manAPI-01:
                            type: string
                            array: false
                            optional: true
                            object_type: null
                            eq:
                              - Test-01
                              - Test-02
                              - Test-03
                              - Test-04
                          Test-manAPI-02:
                            type: number
                            array: false
                            optional: true
                            object_type: null
                            eq:
                              - 1
                              - 2
                              - 3
                              - 4
                          Test-manAPI-03:
                            type: object
                            array: false
                            optional: true
                            object_type: unknown
                          Test-manAPI-04:
                            type: string
                            array: true
                            optional: true
                            object_type: null
                            eq:
                              - Value-01
                              - Value-02
                              - Value-03
                        allow_defined_only: true
                        created_at: '2024-04-18T17:24:46.980Z'
                        updated_at: '2024-04-18T18:17:20.108Z'
                        object: metadata_schema
                      - id: ms_ctw7O05ZLsMb1zFCGMRQ8qnP
                        related_object: campaign
                        properties:
                          Test-manAPI:
                            type: string
                            array: true
                            optional: true
                            object_type: null
                            eq:
                              - Test1
                              - Test2
                              - Test3
                            max_length: 5
                            min_length: 2
                          Test-manAPI-08:
                            type: number
                            array: false
                            optional: true
                            object_type: null
                            eq:
                              - 105.5
                            lt: 9.5
                            lte: 10.5
                          Test-manAPI-09:
                            type: object
                            array: true
                            optional: false
                            object_type: Test-MANAPI-custom-schema-01
                            deleted: true
                        allow_defined_only: false
                        created_at: '2024-04-18T17:21:13.555Z'
                        updated_at: '2024-04-19T06:43:09.218Z'
                        object: metadata_schema
                      - id: ms_f0r4hm3ta6a4a5ch3ma
                        related_object: customer
                        properties:
                          age:
                            type: number
                            array: false
                            optional: true
                            object_type: null
                          Test-MANAPI-06:
                            type: string
                            array: true
                            optional: true
                            object_type: null
                            eq:
                              - Class-01,
                              - Class-02
                              - Class-03
                          Test-manAPI-07:
                            type: string
                            array: false
                            optional: true
                            object_type: null
                            eq:
                              - Tick
                              - Tack
                              - Toe
                          acquisition_channel:
                            type: string
                            array: false
                            optional: true
                            object_type: null
                            eq:
                              - Portal-01
                              - Portal-02
                              - Portal-03
                          customer_life_time_value:
                            type: number
                            array: false
                            optional: true
                            object_type: null
                        allow_defined_only: false
                        created_at: '2023-08-03T10:37:48.696Z'
                        updated_at: '2024-04-18T18:23:58.380Z'
                        object: metadata_schema
                      - id: ms_f1r5Tm3ta6a4a5ch3ma
                        related_object: order
                        properties:
                          region:
                            type: string
                            array: false
                            optional: true
                            object_type: null
                            eq:
                              - EU
                              - US
                              - EMEA
                              - APAC
                          location_id:
                            type: string
                            array: true
                            optional: true
                            object_type: null
                            eq:
                              - L1
                              - L2
                              - L3
                          payment_mean:
                            type: string
                            array: true
                            optional: true
                            object_type: null
                            eq:
                              - credit-card
                              - wire-transfer
                              - paypal
                          booking_end_date:
                            type: datetime
                            array: false
                            optional: true
                            object_type: null
                          booking_start_date:
                            type: datetime
                            array: false
                            optional: true
                            object_type: null
                        allow_defined_only: false
                        created_at: '2023-08-03T10:37:48.662Z'
                        updated_at: '2023-08-28T11:24:43.518Z'
                        object: metadata_schema
                      - id: ms_s3c0N6m3ta6a4a5ch3ma
                        related_object: product
                        properties:
                          brand:
                            type: string
                            array: false
                            optional: true
                            object_type: null
                          vendor:
                            type: string
                            array: false
                            optional: true
                            object_type: null
                          category:
                            type: string
                            array: false
                            optional: true
                            object_type: null
                        allow_defined_only: false
                        created_at: '2023-08-03T10:37:48.670Z'
                        updated_at: '2023-09-14T09:30:26.314Z'
                        object: metadata_schema
                      - id: ms_t4ir0Dm3ta6a4a5ch3ma
                        related_object: redemption
                        properties:
                          location_id:
                            type: string
                            array: true
                            optional: true
                            object_type: null
                            eq:
                              - L1
                              - L2
                              - L3
                        allow_defined_only: null
                        created_at: '2023-08-03T10:37:48.692Z'
                        updated_at: null
                        object: metadata_schema
                    total: 6
        '401':
          description: Returns an error if an invalid token was provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Unauthorized:
                  value:
                    code: 401
                    message: Unauthorized
                    key: unauthorized
        '402':
          description: >-
            Returns an error if the current plan does not include the Management
            API feature.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorPaymentRequired'
              examples:
                Example:
                  value:
                    code: 402
                    message: Payment required
                    details: >-
                      Your current plan does not include a feature required to
                      perform this operation.
                    key: missing_required_feature
        '404':
          description: Returns an error when a resource could not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Resource not found:
                  value:
                    code: 404
                    message: Resource not found
                    details: Cannot find project with id proj_5itvDU7
      security:
        - X-Management-Id: []
          X-Management-Token: []
components:
  schemas:
    ParameterProjectId:
      type: string
      example: proj_TrlkLiH4
    ManagementProjectsMetadataSchemasListResponseBody:
      type: object
      description: Object containing a list of metadata schemas.
      properties:
        object:
          type: string
          default: list
          description: >-
            The type of the object represented by JSON. This object stores
            information about the metadata schemas in a dictionary.
          enum:
            - list
        data_ref:
          type: string
          default: data
          description: >-
            Identifies the name of the attribute that contains the array of
            metadata schema objects.
          enum:
            - data
        data:
          type: array
          description: >-
            Array of metadata schema objects. The metadata schemas are listed by
            related object properties.
          items:
            $ref: '#/components/schemas/ManagementProjectsMetadataSchema'
        total:
          type: integer
          description: The total number of metadata schema objects.
      required:
        - object
        - data_ref
        - data
        - total
    Error:
      title: Error Object
      type: object
      description: Error details
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a885062c80375740f
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
        resource_id:
          type: string
          description: >-
            Unique resource ID that can be used in another endpoint to get more
            details.
          example: rf_0c5d710a87c8a31f86
        resource_type:
          type: string
          description: The resource type.
          example: voucher
        error:
          type: object
          description: Includes additional information about the error.
          properties:
            message:
              type: string
              description: The message configured by the user in a validation rule.
      required:
        - code
        - message
    ErrorPaymentRequired:
      title: Payment Required Error
      type: object
      description: 'Error: Payment required - the current plan does not include the feature.'
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
      required:
        - code
        - message
        - details
        - key
    ManagementProjectsMetadataSchema:
      type: object
      description: Object representing a metadata schema.
      allOf:
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier of the metadata schema.
            related_object:
              type: string
              description: >-
                The resource type. You can define custom metadata schemas, which
                have a custom `"related_object"` resource type. The standard
                metadata schemas are: `"campaign"`, `"customer"`,
                `"earning_rule"`, `"loyalty_tier"`, `"order"`, `"order_item"`,
                `"product"`, `"promotion_tier"`, `"publication"`,
                `"redemption"`, `"reward"`, `"voucher"`.
        - type: object
          properties:
            properties:
              type: object
              description: Contains metadata definitions.
              additionalProperties:
                $ref: >-
                  #/components/schemas/ManagementProjectsMetadataSchemaDefinition
          required:
            - properties
        - type: object
          properties:
            allow_defined_only:
              type: boolean
              nullable: true
              description: >-
                Restricts the creation of metadata fields when set to `true`. It
                indicates whether or not you can create new metadata
                definitions, e.g. in the campaign or publication manager. If set
                to `true`, then only the defined fields are available for
                assigning values.
            created_at:
              type: string
              example: '2021-12-03T13:33:44.556Z'
              description: >-
                Timestamp representing the date and time when the metadata
                schema was created. The value for this parameter is shown in the
                ISO 8601 format.
              format: date-time
            updated_at:
              type: string
              nullable: true
              example: '2022-08-11T08:05:30.695Z'
              description: >-
                Timestamp representing the date and time when the metadata
                schema was updated. The value for this parameter is shown in the
                ISO 8601 format.
              format: date-time
            object:
              type: string
              default: metadata_schema
              description: >-
                The type of the object represented by the JSON. This object
                stores information about the metadata schema.
      required:
        - id
        - related_object
        - properties
        - allow_defined_only
        - created_at
        - updated_at
        - object
    ManagementProjectsMetadataSchemaDefinition:
      type: object
      title: Metadata Definitions
      description: >-
        Custom definition name. This is also shown in **Project Settings** >
        **Metadata Schema** in the Voucherify Dashboard.
      properties:
        type:
          type: string
          description: >-
            Indicates the type of metadata. Note that `"geopoint"` type is a
            paid feature.
          enum:
            - string
            - number
            - object
            - date
            - datetime
            - geopoint
            - boolean
            - image_url
        optional:
          type: boolean
          description: Indicates if this definition is optional or not for the resource.
        array:
          type: boolean
          description: Indicates if the definition is an array.
        deleted:
          type: boolean
          description: Indicates if the definition has been deleted from the schema.
        object_type:
          type: string
          nullable: true
          description: >-
            The name of the custom resource (i.e. a nested object) if the
            resource has been previously defined. Otherwise, it is `null` for
            other types.
        min_length:
          type: integer
          description: >-
            Value indicating the minimum length. Available only for the `string`
            type.
        max_length:
          type: integer
          description: >-
            Value indicating the maximum length. Available only for the `string`
            type.
        exact_length:
          type: integer
          description: >-
            Value indicating the exact length. Available only for the `string`
            type.
        eq:
          type: array
          description: >-
            Array of values that are allowed. Available only for the `string`
            and `number` types.
          items:
            oneOf:
              - title: Add number
                description: >-
                  Adds numbers to the array. The value should be up to two
                  decimal places.
                type: number
              - title: Add string
                description: Adds strings to the array.
                type: string
        ne:
          type: array
          description: >-
            Array of values that are not allowed. Available only for the
            `number` type.
          items:
            description: >-
              Adds number to the array. The value should be up to two decimal
              places.
            type: number
        lt:
          type: number
          description: >-
            A property of the `number` type must have `less than` this value.
            The value should be up to two decimal places.
        lte:
          type: number
          description: >-
            A property of the `number` type must be `less than or equal` to this
            value. The value should be up to two decimal places.
        gt:
          type: number
          description: >-
            A property of `number` type must be `greater than` this value. The
            value should be up to two decimal places.
        gte:
          type: number
          description: >-
            A property of `number` type must be `greater than or equal` to this
            value. The value should be up to two decimal places.
      required:
        - type
        - optional
        - array
  securitySchemes:
    X-Management-Id:
      type: apiKey
      name: X-Management-Id
      in: header
    X-Management-Token:
      type: apiKey
      name: X-Management-Token
      in: header

````