# LinkSquares

> Work with contracts in LinkSquares: find agreements and read their terms, text and files, update terms, tags and notes, and move Finalize agreements and approvals along, with triggers for new and changed agreements, status changes and tasks.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/linksquares

## Actions

### Add note to agreement

Add a note to an agreement in Analyze.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.
- Note (`content`, text, required): The note.
- Author email (`user_email`, text): The email of the LinkSquares user to show as the note's author. Leave empty for the API key's user.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [
      {
        "agreement_id": "example",
        "content": "example",
        "created_at": "example",
        "id": "example",
        "user_id": "example"
      }
    ]
  }
}
```

### Add tag to agreement

Put one of your company's tags on an agreement.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.
- Tag (`tag_id`, text, required): The tag.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "color": "example",
      "id": "example",
      "name": "example"
    }
  }
}
```

### Approve Finalize task

Approve a task in Finalize, such as a legal or finance approval, as the API key's user.

**Inputs**

- Task ID (`task_id`, text, required): The task, from List Finalize tasks or the New Finalize task trigger.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "active": true,
      "agreement_id": "example",
      "approval_type": "example",
      "assignee_ids": [
        "example"
      ],
      "attachment_id": "example",
      "author_id": "example",
      "created_at": "example",
      "due_date": "example",
      "id": "example",
      "name": "example",
      "position": 1,
      "resolver_id": "example",
      "status": "example",
      "text": "example",
      "type": "example"
    }
  }
}
```

### Change Finalize agreement status

Move an agreement in Finalize to another status, such as In Review or Ready for Signature.

**Inputs**

- Finalize agreement (`finalize_agreement_id`, text, required): The agreement in Finalize. Pick one, or give its ID from an earlier step.
- Status (`status_id`, text, required): The status to move it to.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "analyze_agreement_id": "example",
      "author_id": "example",
      "collaborator_ids": [
        "example"
      ],
      "created_at": "example",
      "id": "example",
      "kind": "example",
      "name": "example",
      "owner_id": "example",
      "pen": {
        "assigned_to_counterparty": true,
        "holder_ids": [
          "example"
        ]
      },
      "question_ids": [
        "example"
      ],
      "status_id": "example",
      "status_updated_at": "example",
      "template_id": "example",
      "token_value_ids": [
        "example"
      ]
    }
  }
}
```

### Comment on Finalize agreement

Add a comment to an agreement in Finalize, for its owner and collaborators to see.

**Inputs**

- Finalize agreement (`finalize_agreement_id`, text, required): The agreement in Finalize. Pick one, or give its ID from an earlier step.
- Comment (`text`, text, required): The comment.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "author_id": "example",
      "commentable_id": "example",
      "created_at": "example",
      "id": "example",
      "text": "example"
    }
  }
}
```

### Create tag

Create a tag your company can put on agreements.

**Inputs**

- Name (`name`, text, required): The tag's name.
- Color (`color`, text): The tag's color. One of: `blue`, `green`, `red`, `purple`, `dark_blue` (Dark blue), `smart_green` (Smart green), `aqua`, `orange`, `yellow`, `light_gray` (Light gray), and 7 more.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "agreements_count": 1,
      "color": "example",
      "id": "example",
      "name": "example"
    }
  }
}
```

### Delete tag

Delete a tag from your company's tags. It comes off every agreement that has it.

**Inputs**

- Tag (`tag_id`, text, required): The tag.

**Outputs**

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

**Example output**

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

### Get agreement

Get an agreement's details from Analyze: its name, file name, type, tags, terms (such as Effective Date or Renewal Date) and its parent and child agreements.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "child_agreements": [
      {
        "id": "example"
      }
    ],
    "enqueued_at": "example",
    "finalize_agreement_id": "example",
    "id": "example",
    "name": "example",
    "original_name": "example",
    "parent_agreement_id": "example",
    "tags": [
      {
        "id": "example",
        "name": "example"
      }
    ],
    "terms": [
      {
        "id": "example",
        "kind": "example",
        "name": "example",
        "status": "example",
        "value": "example"
      }
    ],
    "type": {
      "id": "example",
      "name": "example"
    },
    "updated_date": "example",
    "upload_date": "example",
    "uploaded_by": "example"
  }
}
```

### Get agreement family

Get an agreement with its parent and the agreements under it, such as the amendments and order forms under a master agreement, with their effective and upload dates.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "agreement_id": "example",
    "children": [
      {
        "agreement_id": "example",
        "children": [
          {}
        ],
        "effective_date": "example",
        "name": "example",
        "upload_date": "example"
      }
    ],
    "effective_date": "example",
    "name": "example",
    "upload_date": "example"
  }
}
```

