Skip to content
Last updated

Creating contracts

Provides documentation and guidance on how to upload a contract using the LawVu API

This guide explains how to create a new contract using the LawVu API. There are two main approaches:

  • File Creation: For all contract types, you must first upload a contract document and provide its ID when creating the contract.

  • Wizard Creation: For contract types which support a wizard (document template), you can create a contract without uploading a document.

    For more details on contract wizards, refer to the Contract wizard help page.


Getting contract types

Before creating a contract, you need to determine which contract type to use.

You can retrieve a list of all available contract types for your organization using the /v2/contractTypes endpoint.

Request:

GET /v2/contractTypes
Authorization: Bearer <your_access_token>

Response:

{
  "items": [
    {
      "id": 1234,
      "name": "Contractor Agreement",
      "hasWizard": false,
      "teamAssignmentRequired": true,
      "parent": {
        "id": 5002,
        "name": "Employment"
      }
    },
    {
      "id": 5678,
      "name": "NDA",
      "hasWizard": true,
      "teamAssignmentRequired": false,
      "parent": null
    }
  ]
}

Use the hasWizard property to determine which creation method to use:

  • hasWizard: false - Use File Creation (upload document first)
  • hasWizard: true - Use Wizard Creation (no document required) or File Creation (upload document first)

For more details, refer to the Contract Types API documentation and Contract types and groups help page


Creating a contract with a file

For contract types that do not support a wizard, you need to upload a contract document first.

Upload Contract Document

For more details, refer to the Files guide for Contract creation or the Files API documentation

Request:

POST /v2/files
Authorization: Bearer <your_access_token>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="contract.pdf"
Content-Type: application/pdf

<Binary file contents>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="targetResourceType"

ContractCreation
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Response:

{
  "id": 9456 // The file ID
}

Create Contract Using File

After uploading the document, use the selected Contract Type ID and the ID of the created file to create the contract:

POST /v2/contracts
Authorization: Bearer <your_access_token>
Content-Type: application/json

{
  "type": { "id": 1234 },
  "name": "Service Agreement",
  "document": { "id": 9456 },
  "fields": {
    "my_text_field": "my text value",
    "my_option_field": {
      "value": "option_1"
    }
  }
}

Response:

{
  "id": 789 // The contract ID
}

Wizard-based contract creation

Some contract types have a wizard (document template), allowing you to create a contract without providing a document.

For contract types with hasWizard: true, use the following request to create a contract. The field values provided may be used by the wizard to populate the document:

Request:

POST /v2/contracts
Authorization: Bearer <your_access_token>
Content-Type: application/json

{
  "type": { "id": 5678 },
  "name": "NDA",
  "fields": {
    "my_text_field": "my text value",
    "my_option_field": {
      "value": "option_1"
    }
  }
}

Response:

{
  "id": 123 // The contract ID
}

For more details, refer to the Create Contract API documentation.