> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# 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 content
- `application/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](https://www.ietf.org/rfc/rfc3230.txt) for format instructions and [RFC 5843](https://www.ietf.org/rfc/rfc5843.txt) 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

| Name              | In     | Type   | Required | Description                                                                                                                                                                                                                                                                                                    |                                  |
| ----------------- | ------ | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| **transactionId** | path   | string | Yes      | <p>The transaction to add the files to</p>                                                                                                                                                                                                                                                                     |                                  |
| **fileId**        | path   | string | Yes      | <p>A unique identifier for the file within the transaction. Must not exceed 255 characters and cannot contain control characters or the following special characters: <code>:</code>, <code>\*</code>, <code>?</code>, <code>\</code>, <code>/</code>, <code>"</code>, <code>\<</code>, <code>></code>, <code> | </code>, or null characters.</p> |
| **Content-Type**  | header | string | Yes      | <p>Content type - either application/pdf for file upload or application/json for metadata</p>                                                                                                                                                                                                                  |                                  |
| **Digest**        | header | string | No       | <p>SHA-256 or SHA-512 checksum of the PDF file for integrity verification (only for PDF uploads)</p>                                                                                                                                                                                                           |                                  |

## Request Body  (required)

Either PDF file content or file metadata JSON

#### application/json

Content-Type: `application/json`

**Schema:** [FileMetadata](/openapi/models/FileMetadata.md)

#### Properties

| Name             | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                                                                                                          |
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **DisplayName**  | String  | Null                                                                                                                                                                                                                                                                                                                                                                                                                                                | <p>Human-readable display name for the file that will be shown to users in the signing interface. If not provided, the fileId will be used as the display name.</p>                                                      |
| **DisplayOrder** | Integer | Null                                                                                                                                                                                                                                                                                                                                                                                                                                                | <p>Numeric value determining the order in which files are displayed and processed when multiple files are present in a transaction. Lower numbers appear first. If not specified, a timestamp-based order is used.</p>   |
| **Description**  | String  | Null                                                                                                                                                                                                                                                                                                                                                                                                                                                | <p>Detailed description of the file's purpose and contents. This helps users understand what they are signing and may be displayed in the signing interface or audit logs.</p>                                           |
| **SetParaph**    | Boolean | Null                                                                                                                                                                                                                                                                                                                                                                                                                                                | <p>Indicates whether a paraph (initial) should be set on each page of the document in addition to the main signature. When true, signers will be required to initial every page. Defaults to false if not specified.</p> |
| **Signers**      | Object  | <p>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.</p>                                                                                                                                                                                                                              |                                                                                                                                                                                                                          |
| **FormSets**     | Object  | <p>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.</p> <p>The following characters are allowed as a key / field name: <code>a-z A-Z 0-9 \_</code>.</p> <p>Map of pdf field definitions.</p> |                                                                                                                                                                                                                          |

#### application/pdf

Content-Type: `application/pdf`

**Type:** string

## Responses

### 200

File was updated successfully (PDF upload)

Content-Type: `application/json`

#### Properties

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| **Message** | String |             |

### 201

New file was created successfully (PDF upload)

Content-Type: `application/json`

#### Properties

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| **Message** | String |             |

### 202

Metadata accepted, waiting for actual file (metadata upload)

Content-Type: `application/json`

#### Properties

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| **Message** | String |             |

### 400

Bad request - validation error, digest mismatch, or invalid JSON

Content-Type: `application/json`

**Schema:** [ErrorResponse](/openapi/models/ErrorResponse.md)

#### Properties

| Name         | Type    | Description                                                                                                                                                                                                                                                                                       |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**     | String  | <p>A URI reference identifying the problem type. This property is always present in RFC 7807 responses.</p>                                                                                                                                                                                       |
| **title**    | String  | <p>A short, human-readable summary of the problem</p>                                                                                                                                                                                                                                             |
| **detail**   | String  | <p>A human-readable explanation specific to this occurrence of the problem</p>                                                                                                                                                                                                                    |
| **status**   | Integer | <p>The HTTP status code</p>                                                                                                                                                                                                                                                                       |
| **instance** | String  | <p>A URI reference that identifies the specific occurrence of the problem</p>                                                                                                                                                                                                                     |
| **Message**  | String  | <p><strong>Deprecated (Legacy Format Only):</strong> Contains the error message in the old response format. This property appears alone in legacy error responses and is mutually exclusive with the RFC 7807 properties above. Will be phased out as we complete our transition to RFC 7807.</p> |

**Examples:**

_digestMismatch:_

```json
{
  "Message": "SHA-256 digest mismatch"
}
```

_unsupportedAlgorithm:_

```json
{
  "Message": "Hash algorithm [MD5] is not supported."
}
```

_invalidFileId:_

```json
{
  "Message": "FileId is invalid"
}
```

_signerNotFound:_

```json
{
  "Message": "Signer 'signer1' not found."
}
```

_missingContentType:_

```json
{
  "Message": "Unexpected or missing Content-Type header, did you specify 'application/pdf'?"
}
```

_invalidJson:_

```json
{
  "Message": "Invalid json structure provided."
}
```

### 401

Unauthorized - user not creator of transaction

Content-Type: `application/json`

**Schema:** [ErrorResponse](/openapi/models/ErrorResponse.md)

#### Properties

| Name         | Type    | Description                                                                                                                                                                                                                                                                                       |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**     | String  | <p>A URI reference identifying the problem type. This property is always present in RFC 7807 responses.</p>                                                                                                                                                                                       |
| **title**    | String  | <p>A short, human-readable summary of the problem</p>                                                                                                                                                                                                                                             |
| **detail**   | String  | <p>A human-readable explanation specific to this occurrence of the problem</p>                                                                                                                                                                                                                    |
| **status**   | Integer | <p>The HTTP status code</p>                                                                                                                                                                                                                                                                       |
| **instance** | String  | <p>A URI reference that identifies the specific occurrence of the problem</p>                                                                                                                                                                                                                     |
| **Message**  | String  | <p><strong>Deprecated (Legacy Format Only):</strong> Contains the error message in the old response format. This property appears alone in legacy error responses and is mutually exclusive with the RFC 7807 properties above. Will be phased out as we complete our transition to RFC 7807.</p> |

**Example:**

```json
{
  "Message": "Unauthorized access to this resource."
}
```

### 403

Forbidden - authorization policy violation

Content-Type: `application/json`

**Schema:** [ErrorResponse](/openapi/models/ErrorResponse.md)

#### Properties

| Name         | Type    | Description                                                                                                                                                                                                                                                                                       |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**     | String  | <p>A URI reference identifying the problem type. This property is always present in RFC 7807 responses.</p>                                                                                                                                                                                       |
| **title**    | String  | <p>A short, human-readable summary of the problem</p>                                                                                                                                                                                                                                             |
| **detail**   | String  | <p>A human-readable explanation specific to this occurrence of the problem</p>                                                                                                                                                                                                                    |
| **status**   | Integer | <p>The HTTP status code</p>                                                                                                                                                                                                                                                                       |
| **instance** | String  | <p>A URI reference that identifies the specific occurrence of the problem</p>                                                                                                                                                                                                                     |
| **Message**  | String  | <p><strong>Deprecated (Legacy Format Only):</strong> Contains the error message in the old response format. This property appears alone in legacy error responses and is mutually exclusive with the RFC 7807 properties above. Will be phased out as we complete our transition to RFC 7807.</p> |

**Example:**

```json
{
  "Message": "Access denied by authorization policy."
}
```

### 413

Payload too large - file exceeds 50MB limit

Content-Type: `application/json`

**Schema:** [ErrorResponse](/openapi/models/ErrorResponse.md)

#### Properties

| Name         | Type    | Description                                                                                                                                                                                                                                                                                       |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**     | String  | <p>A URI reference identifying the problem type. This property is always present in RFC 7807 responses.</p>                                                                                                                                                                                       |
| **title**    | String  | <p>A short, human-readable summary of the problem</p>                                                                                                                                                                                                                                             |
| **detail**   | String  | <p>A human-readable explanation specific to this occurrence of the problem</p>                                                                                                                                                                                                                    |
| **status**   | Integer | <p>The HTTP status code</p>                                                                                                                                                                                                                                                                       |
| **instance** | String  | <p>A URI reference that identifies the specific occurrence of the problem</p>                                                                                                                                                                                                                     |
| **Message**  | String  | <p><strong>Deprecated (Legacy Format Only):</strong> Contains the error message in the old response format. This property appears alone in legacy error responses and is mutually exclusive with the RFC 7807 properties above. Will be phased out as we complete our transition to RFC 7807.</p> |

**Example:**

```json
{
  "Message": "Request entity too large."
}
```

### 500

Internal server error

Content-Type: `application/json`

**Schema:** [ErrorResponse](/openapi/models/ErrorResponse.md)

#### Properties

| Name         | Type    | Description                                                                                                                                                                                                                                                                                       |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**     | String  | <p>A URI reference identifying the problem type. This property is always present in RFC 7807 responses.</p>                                                                                                                                                                                       |
| **title**    | String  | <p>A short, human-readable summary of the problem</p>                                                                                                                                                                                                                                             |
| **detail**   | String  | <p>A human-readable explanation specific to this occurrence of the problem</p>                                                                                                                                                                                                                    |
| **status**   | Integer | <p>The HTTP status code</p>                                                                                                                                                                                                                                                                       |
| **instance** | String  | <p>A URI reference that identifies the specific occurrence of the problem</p>                                                                                                                                                                                                                     |
| **Message**  | String  | <p><strong>Deprecated (Legacy Format Only):</strong> Contains the error message in the old response format. This property appears alone in legacy error responses and is mutually exclusive with the RFC 7807 properties above. Will be phased out as we complete our transition to RFC 7807.</p> |

**Example:**

```json
{
  "Message": "An internal server error occurred."
}
```