### Get agreement file link

Get a short-lived link to download an agreement's file.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.
- Keep the original file name (`use_original_name`, true/false): Name the file as it was uploaded, rather than with the name LinkSquares gave it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "url": "example"
    }
  }
}
```

### Get agreement text

Get the full text of an agreement's file, ready to search or hand to an AI step.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "content": "example"
    }
  }
}
```

### Get current user

Get the email of the LinkSquares user the API key belongs to, and whether the API is up.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "status": "example",
    "timestamp": "example",
    "whoami": "example"
  }
}
```

### Get Finalize agreement

Get an agreement in Finalize with its status, owner, collaborators, who holds the pen, and its questions and answers.

**Inputs**

- Finalize agreement (`finalize_agreement_id`, text, required): The agreement in Finalize. Pick one, or give its ID from an earlier step.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "_embedded": {
      "questions": [
        {}
      ],
      "statuses": [
        {
          "description": "example",
          "id": "example",
          "internal_enum": "example",
          "name": "example"
        }
      ],
      "token_values": [
        {}
      ],
      "users": [
        {
          "email": "example",
          "first_name": "example",
          "id": "example",
          "last_name": "example"
        }
      ]
    },
    "data": {
      "analyze_agreement_id": "example",
      "author_id": "example",
      "collaborator_ids": [
        "example"
      ],
      "created_at": "example",
      "id": "example",
      "kind": "example",
      "name": "example",
      "owner_id": "example",
      "pen": {
        "assigned_to_counterparty": true,
        "holder_ids": [
          "example"
        ]
      },
      "question_ids": [
        "example"
      ],
      "status_id": "example",
      "status_updated_at": "example",
      "template_id": "example",
      "token_value_ids": [
        "example"
      ]
    }
  }
}
```

### Get Finalize version file link

Get a short-lived link to download one version of an agreement's document from Finalize.

**Inputs**

- Finalize agreement (`finalize_agreement_id`, text, required): The agreement in Finalize. Pick one, or give its ID from an earlier step.
- Version ID (`version_id`, text, required): The version, from List Finalize agreement versions.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "url": "example"
  }
}
```

### List agreement terms

List an agreement's terms, the values LinkSquares keeps for it such as Effective Date, Expiration Date or Auto-Renewal, with whether each was found by AI or set by a person.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.
- Term name (`name`, text): Only the term with exactly this name, such as Effective Date. Case matters.
- Sort by (`sort_by`, text): How to sort them. One of: `name` (Name, A to Z), `-name` (Name, Z to A).
- How many (`page_size`, number): How many to return, 1 to 100. From 1 to 100.
- Next page cursor (`cursor`, text): The next_cursor from the last page, to get the page after it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "next_cursor": "example",
    "page_size": 1,
    "terms": [
      {
        "id": "example",
        "kind": "example",
        "name": "example",
        "status": "example",
        "value": "example"
      }
    ]
  }
}
```

### List agreements

List agreements in Analyze, LinkSquares' repository of signed contracts, with their type, tags and terms. Filter by type, tags or the date they last changed.

**Inputs**

