> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.tabs.com/_mcp/server.

# Create contract from file

POST https://integrators.prod.api.tabsplatform.com/v3/contracts/file
Content-Type: multipart/form-data

Uploads a contract PDF and creates a new contract for it in one call. No existing contract or customer is needed.

The contract is created with status IN\_PROGRESS and source API, and its ID is returned immediately. Processing then runs in the background, the same as a contract uploaded in the Tabs dashboard: it extracts the contract terms and, when no customerId is given, creates a new customer or links an existing one. Poll GET /v3/contracts/\{id} to follow the contract; customerId stays null until processing has linked a customer.

* customerId (optional) links the contract to one of your customers up front. A customerId that is not one of your customers returns 404.
* name (optional) sets the contract's display name. It defaults to the uploaded file's name.
* shouldProcess=false creates the contract and stores the file without starting processing. No jobId is returned in that case.

The file must be a PDF sent as the multipart field "file".

Reference: https://docs.tabs.com/api-reference/contracts/integrators-api-contractsv-3-controller-create-contract-from-file

## Authentication

- `Authorization` header (required) — API Key authentication via header

## Request

### Query parameters

- `name` (string, optional) — Display name of the contract. Defaults to the uploaded file's name.
- `customerId` (string, optional) — Customer to link the contract to. Omit it to let contract processing create or match the customer from the document.
- `shouldProcess` (enum, optional) — Whether to start contract processing after the upload. Defaults to true.
  - Allowed values: `true`, `false`

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `file` (file, required)

## Response

### 201

Created contract

- `payload` (ContractsV3Dto, required) — Response payload, will be empty when success is false
- `success` (boolean, required) — Boolean with true=success, false=failure
- `message` (string, required) — Plain-text description of the result
- `error` (IntegratorsApiError, optional) — json element with any error messages or warnings

## Errors

### 400 Bad Request Error

Missing file, a file that is not a PDF, or invalid query parameters

- `any`

### 404 Not Found Error

Customer not found

- `any`

## Types

### ContractsV3Dto

- `id` (string, required) — Unique identifier for the contract
- `fileName` (string, required) — Name of the contract file
- `name` (string, required) — Display name of the contract
- `status` (string, required) — Current status of the contract
- `customerId` (string, required, nullable) — Identifier of the customer associated with this contract. Null until a customer is linked, e.g. for a contract created from an uploaded file whose processing has not yet created or matched a customer.
- `documentClassifications` (list of enum, required, nullable) — Stored document classifications of the contract file. Null when no classification data is available; currently only fetching a contract by ID returns classification data.
  - Allowed values: `ORDER_FORM`, `STATEMENT_OF_WORK`, `AMENDMENT`, `RENEWAL`, `PO`, `MSA`, `INVOICE`, `NONE`
- `customerName` (string, optional) — Name of the customer associated with this contract. Empty string when no customer is linked to the contract.
- `createdAt` (datetime, optional) — Timestamp when the contract was created
- `closeDate` (string, optional) — Close date of the contract
- `lastUpdatedAt` (string, optional) — Timestamp when the contract was last updated
- `deletedAt` (datetime, optional) — Timestamp when the contract was deleted. Null for live contracts; populated on the deleted-contracts endpoint.
- `externalIds` (list of ExternalIdDto, optional) — External IDs and external source types of the contract
- `source` (enum, optional) — The source of the contract
  - Allowed values: `CRM`, `EMAIL`, `UPLOAD`, `API`, `ERP`, `INTERNAL`
- `jobId` (string, optional) — The workflow job ID for the contract processing

### IntegratorsApiError

- `code` (double, required) — API response code
- `message` (string, required) — API response message
- `errorCode` (string, optional) — Machine-readable error code
- `details` (IntegratorsApiErrorDetails, optional) — Additional details about the error

### ExternalIdDto

- `externalId` (string, optional) — The external identifier
- `sourceType` (enum, optional) — The source type of the external identifier
  - Allowed values: `QUICKBOOKS`, `NETSUITE`, `SALESFORCE`, `HUBSPOT`, `AVALARA`, `ANROK`, `STRIPE`, `RILLET`, `SAGE_INTACCT`, `SPHERE`, `CAMPFIRE`
- `metadata` (ExternalIdDtoMetadata, optional) — Additional metadata for the external identifier
- `objectType` (string, optional) — Raw CRM object API name this external id represents, e.g. Opportunity/Deal
- `objectLabel` (string, optional) — Human-readable CRM object label, e.g. Opportunity/Deal

### IntegratorsApiErrorDetails

Additional details about the error

### ExternalIdDtoMetadata

Additional metadata for the external identifier

## Examples

**Request**

```json
{
  "file": "<file: string>"
}
```

**Response**

```json
{
  "payload": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "fileName": "Contract.pdf",
    "name": "Contract",
    "status": "ACTIVE",
    "customerId": "123e4567-e89b-12d3-a456-426614174000",
    "documentClassifications": [
      "ORDER_FORM",
      "MSA"
    ],
    "customerName": "John Doe",
    "createdAt": "2024-01-01T00:00:00.000Z",
    "closeDate": "2024-01-01",
    "lastUpdatedAt": "2024-01-01T00:00:00.000Z",
    "deletedAt": "2024-01-01T00:00:00.000Z",
    "externalIds": [
      {
        "externalId": "123e4567-e89b-12d3-a456-426614174000",
        "sourceType": "NETSUITE"
      }
    ],
    "source": "CRM",
    "jobId": "wf-123e4567-e89b-12d3-a456-426614174000"
  },
  "success": true,
  "message": "string",
  "error": {
    "code": 1.1,
    "message": "string",
    "errorCode": "string",
    "details": {}
  }
}
```

**SDK Code**

```python
import requests

url = "https://integrators.prod.api.tabsplatform.com/v3/contracts/file"

files = { "file": "open('string', 'rb')" }
headers = {"Authorization": "<apiKey>"}

response = requests.post(url, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://integrators.prod.api.tabsplatform.com/v3/contracts/file';
const form = new FormData();
form.append('file', 'string');

const options = {method: 'POST', headers: {Authorization: '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://integrators.prod.api.tabsplatform.com/v3/contracts/file"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://integrators.prod.api.tabsplatform.com/v3/contracts/file")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://integrators.prod.api.tabsplatform.com/v3/contracts/file")
  .header("Authorization", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://integrators.prod.api.tabsplatform.com/v3/contracts/file', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://integrators.prod.api.tabsplatform.com/v3/contracts/file");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]
let parameters = [
  [
    "name": "file",
    "fileName": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://integrators.prod.api.tabsplatform.com/v3/contracts/file")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```