Skip to content

This endpoint executes the given MDL script on a Vault.

POST/api/mdl/execute
NameDescription
Content-Typeapplication/json or application/xml
Acceptapplication/json (default) or application/xml

The body of the request should contain the MDL script to execute. Enter the body as raw data. The body must start with one of the following values:

  • CREATE
  • RECREATE
  • RENAME
  • ALTER
  • DROP

Learn more in the MDL Commands documentation.

In this example, we update our picklists using the RECREATE command. If a picklist exists with the name color__c, Vault updates it to conform to the definition provided. If not, Vault creates a new picklist with the definition provided.

curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: application/json" \ --data-binary @"mdl.txt" \ https://myvault.veevavault.com/api/mdl/execute
RECREATE Picklist color__c ( label('Color'), active(true), Picklistentry red__c( value('Red'), order(1), active(true) ), Picklistentry blue__c( value('Blue'), order(2), active(true) ), Picklistentry green__c( value('Green'), order(3), active(true) ) );

Example Body: RECREATE Java SDK Trigger

Section link for Example Body: RECREATE Java SDK Trigger
RECREATE Recordtrigger my_custom_trigger_name__c ( active (true), source_code (<VeevaData> ... </VeevaData>) );
{ "responseStatus": "SUCCESS", "script_execution": { "code": "GEN-S-0", "message": "OK", "warnings": 0, "failures": 0, "exceptions": 0, "components_affected": 1, "execution_time": 0.028 }, "statement_execution": [ { "vault": "promo-vee.vaultdev.com", "statement": 1, "command": "RECREATE", "component": "Picklist.color__c", "message": "[SUCCESS] RECREATE Picklist color__c", "response": "SUCCESS" } ] }

On SUCCESS, the response contains details of the execute.