list()
Returns a paginated list of contracts for a project. Use theincludes option to embed sub-resource data inline.
Signature
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectId | string | Yes | — | The project ID |
options.page | number | No | 1 | Page number |
options.perPage | number | No | 20 | Items per page (max: 100) |
options.includes | string[] | No | — | Sub-resources to embed in each contract |
Example
get()
Returns a single contract by ID, with optional sub-resource includes.Signature
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectId | string | Yes | — | The project ID |
contractId | number | Yes | — | The contract ID |
options.includes | string[] | No | — | Sub-resources to embed |
Example
upload()
Uploads a contract PDF to a project. The file is stored and queued for processing. You can optionally request specific extractions to run automatically after upload.Signature
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectId | string | Yes | — | The project ID |
file | Buffer, Uint8Array, Blob, or string | Yes | — | The file to upload. Pass a file path as a string to read from disk. |
options.fileName | string | No | Inferred from path or upload.pdf | The file name |
options.fileType | string | No | application/pdf | MIME type |
options.extractions | string[] | No | — | Extraction types to run after upload |
options.onProgress | function | No | — | Upload progress callback |
Examples
Upload from file path:onProgress callback receives an object with bytesUploaded, bytesTotal, and percent fields.
download()
Returns a pre-signed download URL for a contract file.Signature
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | The project ID |
contractId | number | Yes | The contract ID |
Example
processes()
Returns the processing status for a contract, including staging and extraction progress.Signature
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | The project ID |
contractId | number | Yes | The contract ID |
Example
Include Fields
Pass any combination of the following values in theincludes option when calling list() or get():
| Include | Description |
|---|---|
entities | Entities linked to the contract |
artists | Artists linked to the contract |
writers | Writers linked to the contract |
royalties | Royalty terms extracted from the contract |
splits | Revenue split information |
costs | Cost provisions |
compensations | Compensation terms |
dates | Key dates (effective, termination, etc.) |
accounting-periods | Accounting period definitions |
types | Contract type classifications |
signatures | Signature information |
control-areas | Control area definitions |
creative-approvals | Creative approval clauses |
balances | Balance provisions and terms |
recordings | Recordings linked to the contract |
compositions | Compositions linked to the contract |
Extraction Types
Pass any combination of the following values in theextractions option when calling upload():
| 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 |
extract-balances | Balance provisions and terms |