- Agreement type (`agreement_type`, text): Only agreements of this type, such as Master Agreement.
- Tags (`tags`, list): Only agreements that have every one of these tags.
- Updated since (`updated_since`, date): Only agreements updated on or after this day.
- Sort by (`sort_by`, text): How to sort them. Leave empty for LinkSquares' default order. One of: `-updated_date` (Recently updated first), `updated_date` (Least recently updated first), `-upload_date` (Newest uploads first), `upload_date` (Oldest uploads first), `name` (Name, A to Z), `-name` (Name, Z to A).
- How many (`page_size`, number): How many to return, 1 to 100. From 1 to 100.
- Next page cursor (`cursor`, text): The next_cursor from the last page, to get the page after it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "agreements": [
      {
        "child_agreements": [
          {
            "id": "example"
          }
        ],
        "enqueued_at": "example",
        "finalize_agreement_id": "example",
        "id": "example",
        "name": "example",
        "original_name": "example",
        "parent_agreement_id": "example",
        "tags": [
          {
            "id": "example",
            "name": "example"
          }
        ],
        "terms": [
          {
            "id": "example",
            "kind": "example",
            "name": "example",
            "status": "example",
            "value": "example"
          }
        ],
        "type": {
          "id": "example",
          "name": "example"
        },
        "updated_date": "example",
        "upload_date": "example",
        "uploaded_by": "example"
      }
    ],
    "count": 1,
    "next_cursor": "example",
    "page_size": 1
  }
}
```

### List clauses

List the clauses in your clause library, with their text, notes and the agreement each came from.

**Inputs**

- Category (`clause_category_id`, text): Only clauses in this category.
- Clause name (`name`, text): Only the clause with exactly this name. Case matters.
- Sort by (`sort_by`, text): How to sort them. One of: `name` (Name, A to Z), `-name` (Name, Z to A).
- How many (`page_size`, number): How many to return, 1 to 100. From 1 to 100.
- Next page cursor (`cursor`, text): The next_cursor from the last page, to get the page after it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "clauses": [
      {
        "agreement_id": "example",
        "author_name": "example",
        "clause_category_id": "example",
        "created_at": "example",
        "id": "example",
        "name": "example",
        "note": "example",
        "text": "example",
        "updated_at": "example"
      }
    ],
    "count": 1,
    "next_cursor": "example",
    "page_size": 1
  }
}
```

### List Finalize agreement versions

List the versions of an agreement's document in Finalize, newest drafts included, with the status each was saved in.

**Inputs**

- Finalize agreement (`finalize_agreement_id`, text, required): The agreement in Finalize. Pick one, or give its ID from an earlier step.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "_links": {
      "next": {
        "href": "example"
      },
      "prev": {
        "href": "example"
      }
    },
    "data": [
      {
        "created_at": "example",
        "deleted_at": "example",
        "file_name": "example",
        "id": "example",
        "status_id": "example"
      }
    ],
    "total_count": 1
  }
}
```

### List Finalize agreements

List agreements in Finalize, LinkSquares' drafting and approval workspace, filtered by name, status, template or when they were created or changed status.

**Inputs**

- Name contains (`name`, text): Only agreements whose name contains this.
- Statuses (`status_ids`, list): Only agreements in these statuses.
- Templates (`template_ids`, list): Only agreements made from these templates or request forms.
- Created after (`created_after`, date and time): Only agreements created after this time.
- Created before (`created_before`, date and time): Only agreements created before this time.
- Status changed after (`status_changed_after`, date and time): Only agreements whose status changed after this time.
- Page (`page`, number): Which page to get. Leave empty for the first. At least 1.
- Per page (`per_page`, number): How many to return per page. Leave empty for 10. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "_links": {
      "next": {
        "href": "example"
      },
      "prev": {
        "href": "example"
      }
    },
    "data": [
      {
        "analyze_agreement_id": "example",
        "author_id": "example",
        "collaborator_ids": [
          "example"
        ],
        "created_at": "example",
        "id": "example",
        "kind": "example",
        "name": "example",
        "owner_id": "example",
        "pen": {
          "assigned_to_counterparty": true,
          "holder_ids": [
            "example"
          ]
        },
        "question_ids": [
          "example"
        ],
        "status_id": "example",
        "status_updated_at": "example",
        "template_id": "example",
        "token_value_ids": [
          "example"
        ]
      }
    ],
    "total_count": 1
  }
}
```

### List Finalize tasks

List approval and other tasks in Finalize, filtered by agreement, status or whether they are still open.

**Inputs**

- Name contains (`name`, text): Only tasks whose name contains this.
- Open (`active`, true/false): Only open tasks (on), or only closed ones (off). Leave empty for both.
- Statuses (`statuses`, list): Only tasks with these statuses. One or more of: `unreviewed` (Waiting for review), `approved`, `rejected`.
- Finalize agreements (`finalize_agreement_ids`, list): Only tasks on these agreements.
- Page (`page`, number): Which page to get. Leave empty for the first. At least 1.
- Per page (`per_page`, number): How many to return per page. Leave empty for 10. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "_links": {
      "next": {
        "href": "example"
      },
      "prev": {
        "href": "example"
      }
    },
    "data": [
      {
        "active": true,
        "agreement_id": "example",
        "approval_type": "example",
        "assignee_ids": [
          "example"
        ],
        "attachment_id": "example",
        "author_id": "example",
        "created_at": "example",
        "due_date": "example",
        "id": "example",
        "name": "example",
        "position": 1,
        "resolver_id": "example",
        "status": "example",
        "text": "example",
        "type": "example"
      }
    ],
    "total_count": 1
  }
}
```

### List Finalize templates

List the templates and request forms agreements are made from in Finalize.

**Inputs**

- Name contains (`name`, text): Only templates whose name contains this.
- Kinds (`kinds`, list): Only templates of these kinds. One or more of: `draft` (Draft (from a template)), `intake` (Intake (third-party paper)), `request_form` (Request form).
- Page (`page`, number): Which page to get. Leave empty for the first. At least 1.
- Per page (`per_page`, number): How many to return per page. Leave empty for 10. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "_links": {
      "next": {
        "href": "example"
      },
      "prev": {
        "href": "example"
      }
    },
    "data": [
      {
        "created_at": "example",
        "description": "example",
        "id": "example",
        "kind": "example",
        "name": "example",
        "updated_at": "example"
      }
    ],
    "total_count": 1
  }
}
```

### List tags

List your company's tags with their colors and how many agreements have each.

**Inputs**

- Tag name (`name`, text): Only the tag with exactly this name. Case matters.
- Sort by (`sort_by`, text): How to sort them. One of: `name` (Name, A to Z), `-name` (Name, Z to A).
- How many (`limit`, number): How many to return, 1 to 100. From 1 to 100.
- Next page cursor (`cursor`, text): The next_cursor from the last page, to get the page after it.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "_links": {},
    "data": [
      {
        "agreements_count": 1,
        "color": "example",
        "id": "example",
        "name": "example"
      }
    ],
    "next_cursor": "example",
    "total_count": 1
  }
}
```

### Remove tag from agreement

Take a tag off an agreement. The tag itself is kept.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.
- Tag (`tag_id`, text, required): The tag.

**Outputs**

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

**Example output**

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

### Update agreement

Rename an agreement in Analyze, change its type, or file it under a parent agreement. Fields left empty stay as they are.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.
- Name (`name`, text): A new name for the agreement.
- Agreement type (`type_id`, text): A new agreement type.
- Parent agreement (`parent_agreement_id`, text): The agreement to file this one under, such as the master agreement an amendment belongs to.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "child_agreements": [
        {
          "id": "example"
        }
      ],
      "id": "example",
      "name": "example",
      "original_name": "example",
      "parent_agreement_id": "example",
      "tag_ids": [
        "example"
      ],
      "term_ids": [
        "example"
      ],
      "type_id": "example",
      "updated_date": "example",
      "upload_date": "example",
      "uploaded_by": "example"
    }
  }
}
```

### Update agreement term

Set the value of one of an agreement's terms, such as its Renewal Date.

**Inputs**

- Agreement (`agreement_id`, text, required): The agreement in Analyze. Pick one, or give its ID from an earlier step.
- Term (`term_id`, text, required): The term, such as Effective Date. Pick one, or give its ID from List agreement terms.
- Value (`value`, text, required): The new value. Give a date as YYYY-MM-DD, and a checkbox as true or false.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "id": "example",
      "kind": "example",
      "name": "example",
      "status": "example",
      "value": "example"
    }
  }
}
```
