Garrigues Signature Manager - Documents Operations



Introduction

This section covers all operations related to managing documents in a signature request.


Operations

Add a document to a signature request

This endpoint adds a new document to a signature request.

HTTP Request

POST /api/v1/private/signature-requests/{signatureRequestId}/documents

Example Request Body

{
  "filename": "document.pdf",
  "title": "Document Title",
  "description": "Document description",
  "hash": "64-character-hex-string",
  "signatureDeadline": "2023-10-25T12:00:00.000Z",
  "provider": "EADTRUST",
  "signatureType": "ADVANCED",
  "evidenceId": "763a8ecf-5476-41d1-8cfe-8349bb777c63",
  "metadata": {
    "key1": "value1",
    "key2": "value2"
  },
  "certificateFiles": {
    "originalDocument": true,
    "signedDocument": false
  },
  "sequence": 1,
  "fileSize": 102400,
  "detached": false,
  "convertToPdf": true
}

Where

Parameter Mandatory Datatype Description
filename Yes string Name of the document file.
title Yes string Title of the document.
description No string Description of the document.
hash Yes string File hash. Must be a 64-character hex string.
signatureDeadline No string Signature deadline for this document.
provider No string Signature provider. Possible value: EADTRUST.
signatureType Yes string Signature type. Possible values: ADVANCED, INTERPOSITION.
evidenceId No string (UUID) Evidence identifier to attach to the document.
metadata No object Additional metadata for the document.
certificateFiles No object Certificate file options.
certificateFiles.originalDocument No boolean If true, include original document in the certificate package.
certificateFiles.signedDocument No boolean If true, include signed document in the certificate package.
sequence No integer Order of the document within the signature request.
fileSize No integer Size of the file in bytes.
detached No boolean If true, requests a detached signature when supported.
convertToPdf No boolean If true, converts the document to PDF before signing.

Example Response

{
  "id": "7e7de10d-060f-42f8-99f2-9b1d53bd614f",
  "filename": "document.pdf",
  "title": "Document Title",
  "description": "Document description",
  "signatureDeadline": "2023-10-25T12:00:00.000Z",
  "provider": "EADTRUST",
  "signatureType": "ADVANCED",
  "status": "PENDING",
  "fileSize": 102400,
  "sequence": 1
}

Error: 400 Bad request | 404 Signature request not found | 500 Unexpected error


Get list of documents

This endpoint retrieves a list of documents associated with a signature request.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents

Where

Parameter Mandatory Datatype Description
signatureRequestId Yes string (UUID) Unique identifier for the signature request.
ids No array of string (UUID) Filter documents by IDs.
filenames No array of string Filter documents by filename.
titles No array of string Filter documents by title.
signatureTypes No array of string Filter documents by signature type. Possible values: ADVANCED, INTERPOSITION.
providers No array of string Filter documents by provider. Possible value: EADTRUST.
statuses No array of string Filter documents by status. Possible values: PENDING, READY_TO_SIGN, SIGNED, REJECTED, ERROR, CONVERTING_PDF.
hashes No array of string Filter documents by hash.
page No integer Page number for pagination.
size No integer Number of items per page.
sort No array of string Sorting criteria in the format field:order (e.g., title:ASC, createdAt:DESC).

Example Response

[
  {
    "id": "57081c08-08e7-4d7e-b10a-8a98d7b1b3bd",
    "filename": "document.pdf",
    "title": "Document Title",
    "description": "Document description",
    "signatureDeadline": "2023-10-25T12:00:00.000Z",
    "provider": "EADTRUST",
    "signatureType": "ADVANCED",
    "status": "PENDING",
    "fileSize": 102400,
    "sequence": 1
  }
]

Get document detail

This endpoint retrieves the details of a document.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}

Where

Parameter Mandatory Datatype Description
signatureRequestId Yes string (UUID) Unique identifier for the signature request.
documentId Yes string (UUID) Unique identifier for the document.

Example Response

{
  "id": "57081c08-08e7-4d7e-b10a-8a98d7b1b3bd",
  "filename": "document.pdf",
  "title": "Document Title",
  "mimeType": "application/pdf",
  "description": "Document description",
  "signatureDeadline": "2023-10-25T12:00:00.000Z",
  "provider": "EADTRUST",
  "signatureType": "ADVANCED",
  "status": "READY_TO_SIGN",
  "countSignatories": 2,
  "countObservers": 1,
  "fileSize": 102400,
  "sequence": 1,
  "metadata": {
    "key1": "value1"
  },
  "detached": false,
  "convertToPdf": true
}

Update document sequence

This endpoint updates the order of a document within a signature request.

HTTP Request

PATCH /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/sequence

Example Request Body

{
  "sequence": 2
}

Where

Parameter Mandatory Datatype Description
signatureRequestId Yes string (UUID) Unique identifier for the signature request.
documentId Yes string (UUID) Unique identifier for the document.
sequence Yes integer New order of the document.

Error: 400 Bad request | 404 Signature request or document not found | 500 Unexpected error


Delete document

