Upload PDF file or file metadata
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 metadata
Add 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.
File digest header
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.
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=
Parameters
Request Body (required)
Either PDF file content or file metadata JSON
application/json
Content-Type: application/json
Schema: FileMetadata
Properties
application/pdf
Content-Type: application/pdf
Type: string
Responses
200
File was updated successfully (PDF upload)
Content-Type: application/json
Properties
201
New file was created successfully (PDF upload)
Content-Type: application/json
Properties
202
Metadata accepted, waiting for actual file (metadata upload)
Content-Type: application/json
Properties
400
Bad request - validation error, digest mismatch, or invalid JSON
Content-Type: application/json
Schema: ErrorResponse
Properties
Examples:
digestMismatch:
unsupportedAlgorithm:
invalidFileId:
signerNotFound:
missingContentType:
invalidJson:
401
Unauthorized - user not creator of transaction
Content-Type: application/json
Schema: ErrorResponse
Properties
Example:
403
Forbidden - authorization policy violation
Content-Type: application/json
Schema: ErrorResponse
Properties
Example:
413
Payload too large - file exceeds 50MB limit
Content-Type: application/json
Schema: ErrorResponse
Properties
Example:
500
Internal server error
Content-Type: application/json
Schema: ErrorResponse
Properties
Example: