---
title: "Upload a contract"
method: POST
path: "/contracts"
---

# Upload a contract

`POST /contracts`

## Request

- Base URL: `https://api.termscout.com`
- URL: `https://api.termscout.com/contracts`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/termscout/apis/termscout-data/docs/contracts/post.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to upload a contract. Currently supports .pdf, .docx and .txt. 

A base64 encoded byte string for the document data is required as the POST body.

To upload multiple documents, POST with the primary document, retrieve the returned `contract-id` then repeat the same step for each new document, including the `contract_id` in the subsequent requests to associate multiple documents with the same contract.

If submitted without a `contract-id`, will create a new contract and return a new `contract-id` and a `document-id`. 

If submitted with a `document-id`, will replace that document with the new document

## Query parameters

- `document-name` string, required
- `template-id` string, required
- `defined-term` string
- `url` string
- `contract-id` string
- `party-b-defined-term` string
- `document-id` string
- `party-a-defined-term` string
- `contract-position-id` string
- `review-level` string
- `is-public` string

## Response `200`

200 response

- ContractUpload
  - `contract_id` string: ID of newly created contract
  - `document_id` string: ID of document created

---

[API](https://skmtc.dev/termscout/apis/termscout-data.md) - [All operations](https://skmtc.dev/termscout/apis/termscout-data/llms.txt) - [OpenAPI document](https://skmtc.dev/termscout/apis/termscout-data/revisions/ccf2baad9b8b?raw)
