--- title: "Subcontract Document Management" slug: "recipe-pm-create-a-revision-of-pm-attachment-and-link-it-to-a-sub-contract" updated: 2024-03-13T15:16:14Z published: 2024-03-13T15:16:14Z canonical: "developers.cmicglobal.com/recipe-pm-create-a-revision-of-pm-attachment-and-link-it-to-a-sub-contract" --- > ## Documentation Index > Fetch the complete documentation index at: https://developers.cmicglobal.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a Revision of PM Attachment and link it to a sub-contract Create a Revision of PM Attachment and link it to a sub-contract. Use CMiC Project Management document API to create and upload and link to a CMiC document object. ## Step 1: Upload document and link to sub-contract ### Form Elements ### fileDetails This form element contains a JSON string. Attributes provide attachment details where: | Attribute | Description | | --- | --- | | PmdProjUuid | Project unique identifier | | PmdTypeCode | Maps to folder name within the document management system | | PmdId | Attachment document id | | PmdTitle | Document title | | PmdDesc1 | Document description text | | PmdDesc2 | Additional document description text | | PmdrComment | Comments | | PmdrRcvdDate | Document received date | | PmdrRevDate | Document revision date | | PmdObjectType | | | PmdObjectId | | | PmdObjectId2 | | | PmdProjCode | | | PmdCompCode | | #### document-content-file This is the attachment file that will be uploaded **Request** ``` curl --location --request POST 'https://yourserver.com/yourenvironment/pm-doc-rest-api/jersey/v1/uploadDoc' \ --header 'Authorization: Your-User:Pass' \ --form 'fileDetails="{ \"PmdProjUuid\": \"Project UUID\", \"PmdTypeCode\": \"Folder name\", \"PmdId\": \"Docoument Id\", \"PmdTitle\": \"Document title\", \"PmdDesc1\": \"Description 1\", \"PmdDesc2\": \"Description 2\", \"PmdrComment\": \"Original Document\", \"PmdrRcvdDate\": \"2021-10-15\", \"PmdrRevDate\": \"2021-10-15\", \"PmdObjectType\": \"Type\", \"PmdObjectId\": \"Id\", \"PmdObjectId2\": \"Id\", \"PmdProjCode\": \"Project code\", \"PmdCompCode\": \"Comp code\", }"' \ --form 'document-content-file=@"document-file-2-upload"' ```