Signatures

Document Manage

POST
/signatures/document/manage

Manages documents across supported platforms (Storage, Salesforce, OneDrive) without modifying their internal content.

  • Supported operations include:
    • Copy. Duplicate a document from source to target. Requires the same fileFormat for source and target, and source.remove = "none".
    • Move. Transfer a document from source to target and delete it from the source. Requires the same fileFormat for source and target, and source.remove = "delete" or "permanentDelete".
    • Delete. Remove a document when only the source is provided, with source.remove = "delete" or "permanentDelete" and no target.
    • Convert. Change document format while transferring; both source and target are required and fileFormat must differ.

Authorization

AuthorizationBearer <token>

JWT token to authenticate the request.

In: header

X-Api-Key<token>

API key, sent as a request header.

In: header

Header Parameters

Authorization*"Bearer {{authToken}}"

JWT token to authenticate the request on behalf of a specific Microsoft user or a backend service principal.

Default"Bearer {{authToken}}"

Value in

  • "Bearer {{authToken}}"
X-Subscription-Key*"{{apiKey}}"

Unique API key used to identify and authorize access to a specific environment

Default"{{apiKey}}"

Value in

  • "{{apiKey}}"
X-Client-Authorization?string

Encrypted (AES) JWT token to identify and authorize the calling client system responsible for requesting the document generation. This header is required when retrieving the template and/or data used to populate the template from the client’s side, and for delivering the final generated document on the client’s side. The JWT must contain the following claims:

  • sub: Current user session.
  • Destination: Path to which should be used to make a callback.
  • full_name: Name of the user that made the request.
  • email: The email address of the user that made the request.
  • iss: The issuer claim identifies the principal that issued the JWT. URL of the issuer.
  • oid: Object Id claim represents a unique Id of the user that made the request, for example in Salesforce case this will be User record Id.
  • clientId: Id representing the client. Eg OrgId.
  • zoneInfo: Zone information.
  • locale: Localization information.
X-Service-Authorization?string

Encrypted (AES) JWT token to represent a user that doesn’t have a Microsoft Account and that is allowed to use the subscription. The JWT must contain the following claims:

  • amp_subscription: The offering subscription key which is used to validate that the client has a valid license.
  • full_name: Name of the user that made the request.
  • email: The email address of the user that made the request.
  • iss: The issuer claim identifies the principal that issued the JWT. URL of the issuer.
  • oid: Object Id claim represents a unique Id of the user that made the request, for example in Salesforce case this will be User record Id.
  • zoneInfo: Zone information.
  • locale: Localization information.

Request Body

application/json

externalContext A contextual reference used to link the document generation request to an external system, process, or transaction. Often used for traceability or auditing purposes.


sourceDocument Identifies the input document and its properties, serving as the starting point for file operations like copying to a new location, moving with deletion, deleting outright, or converting to a different format.

sourceDocument.options Fine-tunes the loading process for the source document to meet specific requirements, such as retaining formatting or handling special features during operations like copying or conversion.


targetDocument Defines the properties of the output document resulting from the file operation (e.g., the destination for Copy, Move, or Convert operations). It specifies the document’s metadata, format, delivery method, storage location, and processing options, determining how the processed document is saved and managed. This node is omitted for Delete operations, as no output document is generated.

targetDocument.options.salesforce Specifies how the document will be stored or associated with records in Salesforce. Includes fields such as fileId, fileType, fileParentId, and ownerId.

targetDocument.options.onedrive Specifies how the document will be shared or stored via Microsoft OneDrive. Includes permission settings like anonymous access, edit/view rights, and user-specific sharing.

Response Body

application/json

application/json

curl -X POST "https://example.com/signatures/document/manage" \  -H "Authorization: Bearer {{authToken}}" \  -H "X-Subscription-Key: {{apiKey}}" \  -H "Content-Type: application/json" \  -d '{      "externalContext": {          "id": "12345"      },      "sourceDocument": {          "urn": "{{uploadedDocument}}",          "fileFormat": "pdf",          "loadMethod": "Storage",          "remove": "none",          "options": {              "docxLoadOptions": "{}"          }      },      "targetDocument": {          "name": "CopiedTest",          "fileFormat": "pdf",          "deliveryMethod": "Storage",          "path": "root",          "options": {              "pdfSaveOptions": "{ \\"ConformanceLevel\\": \\"PdfA3a\\", \\"Version\\": \\"PDF_1_7\\", \\"ImageDpi\\": 750 }",              "docxSaveOptions": "{}",              "salesforce": {                  "networkId": "",                  "fileId": "",                  "fileType": "", //Attachment, File                  "fileParentId": "",                  "ownerId": ""              },              "onedrive": {                  "viewAnonymous": true,                  "editAnonymous": true,                  "editUsers": [                      "user@example.com",                      "user@example.com"                                 ],                  "viewUsers": [                      "user@example.com",                      "user@example.com"                                  ]              }          }      },      "data": {          "embedded": ""      }  }'
{  "result": {    "statusCode": "201",    "message": "Created",    "data": {      "document": {        "deliveryMethod": "Storage",        "name": "Sales Agreement DOCX",        "fileFormat": "pdf",        "urn": "20b8feea-a8e6-929d-5beb67a290b8"      }    }  },  "consumption": [    {      "dimension": "pages-managed",      "value": 5    },    {      "dimension": "documents-managed",      "value": 1    }  ],  "origin": "POST https://dev.headless.mavenmule.com/signatures/document/manage",  "dateTime": "2025-11-05T11:02:16.0000000+00:00",  "userId": "1d8b89c4-0889-0c-9af09ac3bc9b",  "operationId": "a9733c420a9e6336ea36ed98f31"}
{  "error": {    "statusCode": "400",    "message": "Bad Request",    "innerErrors": [      {        "code": "{{errorCode}}",        "message": "{{errorMessage}}",        "userMessage": "{{message}}",        "eventId": "{{eventId}}"      }    ],    "externalErrors": []  },  "externalContext": {    "actionRequestId": "{{externalContextId}}"  },  "origin": "{{originEnvironment}}",  "dateTime": "{{responseTimestamp}}",  "userId": "{{userId}}",  "operationId": "{{operationId}}"}