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

# Set xmetadata

> Set xmetadata for a entity id and type. The value passed to xid or xmetadata will replace the existing xid or xmetadata values respectively.
To remove xid or xmetadata, pass in null value.




## OpenAPI

````yaml /issuing/api-reference/openapi.yaml post /xmetadata/set
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
servers:
  - url: https://access.utgl.io/v1
  - url: https://sandbox.access.utgl.io/v1
security:
  - Basic: []
  - Bearer: []
tags:
  - name: Accounts
  - name: Transactions
  - name: Card Accounts
  - name: Card Products
  - name: Cards
  - name: Digital Custody
  - name: Fee
  - name: Payout
paths:
  /xmetadata/set:
    post:
      tags:
        - Xmetadata
      summary: Set xmetadata
      description: >
        Set xmetadata for a entity id and type. The value passed to xid or
        xmetadata will replace the existing xid or xmetadata values
        respectively.

        To remove xid or xmetadata, pass in null value.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - target
              properties:
                target:
                  type: object
                  required:
                    - type
                    - id
                  properties:
                    type:
                      type: string
                      example: cardaccount
                    id:
                      type: string
                      example: xxx
                xid:
                  $ref: '#/components/schemas/Xid'
                xmetadata:
                  $ref: '#/components/schemas/Xmetadata'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - target
                  - xid
                  - xmetadata
                properties:
                  target:
                    type: object
                    required:
                      - type
                      - id
                    properties:
                      type:
                        type: string
                        example: cardaccount
                      id:
                        type: string
                        example: xxx
                  xid:
                    $ref: '#/components/schemas/Xid'
                  xmetadata:
                    $ref: '#/components/schemas/Xmetadata'
components:
  schemas:
    Xid:
      type: string
      description: >-
        External identifier, unique across all resources created under this
        account.
    Xmetadata:
      type: object
      description: External metadata
      example:
        key1: value1
        key2:
          - value2.1
          - value2.2
      additionalProperties: true
      oneOf:
        - type: string
        - type: array
          items:
            type: string
  securitySchemes:
    Basic:
      type: http
      scheme: basic
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````