This endpoint deletes a document from a signature request.

HTTP Request

DELETE /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}

Where

Parameter Mandatory Datatype Description
signatureRequestId Yes string (UUID) Unique identifier for the signature request.
documentId Yes string (UUID) Unique identifier for the document.

Error: 400 Bad request | 404 Signature request or document not found | 500 Unexpected error


Get document download URI

This endpoint retrieves the download URL for the original document.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/links/download

Example Response

[
  {
    "url": "https://example.com/download",
    "expiration": "2023-10-23T10:34:59.483Z"
  }
]

Get converted document download URI

This endpoint retrieves the download URL for the converted document (if conversion to PDF is enabled).

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/links/converted/download

Example Response

[
  {
    "url": "https://example.com/converted/download",
    "expiration": "2023-10-23T10:34:59.483Z"
  }
]

Get final signed document download URI

This endpoint retrieves the download URL for the final signed document.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/links/signed/download

Example Response

{
  "url": "https://example.com/signed/download",
  "expiration": "2023-10-23T10:34:59.483Z"
}

Get interim signed document download URI

This endpoint retrieves the download URL for the interim signed document based on a report.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/reports/{reportId}/links/signed/download

Example Response

{
  "url": "https://example.com/reports/signed/download",
  "expiration": "2023-10-23T10:34:59.483Z"
}

This endpoint retrieves a pre-signed URL to upload the document file.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/links/upload

Example Response

{
  "url": "https://example.com/upload",
  "expiration": "2023-10-23T10:34:59.483Z"
}

Start multipart upload

This endpoint starts a multipart upload and returns an upload identifier.

HTTP Request

POST /api/v1/private/signature-requests/{signatureRequestId}/documents/uploads

Example Request Body

{
  "filename": "document.pdf",
  "title": "Document Title",
  "hash": "64-character-hex-string",
  "signatureType": "ADVANCED",
  "fileSize": 10485760
}

Where

Parameter Mandatory Datatype Description
signatureRequestId Yes string (UUID) Unique identifier for the signature request.
filename Yes string Name of the document file.
title Yes string Title of the document.
description No string Description of the document.
hash Yes string File hash. Must be a 64-character hex string.
signatureDeadline No string Signature deadline for this document.
provider No string Signature provider. Possible value: EADTRUST.
signatureType Yes string Signature type. Possible values: ADVANCED, INTERPOSITION.
evidenceId No string (UUID) Evidence identifier to attach to the document.
metadata No object Additional metadata for the document.
certificateFiles No object Certificate file options.
certificateFiles.originalDocument No boolean If true, include original document in the certificate package.
certificateFiles.signedDocument No boolean If true, include signed document in the certificate package.
sequence No integer Order of the document within the signature request.
fileSize No integer Size of the file in bytes.
detached No boolean If true, requests a detached signature when supported.
convertToPdf No boolean If true, converts the document to PDF before signing.

Example Response

{
  "id": "57081c08-08e7-4d7e-b10a-8a98d7b1b3bd",
  "uploadId": "upload-123",
  "status": "STARTED"
}

This endpoint retrieves a pre-signed URL to upload a part of a multipart document.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/uploads/{uploadId}?partNumber=1

Example Response

{
  "url": "https://example.com/upload/part/1",
  "expiration": "2023-10-23T10:34:59.483Z"
}

Complete multipart upload

This endpoint completes a multipart upload after all parts have been uploaded.

HTTP Request

POST /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/uploads/{uploadId}?partCounts=3

Error: 400 Bad request | 404 Signature request or document not found | 500 Unexpected error


Cancel multipart upload

This endpoint cancels a multipart upload.

HTTP Request

DELETE /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/uploads/{uploadId}

Error: 400 Bad request | 404 Signature request or document not found | 500 Unexpected error


Get final report file

This endpoint retrieves the final report PDF for a document in a signature request.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/reports/file

Example Response

[
  {
    "url": "https://example.com/reports/final.pdf",
    "expiration": "2023-10-23T10:34:59.483Z"
  }
]

Get final report package

This endpoint retrieves the final report package (ZIP) for a document in a signature request.

HTTP Request

GET /api/v1/private/signature-requests/{signatureRequestId}/documents/{documentId}/reports/package

Example Response

[
  {
    "url": "https://example.com/reports/final.zip",
    "expiration": "2023-10-23T10:34:59.483Z"
  }
]

Get report file by report id

This endpoint retrieves the report PDF for a report and document.

HTTP Request

GET /api/v1/private/reports/{reportId}/documents/{documentId}/file

Example Response

[
  {
    "url": "https://example.com/reports/report.pdf",
    "expiration": "2023-10-23T10:34:59.483Z"
  }
]

Get report package by report id

This endpoint retrieves the report package (ZIP) for a report and document.

HTTP Request

GET /api/v1/private/reports/{reportId}/documents/{documentId}/package

Example Response

[
  {
    "url": "https://example.com/reports/report.zip",
    "expiration": "2023-10-23T10:34:59.483Z"
  }
]