Method: PUT
Path: /api/transaction/{transactionId}/file/{fileId}
Upload either a PDF file or file metadata to a transaction. The Content-Type header determines which endpoint is used:
application/pdf: Upload PDF file contentapplication/json: Upload file metadataAdd a file to the transaction or overwrite an existing file with the same `fileId``.
The file parameter can either be the PDF document or JSON metadata.
If your file requires metadata, the JSON metadata MUST be supplied first.
When uploading a file, it is possible to send a digest header along with the HTTP request. This header should contain a base64-encoded SHA checksum of the uploaded file. For more information on digest headers, refer to RFC 3230 for format instructions and RFC 5843 for the supported algorithms.
Currently, only SHA-256 and SHA-512 are accepted as hash algorithms. While RFC 3230 originally included MD5 and SHA-1, these weaker algorithms are no longer supported for security reasons. Using SHA-256 or SHA-512 ensures compliance with modern security standards.
For example: Digest: SHA-256=HtHRpLOZBEMnTpQS6Zn12veC4uhjtMwamfVAwmPQPmE=
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| transactionId | path | string | Yes | The transaction to add the files to |
| fileId | path | string | Yes | A unique identifier for the file within the transaction. Must not exceed 255 characters and cannot contain control characters or the following special characters: |
| Content-Type | header | string | Yes | Content type - either application/pdf for file upload or application/json for metadata |
| Digest | header | string | No | SHA-256 or SHA-512 checksum of the PDF file for integrity verification (only for PDF uploads) |
Either PDF file content or file metadata JSON
Content-Type: application/json
Schema: FileMetadata
| Name | Type | Description |
|---|---|---|
| DisplayName | String | Null |
| DisplayOrder | Integer | Null |
| Description | String | Null |
| SetParaph | Boolean | Null |
| Signers | Object | Dictionary mapping signer identifiers to their specific configuration for this file. Each signer can have different form sets and signing requirements for the same document. The key is the signer identifier. |
| FormSets | Object | Nested dictionary structure defining form fields and signing areas within the document. The outer key represents the form set name, and the inner key represents individual field identifiers within that set. Form sets allow grouping related fields together for organization and signer assignment. The following characters are allowed as a key / field name: Map of pdf field definitions. |
Content-Type: application/pdf
Type: string
File was updated successfully (PDF upload)
Content-Type: application/json
| Name | Type | Description |
|---|---|---|
| Message | String |
New file was created successfully (PDF upload)
Content-Type: application/json
| Name | Type | Description |
|---|---|---|
| Message | String |
Metadata accepted, waiting for actual file (metadata upload)
Content-Type: application/json
| Name | Type | Description |
|---|---|---|
| Message | String |
Bad request - validation error, digest mismatch, or invalid JSON
Content-Type: application/json
Schema: ErrorResponse
| Name | Type | Description |
|---|---|---|
| Message | String | Required. Human-readable error message |
Examples:
digestMismatch:
unsupportedAlgorithm:
invalidFileId:
signerNotFound:
missingContentType:
invalidJson:
Unauthorized - user not creator of transaction
Content-Type: application/json
Schema: ErrorResponse
| Name | Type | Description |
|---|---|---|
| Message | String | Required. Human-readable error message |
Example:
Forbidden - authorization policy violation
Content-Type: application/json
Schema: ErrorResponse
| Name | Type | Description |
|---|---|---|
| Message | String | Required. Human-readable error message |
Example:
Payload too large - file exceeds 50MB limit
Content-Type: application/json
Schema: ErrorResponse
| Name | Type | Description |
|---|---|---|
| Message | String | Required. Human-readable error message |
Example:
Internal server error
Content-Type: application/json
Schema: ErrorResponse
| Name | Type | Description |
|---|---|---|
| Message | String | Required. Human-readable error message |
Example: