# Contractbook

> Read contracts, browse templates, and create contract drafts.

App · 9 actions. Web page: https://docs.lodol.com/docs/integrations/contractbook

## Actions

### Create a document from a template

Create a document from a template.

**Inputs**

- Template (`template_id`, text, required): Template ID
- Document (`document`, object): Document parameters

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "document": {
      "attachments": [
        {}
      ],
      "comments": [
        {}
      ],
      "company_logo_url": "example",
      "created_at": "example",
      "data_fields": [
        {}
      ],
      "events": [
        {}
      ],
      "id": "example",
      "language": "ar",
      "ocr_status": "none",
      "owner": {
        "email": "example",
        "full_name": "example",
        "id": "example"
      },
      "parties": [
        {}
      ],
      "sample": true,
      "shared": true,
      "signed_at": "example",
      "signing_order_mode": "random",
      "source_template_id": "example",
      "state": "draft",
      "tags": [
        "example"
      ],
      "template": {},
      "title": "example",
      "to_be_signed_by": "owner_and_others",
      "type": "draft",
      "updated_at": "example",
      "version": "example",
      "visibilities": [
        {}
      ],
      "workspace": {
        "id": "example",
        "name": "example",
        "permissions": [
          "view_documents"
        ]
      }
    }
  }
}
```

### Delete a document

Delete a document.

**Inputs**

- Document (`document_id`, text, required): Document ID

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {}
}
```

### Get a document

Get a document.

**Inputs**

- Document (`document_id`, text, required): Document ID

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "document": {
      "attachments": [
        {}
      ],
      "comments": [
        {}
      ],
      "company_logo_url": "example",
      "created_at": "example",
      "data_fields": [
        {}
      ],
      "events": [
        {}
      ],
      "id": "example",
      "language": "ar",
      "ocr_status": "none",
      "owner": {
        "email": "example",
        "full_name": "example",
        "id": "example"
      },
      "parties": [
        {}
      ],
      "sample": true,
      "shared": true,
      "signed_at": "example",
      "signing_order_mode": "random",
      "source_template_id": "example",
      "state": "draft",
      "tags": [
        "example"
      ],
      "template": {},
      "title": "example",
      "to_be_signed_by": "owner_and_others",
      "type": "draft",
      "updated_at": "example",
      "version": "example",
      "visibilities": [
        {}
      ],
      "workspace": {
        "id": "example",
        "name": "example",
        "permissions": [
          "view_documents"
        ]
      }
    }
  }
}
```

### Get a space tree

Get a space tree.

**Inputs**

- Space ID (`space_id`, text, required): Space ID

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "id": "example",
    "name": "example",
    "spaces": [
      {
        "id": "example",
        "name": "example",
        "spaces": [
          {}
        ]
      }
    ]
  }
}
```

### Get a template

Get a template.

**Inputs**

- Template (`template_id`, text, required): Template ID

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "template": {
      "attachments": [
        {}
      ],
      "company_logo_url": "example",
      "created_at": "example",
      "data_fields": [
        {}
      ],
      "default_message": "example",
      "description": "example",
      "id": "example",
      "language": "example",
      "owned": true,
      "owner_id": "example",
      "parties": [
        {}
      ],
      "signing_order_mode": "random",
      "slug": "example",
      "template": {},
      "title": "example",
      "updated_at": "example"
    }
  }
}
```

### List automations

List automations.

**Inputs**

- Trigger type (`trigger_type`, text, required): Trigger type. One of: `webhook_trigger` (Webhook trigger), `hubspot_contractbook_automation_triggered` (Hubspot contractbook automation triggered), `hubspot_deal_stage_changed` (Hubspot deal stage changed), `contract_signed` (Contract signed), `contract_verified_ai` (Contract verified ai), `contract_viewed` (Contract viewed), `data_field_date_reached` (Data field date reached), `data_field_updated` (Data field updated), `draft_created` (Draft created), `draft_updated` (Draft updated), and 7 more.
- Trigger filter (`trigger_filter`, object): Trigger filter.

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "automations": [
      {
        "id": "example",
        "inserted_at": "example",
        "name": "example",
        "published": true,
        "updated_at": "example"
      }
    ]
  }
}
```

### List documents

List documents.

**Inputs**

- Title (`title`, text): Filter by document title (case insensitive partial match)
- Owned (`owned`, true/false): Whether to look for documents owned by the requester or not
- Cursor (`cursor`, text): Page identifier. The next page identifier will be found in the response body
- Signed at lt (`signed_at_lt`, date and time): Filter by maximum date when the documents were signed (non-inclusive)
- Signed at gte (`signed_at_gte`, date and time): Filter by minimum date when the documents were signed (inclusive)
- Updated at lt (`updated_at_lt`, date and time): Filter by maximum date when the documents were updated (non-inclusive)
- Updated at gte (`updated_at_gte`, date and time): Filter by minimum date when the documents were updated (inclusive)
- Page size (`page_size`, number): Page size. The default is 25 and the max value is 100. From 0 to 100.
- Sort column (`sort_column`, text): Column to use for sorting the documents (defaults to `created_at`). One of: `created_at` (Created at), `updated_at` (Updated at), `title`.
- Sort direction (`sort_direction`, text): Order direction when sorting the documents. One of: `asc`, `desc`.

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "documents": [
      {
        "active_task_count": 1,
        "comment_count": 1,
        "completed_task_count": 1,
        "created_at": "example",
        "data_fields": [
          {}
        ],
        "folders": [
          {}
        ],
        "id": "example",
        "ocr_status": "none",
        "owner": {},
        "parties": [
          {}
        ],
        "sample": true,
        "signed_at": "example",
        "signing_order_mode": "random",
        "state": "draft",
        "tags": [
          "example"
        ],
        "title": "example",
        "to_be_signed_by": "owner_and_others",
        "type": "draft",
        "updated_at": "example",
        "version": "example",
        "visibilities": [
          {}
        ],
        "workspace": {}
      }
    ],
    "pagination_meta": {
      "cursor": "example"
    }
  }
}
```

### List templates

List templates.

**Inputs**

- Exclude spaces (`exclude_spaces`, true/false): Exclude templates from Spaces
- Integration filter (`integration_filter`, object): Exclude templates not connected to an external application according to the given rules

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "templates": [
      {
        "created_at": "example",
        "description": "example",
        "id": "example",
        "language": "example",
        "location": {},
        "owned": true,
        "owner_id": "example",
        "slug": "example",
        "title": "example",
        "updated_at": "example"
      }
    ]
  }
}
```

### Update a document

Update a document.

**Inputs**

- Document (`document_id`, text, required): Document ID
- Document (`document`, object, required): Document parameters

**Outputs**

- `data` (object): The response from Contractbook.

**Example output**

```json
{
  "data": {
    "document": {
      "attachments": [
        {}
      ],
      "comments": [
        {}
      ],
      "company_logo_url": "example",
      "created_at": "example",
      "data_fields": [
        {}
      ],
      "events": [
        {}
      ],
      "id": "example",
      "language": "ar",
      "ocr_status": "none",
      "owner": {
        "email": "example",
        "full_name": "example",
        "id": "example"
      },
      "parties": [
        {}
      ],
      "sample": true,
      "shared": true,
      "signed_at": "example",
      "signing_order_mode": "random",
      "source_template_id": "example",
      "state": "draft",
      "tags": [
        "example"
      ],
      "template": {},
      "title": "example",
      "to_be_signed_by": "owner_and_others",
      "type": "draft",
      "updated_at": "example",
      "version": "example",
      "visibilities": [
        {}
      ],
      "workspace": {
        "id": "example",
        "name": "example",
        "permissions": [
          "view_documents"
        ]
      }
    }
  }
}
```
