Skip to content

Now that you have a session ID, you can upload a document to your Vault using the Documents API. In this example, you will create an unclassified document.

Assign the session ID to the header parameter Authorization. Specify the source file in the file body parameter. Since you will upload the document as unclassified, assign the values Unclassified and Inbox to the body parameters type__v and lifecycle__v respectively.

Prior to 21R1.3 (API v21.2), the Unclassified document type and Inbox lifecycle were known as the Undefined document type and Unclassified lifecycle. We recommend updating existing configurations with these new labels in Vaults created before 21R1.3.

curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: multipart/form-data" \ -F file=@document.txt \ -F "name__v=myDocument" \ -F "type__v=Unclassified" \ -F "lifecycle__v=Inbox" \ https://{server}/api/{version}/objects/documents

If your request contains all the required metadata and your session ID is valid, the response includes a unique document ID. The file document.txt must reside in the directory from which the curl command is being executed.

{ "responseStatus": "SUCCESS", "responseMessage": "successfully created document", "id": 776 }

Congratulations! You’ve successfully created your first document using Vault API. Once you’re ready, you can move on to the next tutorial where you’ll learn about document and object field metadata.