What's New
01/15/2025: Added endpoint to retrieve additional attachments.
To learn more about this new endpoint, reference this article on How to Retrieve Attachments
Overview
The following sections outline the available endpoints in the LinkSquares Analyze API and demonstrate how these endpoints can be used to accomplish the desired functionality.
Note: This is not an exhaustive list of use cases or workflows.
Setup and Access
To learn more about setting up and authenticating the API key, reference our article on Managing API Keys.
Retrieving Metadata
The Analyze Retrieve Metadata endpoint allows you to extract all metadata (Smart Values, Terms, Types, Tags) from your Analyze agreements in bulk or individually in a JSON format that can be easily parsed and stored in the system of your choice.
GET https://api.linksquares.com/api/analyze/v1/me
Returns information about the current user that the API is assigned to and the status of the server.
Response Body
{
"whoami": "email@linksquares.com",
"status": "up",
"timestamp": "2022-09-17T19:46:27Z"
}
Retrieving Agreements
Retrieving Agreements by ID
This endpoint returns an object representing a single agreement.
GET https://api.linksquares.com/api/analyze/v1/agreements/{agreement_id}
{agreement_id} – Unique Agreement ID (e.g., 9974c980-35f1-11ed-ad58-dbaa75f119af)
Response Body
{
"id":"9974c980-35f1-11ed-ad58-dbaa75f119af",
"name":"Analyze Master Service Agreement via API 091622_1014",
"original_name":"Analyze Master Service Agreement via API 091622_1014",
"updated_date":"2022-09-16T15:00:51.134-04:00",
"upload_date":"2022-09-16T14:58:49.631-04:00",
"uploaded_by":"LinkSquares Team",
"type":{
"id":"25566752-febf-11ec-b885-7b048d2b9cf8",
"name":"Master Agreement"
},
"tags":[{
"name":"Name"
},
{
"name":"Linksquare. Inc."
},
{
"name":"2019"
},
{
"name":"Procurement"
},
{
"name":"License"
},
{
"name":"3rd-Party Software"
},
{
"name":"Channel Partner"
}],
"terms":[{
"value":"",
"name":"Non-Solicitation Clause",
"kind":"text",
"status":"AI Not Present"
},
{
"value":"true",
"name":"Termination For Convenience",
"kind":"checkbox",
"status":"AI Present"
}"..."
Retrieving All Agreements
This endpoint returns a list of all agreements. The maximum number of agreements that can be retrieved per request is 100. To retrieve the next page of data, use the "cursor" string.
GET https://api.linksquares.com/api/analyze/v1/agreements
cURL Code Snippet
curl
--location
--request GET 'https://api.linksquares.com/api/analyze/v1/agreements/' \
--header 'x-api-key: {
x-api-key
}' \
--header 'original_name: null' \
--header 'next_cursor: 5c7ce3c2-fe34-11ec-b8fc-fb6154b5ef98' \
--data-raw ''
Additional Parameters
type - Specify an agreement type name to filter results by agreement type. This parameter is case-sensitive.
Example:
GET https://api.linksquares.com/api/analyze/v1/agreements?type=Master+Agreement
Returns a list of all agreements where the type is Master Agreement.
Note: Use the "cursor" string to retrieve the next result set if applicable.
tags - Specify comma-separated tags to return agreements with all tags requested. This parameter is case-sensitive.
Example:
GET https://api.linksquares.com/api/analyze/v1/agreements?tags=2021
Retrieves all agreements with the tag “2021."
tags_delimiter - Specify a delimiter to separate tags. Acceptable delimiters include commas, periods, underscores (_), hyphens (-), and tildes (~).
after_date - Returns all agreements updated after the specified date. The date should be written in the yyyy-mm-dd format.
Example:
GET https://api.linksquares.com/api/analyze/v1/agreements?after_date=2022-09-12
Returns all agreements updated after 2022-09-12.
sort_by - Returns a list of agreements sorted by name, updated_date, or upload_date. Prepend the attribute you want to sort by with a hyphen (-) to organize the list in descending order (e.g., -name, -updated_date, -upload_date).
Example:
GET https://api.linksquares.com/api/analyze/v1/agreements?sort_by=-upload_date
Returns a list of agreements in descending order by the date they were uploaded.
cursor - Use the cursor parameter from the previous response to get the next page of data
Example:
GET https://api.linksquares.com/api/analyze/v1/agreements/?cursor={{next_cursor}}
page_size - Specify the page size of the results. Page size can range from 1 to 100.
Retrieving Parent-Child Hierarchies
This endpoint provides a JSON hash of the parent-child hierarchy of the called agreement, including agreement IDs and agreement names.
All agreements contain a new attribute, parent_agreement_id, displayed in the JSON response. The parent_agreement_id will either display the agreement ID of the parent agreement or display “null” if there is no hierarchy.
GET /api/analyze/v1/agreements/{agreement_id}/hierarchy
cURL Code Snippet
curl
--location
--request GET 'https://api.linksquares.com/api/analyze/v1/agreements/adced6d4-a0e3-11ed-878c-bfae10d59d38/hierarchy' \
--header 'x-api-key: x-api-key‘ \
--header 'upload_id: null' \
--data-raw ''
Response Body
{
"name": "Linksquare MSA",
"effective_date": "2013-03-06",
"agreement_id": "f8be4b88-0ec2-11ed-996c-2be04309b9b8",
"upload_date": "2022-07-28T18:16:47-04:00",
"children": [{
"name": "Linksquare MSA 2023",
"effective_date": "2023-01-31",
"agreement_id": "adced6d4-a0e3-11ed-878c-bfae10d59d38",
"upload_date": "2023-01-30T16:18:45-05:00",
"children": [{
"name": "Non Disclosure Agreement 2023",
"effective_date": "2013-03-06",
"agreement_id": "710b6180-a0e4-11ed-9842-13dd14ded7d0",
"upload_date": "2023-01-30T16:24:12-05:00",
"children": []
}]
}]
}
Importing Agreements
Import your DOCX or PDF files from external systems directly into LinkSquares Analyze, along with any pre-specified metadata values (e.g., terms, types, tags). This enables you to send documents to Analyze for processing, while also capturing key data points from your source system for additional context.
Creating Agreements
Creating an agreement via the Analyze API is a two-step process.
The first step requires a POST call to send the filename and other metadata to the server. In return, an upload URL is returned upon a successful response (200 OK).
Other metadata that can be added to the agreement during this step includes required information like the agreement type and agreement tags as well as optional information like the ID for the parent agreement, if applicable.
The second step is to issue a PUT call to the presigned URL server to upload the agreement document (DOCX, PDF).
Note: The File Upload Object must have a type of binary. Base64 encoded files are not supported.
For more information, reference the latest AmazonS3 technical document.
Step 1: Creating Agreement Metadata and Filename
cURL Code Snippet
curl
--location
--request POST 'https://api.linksquares.com/api/analyze/v1/agreements/' \
--header 'Content-Type: application/json' \
---data-raw '{
"name": "Master Service Agreement 2023",
"file_name": "MSA 2023.pdf",
"agreement_type": "Master Service Agreement",
"parent_agreement_id": "c8e43a04-7d52-11ed-bde5-7ff974acf098",
"tags": ["2023",
"Channel Partner"],
"terms": [{
"name": "Effective Date",
"value": "2023-01-31"
},
{
"name": "Contract Expiry Date",
"value": "2024-01-31"
},
{
"name": "Agreement Owner",
"value": "Name"
},
{
"name": "Governing Law",
"value": "Massachusetts"
},
{
"name": "Account Number",
"value": "12345"
},
{
"name": "Account Number",
"value": "East Division"
},
{
"name": "Contract Term (months)",
"value": "12"
},
{
"name": "Automatic Renewal",
"value": "true"
}'
Response Body
{
"upload_id": "08480738-a0d1-11ed-8e3f-9b128f7aebb6",
"name": "Master Service Agreement 2023_013023_14:04",
"file_name": "MSA 2023.pdf",
"type": "Master Service Agreement",
"status": "Initialized",
"url": "https://linksquares-agreement-api-upload-production.s3.amazonaws.com/2b8423ee-fd70-11ec-abd0-e310340c87c4/08480738-a0d1-11ed-8e3f-9b128f7aebb6/Dean%20and%20DeLuca%20MSA%202023.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIARMR2V427KLYFC6ZI%2F20230130%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230130T190516Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEBkaCXVzLWVhc3QtMSJHMEUCIBCfyt6WfCvJJJ3GUQ7XVvfvtCfkaPO3VXvrSZYd496qAiEA8ePYTMpr4HepwZ%2B6J8OUEl4VwZf94aciQnUneisK%2F7Qq7AMIkv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAFGgwwOTU2ODYwOTI0NzgiDPtTZNWARvLsSS62aCrAAwJAprmBmraJj1sv6ZU1e%2BQKwQfOsdMF4mI0SS3HAYaFbCKXjqK7Xv3ceGoBljECX%2FVsSCBvapLuCBdK%2BsGwfx5M1EutXXXHi2oQNvcx2RLsoW1QuXBTOctECUtFgLNiMfXlFGdRyEB8HHPxi8pZc7wdm3X9sP%2FxrDAhvZjNGe2SeOMlJOORPtr0VbPFB2drT5oQGLpBfbD2V4ZoQK3HDAVqfCpJtkO1gY2zcXLjIcwRiij36eR%2FWiCEyK4qskMckAUFDMvCghScAs6iT0B3fWLC2HD2XDJMfh33FKikg9j1xfSPauYVYa4JwiNr0eBxsi8j6H82X7LE8%2FAgASqfV%2FzjOywbqYaMAs14bXSF7rfJBQDqCD5ZTwj678DTg%2F8KTIHYCTrnY3wfOMlAzFRWI4cliLE1Ahx8%2Bb96Om%2Fh7bltevHse3HUfc5jSBcp9pRmZvxepQ51u89mIdqAw9JERm3mifq0jXMlDS5pVhVRt6b95hNM3pFJ8AUXDABbaZG9hJwNVYPoABmTd6UxhwkW%2FSjt5%2FlGwOW4fuwObLx3LXinz0aEyPB1aI%2B72Vfq9ZPkXFeeziXONCBmD5GiGhumlHow9effngY6pQGdkUKpZZX3p1Nad6k2MC98G9vzKsF4w3%2FQla5F0VzkEv6Z%2Bo21L%2BfW7I%2FkcX6xnYXFqImmGYV0FJS2QgBH8fshuQafe3T8kNarxERBtc3iRgdi4QxH0crol16rkAkVZyn6mfZR6wSzYPF5ed9LX60cJYmH%2FiFBQTWnPEapasTMHCBODraYt0l3PrP2ka6qlZjmqqUEKIbNRLxJwf8UkIaQNsyvu8I%3D&X-Amz-Signature=c0fab4ee2b2f5d1a683865f057271ee3a503f73eb414997039ddf8f83589e0c6",
"tags": ["2023",
"Channel Partner"],
"terms": [{
"name": "Effective Date",
"value": "2023-01-31"
},
{
"name": "Contract Expiry Date",
"value": "2024-01-31"
},
{
"name": "Agreement Owner",
"value": "Name"
},
{
"name": "Governing Law",
"value": "Massachusetts"
},
{
"name": "Account Number",
"value": "12345"
},
{
"name": "Account Number",
"value": "East Division"
},
{
"name": "Contract Term (months)",
"value": "12"
},
{
"name": "Automatic Renewal",
"value": "true"
}],
"parent_agreement_id": "c8e43a04-7d52-11ed-bde5-7ff974acf098"
}
Step 2: Sending the URL and File
PUT {
url
}payload="<binary file>"headers = {
'x-api-key': '{
x-api-key',
'Content-Type': application/pdf or application/vnd.openxmlformats-officedocument.wordprocessingml.documentcURL Code Snippetcurl --location --request PUT ‘{
url
}’--header 'x-api-key: {
x-api-key
}' \--header 'Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document' \--data-binary '@test.docx'
Response Body
200 OK (success)
Note: The presigned URL is only valid for 15 minutes. To avoid the request timing out, issue the PUT command immediately after sending the POST call.
Adding Agreement Attachments
This endpoint allows you to add an attachment to an existing agreement.
The endpoint accepts a file name and responds with an upload URL to be used to upload the attachment.
The supported file types are as follows.
CSV | DOC | DOCX | |
TXT | XLS | XLSX |
Adding an additional file to an existing agreement is a two-step process similar to creating an agreement.
A presigned URL is returned upon success for subsequent file upload via a POST call.
Execute a PUT request to the presigned URL returned with {attachment_upload_url} and the file to be added.
For more information see the latest AmazonS3 technical document.
Step 1: Creating Agreement Attachments
POST https://api.linksquares.com/api/analyze/v1/agreements/{agreement_id}/attachments{"file_name": "Name of the file to upload.extension"}
Response Body
200 OK (success)
{
"attachment_upload_url": "https://linksquares-attachment-api-upload-production.s3.amazonaws.com/2b8423ee-fd70-11ec-abd0-e310340c87c4/026334f0-7a22-47ba-aa45-9a635848a86d/Dean_%26_DeLuca_SaaS_Master_Agreement_with_Fees_Clause.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIARMR2V427IWAUHRGX%2F20221110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221110T225226Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEIX%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJGMEQCIBcLhoq5XDmgi%2B8FuZizWHEtXYTad6jdnB9yIXBrPagaAiBPsWA%2B6AACdbUAGIKP0GY%2FEnKUgEokAogJyBNGhiYMXSrjAwh%2BEAUaDDA5NTY4NjA5MjQ3OCIMT4fYuzvek8veFCEOKsADqZsjKzi7uI119I7R1dlz4shP3v%2F8XSgjL9TxmUgZOcaq9r3yn7KoVgCRaB4fbfTYqfl08lDfIMY9jB9AAwRWXxsafQmaSbrKtoDM9Cq0dx8ZyDe61ekW58UF%2BIQKLwpwFjT6NMkZFGt64T6z0FVSReq8OlMUTmUv%2FNE93Ly9LrL0NVDhTZ7yxXYcEQeDP3X7TsfRFvEl0MgwGrsqFL8V3l7kdtNWcPf6MFUTk%2Bg0CVqmabsJoHkidgDjoGd5VKLhLmIGNF0RVg7YPlyEIbiXPYTxmZ%2FPn1dWma1BLNkLPZemsn8Kondy%2BwaD5WaCjs3sBYyRTB23kGWUOzmRG2kEybz01hOGFUZ9Qie%2FwVq4wmGK2emw3MFZR5qmmKfKsTStqiBHR84iv0CItV3i8R7tGbQbgZkCIwaCtLh67UaRM9AzdNroFW3STNZLJoQ9TJsUSQa8of52fZk9CUO8kT7sZc7BbaSJMla9tgUS%2BYnD1nOQAqjtBs%2BQBgEErfASwhd%2FVC2kBuAXt0W1lds6UQEysHgpoM0YJRYed6b7XjGLQylcGLnW24N7m0vxzieDRHIO3nK6DB5f8vQ147QAaBFYjTDqyrWbBjqmARN%2B5OVIm%2FEpgVoTaWtkT6UlZkJv8Mt0VDzV3ooO9j2Sa5unGzQ2XvStDgx%2FsyN5zVpFMXZ8VmZpcK9xNANTtqBVT8j1Ga9cMOH0JNzM3t%2B4Eh5iNvhKw61HT%2F%2BLxE%2BQIt6QPVQ9Os08uOMLy93REa8w628kpKkhLlU3gLcwfDxTAjF%2FJFbaVGlyGH7lV8YfJNW5rC453ihT7uduSsQ5fHphYwRBxYI%3D&X-Amz-Signature=80bdda3e3419091f71e75085da6e225083ea05c33617547cbd2c2554ddcf284c"
}
Step 2: Sending the Attachment URL and File
PUT {attachment_upload_url}
Include the file to attach to the agreement.
Response Body
200 OK (success)
Note: The presigned URL is only valid for 15 minutes. Issue the PUT command immediately after sending the POST call to avoid the request timing out.
cURL Code Snippet
POST call for filename and {attachment_upload_url}
curl
--location
--request POST 'https://api.linksquares.com/api/analyze/v1/agreements/{agreement_id}/attachments' \
--header 'x-api-key: {
x-api-key}' \
--header 'Content-Type: application/json' \--data-raw '{
"file_name": "<Name of the file to upload (csv,
doc,
docx,
pdf,
txt,
xls,
xlsx>)"
}'
PUT to upload additional document
curl
--location
--request PUT '{
attachment_upload_url
}' \
--header 'x-api-key: {
x-api-key
}' \
--header 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' \
--data-binary 'file.xlsx'
Step 3: Confirming Successful Attachment Upload
Leverage the Upload API endpoint to confirm that the attachment was successfully uploaded.
This API accepts an upload ID from the response of an agreement upload request and returns the status, the agreement ID, and the updated date.
To get the status of the request, issue a GET call using the upload_id.
This command accepts an upload ID from the response of an agreement upload request and returns the status and agreement_id.
GET https://api.linksquares.com/api/analyze/v1/uploads/{upload_id}
Available status values are pending, success, and failed.
A status value of success indicates that the agreement was successfully created in Analyze.
Response Body
{
"upload_id": "40cbd7a8-37b6-11ed-ab0f-0be10736ecf2",
"status": "success",
"agreement_id": "99cd37c0-37b6-11ed-9e9b-9b8cd9316e17",
"updated_date": "2022-09-18T21:01:32.669-04:00"
}
If the attachment file upload is unsuccessful, the status value will read error. One of the following error messages will be returned.
- 'Upload URL expired without receiving a file. Please initiate a new upload.'
- 'File is password protected and not able to be processed'
- 'File name extension does not match the file type received. Please check file type and try again.' (file_name specified PDF or docX has to match the MIME file type in the PUT call to AWS)
- 'Duplicate upload detected.' (Agreement has already been process and uploaded to the system)
- 'File is malformed and may take additional time to process'
- 'LinkSquares was unable to process the file. Please contact support.'
-
'You're not able to nest agreements deeper than 2 levels'
Retrieving Agreement Attachments
This endpoint allows you to retrieve an additional attachment from an existing Analyze agreement.
Retrieving additional files on an existing agreement is a two-step process.
The first step is to execute a GET call to get a list of the file(s) ids attached to the Analyze agreement. The second step is to retrieve the AWS3 link to the attachment.
Step 1: Retrieve Agreement Additional Attachments
GET
https://api.linksquares.com/api/analyze/v2/agreements/{agreement_id}/attachments
Response Body
200 OK (success)
"data": [
{
"id": "3b182a83-5641-4832-93d2-3dcac6efe5z9",
"file_name": "Land Lease Agreement.docx",
"file_size": 14704,
"file_type": "docx",
"uploaded_by": "LinkSquares Team",
"created_at": "2025-01-15T15:14:41Z"
},
{
"id": "afedb873-508e-468e-86eb-ed03156658827",
"file_name": "Statement of Work.pdf",
"file_size": 467207,
"file_type": "pdf",
"uploaded_by": "LinkSquares Team",
"created_at": "2025-01-15T20:40:24Z"
}
],
"total_count": 2,
"_links": {}
}
Step 2: Retrieve Additional Attachment Link(s)
Note: Each Additional attachment has to be retrieved individually.
GET
https://api.linksquares.com/api/analyze/v2/agreements/{agreementid}/attachments/{attachmentid}/download
Response Body
200 OK (success)
{"data":{"url":"https://linksquares-agreement-attachment-production.s3.amazonaws.com/store/4f6b185b4ef1773a84061ea8200e1b88/Land Lease Agreement.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-AWS Info……"}}
Updating Agreements
Currently, users are able to leverage the Update Agreement API endpoints to update the terms, name, type, notes, tags, and parent-child hierarchies associated with an agreement.
Sample use cases for updating each of these data points are available below.
Updating Agreement Terms
Users must first retrieve the ID for the term they would like to update and then leverage the term ID to update the term.
Retrieving Agreement Terms
The Retrieve Agreement Terms API allows users to view a list of all the terms within their LinkSquares environment and their associated IDs. Users can leverage this information to structure their term requests properly.
The response code for this endpoint will include the term ID, name, kind (e.g., string, date, numeric), the date and time the term was created, and the agreement type ID for the associated agreement. An example of what the response code for this endpoint may look like is below.
Retrieving the Term ID
GET: https://api.linksquares.com/api/analyze/v1/agreements/{agreement_id}/terms
The response to this call will contain an array of term IDs. Record the ID for the term you would like to update.
Note: Only the first 100 terms are returned by default. To obtain the next page, set the 'cursor' to the value set in 'next_cursor'
GET: https://api.linksquares.com/api/analyze/v1/agreements/{agreement_id}/terms?cursor=7146aa3c-de65-11ee-8466-07265602a542
Response Body
{
"page_size": 100,
"count": 146,
"next_cursor": "7146aa3c-de65-11ee-8466-07265602a542",
"terms": [{
"id": "7133949c-de65-11ee-8465-5b842f73ad6b",
"name": "Acceptance Clause",
"value": "",
"kind": "text",
"status": "AI Not Present"
},
{
"id": "70fdec2a-de65-11ee-b8f0-5330d2889c1e",
"name": "Acceptance Cure Period (days)",
"value": "",
"kind": "number",
"status": "AI Not Present"
},
Updating the Term ID
PATCH https://api.linksquares.com/api/analyze/v2/agreements/{agreement_id}/terms/{term_id}
The following is an example of the JSON code you would use when changing the Account Number term from the response code above.
{
"data": {
"value": “77432-001”
}
}
cURL Code Snippet
curl
--location
--globoff
--request PATCH 'https://api.linksquares.com/api/analyze/v2/agreements/{
agreement id
}/terms/{
term_id
}' \
--header 'x-api-key: {
x-api-key
}’ \
--header 'id: 40c49308-f65b-11ed-aee9-877bf39461bf' \
--header 'agreement_id: {
agreement_id
}' \
--header 'Content-Type: application/json' \
--data '{
"data":{
"value": "{
Term data type
}"
}
}'
Updating Agreement Name
To update the agreement name, users will leverage a PATCH call with the relevant agreement ID to update the name for the agreement.
PATCH https://api.linksquares.com/api/analyze/v2/agreements/{agreement_id}?include=embedded
The following is an example of the JSON code you would use when changing the Account Number term from the response code above.
{
"data": {
"name": "text"
}
}
cURL Code Snippet
curl
--location
--request PATCH 'https://api.linksquares.com/api/analyze/v2/agreements/{
agreement_id
}/?include=embedded’ \
--header 'x-api-key: {
x-api-key
}’ \--header 'id: null' \
--header 'agreement_id: null' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"name": "text"
}
}'
Updating Agreement Type
To update the type associated with an agreement, users will leverage a PATCH call with the relevant agreement ID to update the type associated with the agreement.
Users can update the agreement type to any Smart or Custom Type available in their LinkSquares environment. The agreement type naming conventions are case-sensitive.
Step 1: Retrieving the Agreement Type ID
GET https://api.linksquares.com/api/analyze/v1/agreement_types
The response will return a list of agreement type IDs for every agreement type available within your LinkSquares environment. Record the agreement type ID for the type to which you would like to update the relevant agreement.
The following code shows an example of what an Amendment agreement type ID may look like in the response.
Response Body
"id": "254f12b8-febf-11ec-b879-4f58a7c16e8e",
"name": "Amendment",
Step 2: Updating the Agreement Type
The next step is to leverage the agreement type ID recorded in the previous step to update the type for the relevant agreement.
PATCH https://api.linksquares.com/api/analyze/v2/agreements/{agreement_id}?include=embedded
"id": "254f12b8-febf-11ec-b879-4f58a7c16e8e",
"name": "Amendment",
cURL Code Snippet
curl
--location
--request PATCH 'https://api.linksquares.com/api/analyze/v2/agreements/{
agreement_id
}?include=embedded' \
--header 'x-api-key: [‘api-key] \
--header 'id: 6195bcda-eeb1-11ed-bc6a-8f6b7e6b770b' \
--header 'agreement_id: {
agreement_id
} \
--header 'Content-Type: application/json' \
--data '{
"data": {
"name": "Amendment",
"type_id": "254f12b8-febf-11ec-b879-4f58a7c16e8e"
}
}'
Adding Agreement Notes
Users can add notes to an agreement. Notes cannot be modified or deleted via the Analyze API, they must be modified or deleted from within the web app.
The user_email variable must be the email of a valid LinkSquares user.
POST /analyze/v2/agreements/{agreement_id}/notes
Request Body
{
“data”: [{
“content”: “New Note”,
“user_email”: “email@email.com”
}]
}
Response Body
{
“data”: [{
“id”: “1b29f2de-5bb7-11ee-b5c5-cb92ba7291d5”,
“content”: “New Note”,
“user_id”: “1d2bdffe-0152-11ed-914b-9f74296d0e67”,
“agreement_id”: “a88ce4ba-b6bc-11ed-9d91-e7e6000d01ec”,
“created_at”: “2023-09-25T11:20:48.794-04:00”
}]
}
Updating Agreement Tags
Users can view existing tags within their LinkSquares instance, create new tags and delete existing tags within their LinkSquares instance, and add and delete specific tags within an individual Analyze agreement.
Retrieving a List of All Tags
Users can retrieve a list of all tags associated with their LinkSquares instance.
GET /analyze/v2/tags
Response Body
{
“data”: [{
“id”: “0a523d78-0ec3-11ed-af02-9780a082d74c”,
“name”: “2013”,
“color”: “smart_green”,
“agreements_count”: 33
},
{
“id”: “320a3dd0-c8df-11ed-9599-5b5fe8b6c0a4",
“name”: “2014",
“color”: “smart_green”,
“agreements_count”: 1
},
Creating New Tags
Users can create new tags within their LinkSquares instance.
POST /analyze/v2/tags
Request Body
{
“data”: {
“name”: “2024”,
“color”: “blue”
}
}
Response Body
{
“data”: {
“id”: “96de9984-5bda-11ee-85fb-3b4854f52fb8”,
“name”: “2024”,
“color”: “blue”,
“agreements_count”: 0,
“created_at”: “2023-09-25T19:34:48Z”
}
}
Deleting Tags From Analyze
Using the ID for a given tag, users are able to delete tags from Analyze.
To learn more about retrieving the ID for a given tag, reference the Retrieving a List of All Tags section of this article.
Upon deletion of a tag, the tag is removed from all associated agreements.
DELETE /analyze/v2/tags/{tag_id}
Response Body
Status 204: Success
Adding Tags to Agreements
Using the ID for a specific tag, users can add that tag to an existing Analyze agreement.
POST /analyze/v2/agreements/{agreement_id}/tags/{tag_id}
Response Body
{
“data”: {
“name”: “2024”,
“color”: “blue”,
“id”: “96de9984-5bda-11ee-85fb-3b4854f52fb8”
}
}
Deleting Tags From Agreements
Using the agreement ID and tag ID, users can remove that tag from an existing Analyze agreement.
DELETE /analyze/v2/agreement/{agreement_id}/tags/{tag_id}
Response Body
Status 204: Success
Updating Parent-Child Hierarchies
Users can create or remove parent-child hierarchies on existing agreements using the relevant agreement IDs.
Creating Parent-Child Hierarchies
Users are able to add a parent agreement to an existing agreement to create a parent-child hierarchy.
PATCH analyze/v2/agreements/{agreement_id}
Note: The {agreement_id} in the PATCH request should be the ID for the child agreement.
In the request body, provide the agreement ID for the parent agreement in the parent_agreement_id variable.
Request Body
{
“data”: {
“parent_agreement_id”: “f867202e-0ec2-11ed-bab1-1b5511c844e7”
}
}
Response Body
{
“data”:{
“Id”:“0715b234-0ec3-11ed-b2f8-53ff5ad9aee5”,
“Parent_agreement_id”:“f867202e-0ec2-11ed-bab1-1b5511c844e7”,
“name”:“MASTER SERVICES AGREEMENT - 2013 - Cube Arts,
Linksquares Inc. “original_name”:“2013 - Cube Arts,
Linksquares Inc. - Cube Arts Master Service Agreement”,
“updated_date”:“2023-12-18T20:20:57Z”,
“upload_date”:“2023-12-18T20:20:57Z”,
Removing Parent-Child Hierarchies
Users are able to remove the parent agreement on an existing agreement to modify a parent-child hierarchy.
PATCH analyze/v2/agreements/{agreement_id}
Note: The {agreement_id} in the PATCH request should be the agreement ID for the child agreement.
In the request body, enter “null” as the parent_agreement_id variable value.
Request Body
{
“data”: {
“parent_agreement_id”: “f867202e-0ec2-11ed-bab1-1b5511c844e7”
}
}
Response Body
“data”: {
“id”: “0715b234-0ec3-11ed-b2f8-53ff5ad9aee5”,
“parent_agreement_id”: null,
“name”: “MASTER SERVICES AGREEMENT - 2013 - Cube Arts,
Linksquares Inc.",
“original_name”: “2013 - Cube Arts,
Linksquares Inc. - Cube Arts Master Service Agreement”,
“updated_date”: “2023-12-19T16:19:06Z”,
“upload_date”: “2023-12-19T16:19:06Z”,
Downloading Agreement Files
Users are able to download the file for the main agreement and send that file to another system for storage.
A presigned URL is returned in the response code. This is the link that must be used to retrieve the agreement file.
Note: The presigned URL may expire after a certain period. To retrieve a new link, reissue the GET call.
By default, the agreement file is downloaded with the smart name. To download the file with its original name, use the download?use_original_name=true filter on the endpoint below.
GET api/analyze/v2/agreements/{agreement_id}/download
Response Body
{
“data”: {
“url”: “https://linksquares-agreement-file-uploads-sample.amazonaws.com/store/3fe3ae5a12561c6dbbf8fc0e0f62387b/%21termiantion.pdf?response-content-disposition=attachment%3B%20filename%3D%22Statement%20of%20Work.pdf%22%3B%20filename%2A%3DUTF-8%27%27Statement%2520of%2520Work.pdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIARONR2CMFGX62PXNN%2F20230817%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230817T184626Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQiJv3JpZ3lvVjEMP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJIMEYCIQDFof%2BVjIcb6MqyrZppkiEe30zprK%2FG3iN7iO6YKy9psAIhAPfl0UoH7NAZon2YLFoAOuZSv%2Baf8V9YIFU1TAsVroUPKuMDCHwQAxoMMDk5Njk0MDIzNDM0IgyHtQRhLTCxp4CCCDsqwAMBQfAHUPVYp%2FytIPrUdyCzNRnWFnMOqjmFCsjDhVnyVxi3ZAcZ3fea32zlmKcpka5KncQjdYC2fWa9mRZc4lTjQG%2F8u3Hz5UKN48M6mAUs5Ef%2BBLGHDCZ%2BQfrQ0%2Frb%2B4F4bhQ%2BaUV0GgIDWpbMVygH397zBO83gUbr5gXJ1nFf0B9oii7xZKfHYo8dlS4VM65POmHVp8dR2jpO84Z5MDs8Vv%2BwzuWGm8tgQXp6N8ZMPFoMR1y1oQxQvQimSLf0TWeRIq%2Ft5sEa1MWmOslNlxp%2FVcnt5hSOvB3GwwD8C54B8580utH7zsGeLG%2FDu%2BD%2Bdm%2FCD46b2r9HPuTcWDJIlfnQWmlGG5Zh1TCDR9qs9hT%2B3bMRUFxotiUf5SmEZeP%2BQu3aTzL%2FpB4Y1S0MIZu2XMTgvomCDPGUR7zBN4bRwIyG5cZyAjSlEF5M2YIN%2BCoYBnzyS4%2BofynY8WgwHCVcVZ3QGwKNvdgV9tL3fweTGgb6G%2BW0u%2B0753HqmXXRaPVEh02f%2FotNWU8sxUzocnK89F6VzxGP79MtHzbs3ixqL%2B%2FRg6osxom9LiuGenKmCIERe%2B18ikW7juTF%2FfAqMWS4MiP8MPTO%2BaYGOqQBphfW6z9OK663d0KQMa801dwrmsBEC4Vxb1kfcSEGnjq3FRi%2FJHOZcBSQu4t74kQu1rXXBjC0KLo9bJQlQRoRu2O4QMw2twaLz%2FaWSjs7rbzWdR%2FvFHcoThSgD0i9%2Ff3i27zindetAjMZiuKGUhVlrGTrdRwaENlYJwY%2B%2FIvUtPt8Niaa6hU2nwAP29oBtI%2FrZGrsXl0w1UjEV8hQNhVNK6fFjR8%3D&X-Amz-Signature=e623b9572e500c427eec9cd683b43c5ae66f8d772fc56ef1320cbff5b8a”
}
}