POST Metadata/Set

Assigns a Custom Field value to an object. The caller must have Write permission to the Distinguished Name (DN) of a certificate or device Distinguished Name (DN) in the request.

Requirements

  • Permissions:  The caller must have Write permission to the Metadata Distinguished Name (DN) and the Guid of the request.
  • Token scope:  Any valid scope, such as Agent, Certificate, or SSH:Manage

Headers

  • Content type: Content-Type:application/json.

  • Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.

Parameters

Input parameters

Name

Description

DN

The Distinguished Name (DN) of a Certificate or Device object that contains a Custom Field. If necessary, use the DN value from the GET Metadata/Items or POST Metadata/GetItemsForClass response.

GuidData

An array of ItemGuid-List pairs that apply to the DN. Each pair uniquely identifies a Custom Field and the new value(s). If GuidData is empty and KeepExisting is false or not specified, every Custom Field for the DN resets to null.

  • ItemGuid: The GUID that identifies the Custom Field. To get the Custom Field GUID, use POST Metadata/GetItems. Depending on your environment, the GUID may be expressed with or without curly braces {}. For example, {3d6b61d-1c71-4603-883f-25b8c2ceecdd}.
  • List: An array of one or more Custom Field value changes. The value must match a Metadata Field Type. For example, to set a date, use the MM/DD/YYYY format.

KeepExisting

The flag to control Custom Field updates:

  • true: Update only the Custom Fields based on GuidData values. All other Custom Fields for the DN remain unchanged.
  • false: Default. Clear all Custom Fields for the DN, and then set only the Custom Field values based on GuidData. If GuidData is empty, all fields reset to null.

WARNING!  To retain existing Custom Field values, be sure to set KeepExisting to true. Otherwise, the values for any Custom Fields of the DN, which are absent in the GuidData, will be cleared.

Returns

Response description

Name

Description

Locked

The status of the data:

  • true: The Policy value, which applies to the Custom Field, is locked.
  • false: The Custom Field value is capable of change.

Result

The reason for success or failure. For more information, see Metadata Result Codes.

Example: Set the identity of a Custom Field value and retain all other values

Request

POST https://tpp.venafi.example/vedsdk/Metadata/Set
Authorization:Bearer 4MyGeneratedBearerTknz=={
   "DN":"\\VED\\Policy\\Venafi Operational Certificates\\RSAm69-cert",
   "GuidData":[
      {
         "ItemGuid":"{91a5fee0-f94a-4729-b04e-1466cb28d2d0}",
         "List":[
            "Admin"
         ]
      }
   ],
   "KeepExisting":true
}

Response

HTTP/1.1 200 OK
{
   "Locked": false,
   "Result": 0
}