> ## Documentation Index
> Fetch the complete documentation index at: https://docs.royaltyport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# royaltyport contracts upload

> Upload a contract PDF to a project.

```bash theme={null}
royaltyport contracts upload <project_id> [file_path]
```

Uploads a contract PDF to a project for processing. You can provide either a local file path or base64-encoded content.

***

## Arguments

| Argument     | Required | Description          |
| ------------ | -------- | -------------------- |
| `project_id` | Yes      | The project UUID     |
| `file_path`  | No       | Path to the PDF file |

***

## Options

| Option                 | Short | Description                                                  |
| ---------------------- | ----- | ------------------------------------------------------------ |
| `--base64 <string>`    | —     | Base64-encoded file content (alternative to file\_path)      |
| `--file-name <name>`   | —     | File name (required with `--base64`)                         |
| `--extractions <list>` | —     | Comma-separated list of extraction types to run after upload |

### Extraction Types

| Extraction                   | Description                              |
| ---------------------------- | ---------------------------------------- |
| `extract-accounting-period`  | Accounting period definitions            |
| `extract-assets`             | Asset references                         |
| `extract-commitments`        | Commitment clauses                       |
| `extract-compensations`      | Compensation terms                       |
| `extract-control-areas`      | Control area definitions                 |
| `extract-costs`              | Cost provisions                          |
| `extract-creative-approvals` | Creative approval clauses                |
| `extract-dates`              | Key dates (effective, termination, etc.) |
| `extract-royalties`          | Royalty terms                            |
| `extract-signatures`         | Signature information                    |
| `extract-splits`             | Revenue split information                |
| `extract-targets`            | Target and threshold clauses             |

***

## Behavior

* You must provide either `file_path` or `--base64`, but not both
* When using `--base64`, `--file-name` is required
* `--extractions` is optional — when omitted, the default extraction pipeline runs after staging completes
* On success, prints the staging ID and a hint to track progress with `royaltyport contracts status`

***

## Output

Prints a table with upload details:

| Field                | Description                                                              |
| -------------------- | ------------------------------------------------------------------------ |
| **Staging ID**       | Unique identifier for tracking processing progress                       |
| **Staging Stage**    | Current processing stage (`queued`, `processing`, `completed`, `failed`) |
| **Staging Done**     | Whether staging (pre-processing) has completed                           |
| **Extractions Done** | Whether all extractions have completed                                   |
| **Created At**       | Upload timestamp                                                         |

***

## Examples

Upload a local file:

```bash theme={null}
royaltyport contracts upload a1b2c3d4-e5f6-7890-abcd-ef1234567890 ./contract.pdf
```

Upload with specific extractions:

```bash theme={null}
royaltyport contracts upload a1b2c3d4-e5f6-7890-abcd-ef1234567890 ./contract.pdf \
  --extractions "extract-royalties,extract-dates,extract-signatures"
```

Upload base64-encoded content:

```bash theme={null}
royaltyport contracts upload a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  --base64 "JVBERi0xLjQK..." \
  --file-name "contract.pdf"
```
