openapi: 3.0.3 info: title: LinkSquares API description: >- The LinkSquares API is the public REST API for the LinkSquares AI-powered contract lifecycle management (CLM) platform. It spans two products. Analyze exposes processed agreements plus the metadata, Smart Values, terms, types, tags, and parent/child hierarchy extracted from them, and lets you import DOCX/PDF documents for AI processing. Finalize lets external systems retrieve templates, create draft/intake/request agreements, and retrieve and approve tasks. All requests authenticate with an API key passed as an `x-api-key` header; the same token is shared across Analyze and Finalize. API access is gated to LinkSquares customers and keys are self-managed by Administrator users. GROUNDING NOTE: The Analyze paths in this document (under /api/analyze) are CONFIRMED against the public LinkSquares API Overview and Analyze API Sample Use Cases help-center articles, including live cURL examples. The Finalize paths (under /api/finalize) are MODELED from the capability-level descriptions in the LinkSquares API Overview - LinkSquares documents that Finalize can retrieve templates, retrieve and approve tasks, and create agreements, but the concrete request paths are behind the customer-gated API reference and must be confirmed before use. Request and response schemas throughout are modeled from documented behavior and examples, not copied from an official OpenAPI definition. version: '1.0' contact: name: LinkSquares url: https://linksquares.com license: name: Proprietary url: https://linksquares.com/saas-terms-of-service servers: - url: https://api.linksquares.com description: LinkSquares production API gateway security: - apiKeyAuth: [] tags: - name: Account description: Identity and status of the API user (confirmed). - name: Agreements description: Analyze agreements and document import/upload (confirmed). - name: Metadata and Smart Values description: Terms, Smart Values, hierarchy, and agreement types (confirmed). - name: Attachments description: Additional attachments on Analyze agreements (confirmed). - name: Finalize description: Finalize templates, tasks, and agreement creation (MODELED paths). paths: /api/analyze/v1/me: get: operationId: getCurrentUser tags: - Account summary: Get the current API user description: >- Returns information about the user the API key is assigned to and the status of the server. Confirmed. responses: '200': description: Current user and server status. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' /api/analyze/v1/agreements: get: operationId: listAgreements tags: - Agreements summary: List agreements description: >- Lists the Analyze agreements the API user has permission to view. Supports filtering by agreement type, tag, and an updated-since date, and uses cursor pagination via a next_cursor value. Confirmed. parameters: - name: type in: query required: false description: Filter results by agreement type name. schema: type: string - name: tag in: query required: false description: Filter results by agreement tag. schema: type: string - name: next_cursor in: query required: false description: >- Cursor for the next page of results. In documented examples this is also passed as a next_cursor header. schema: type: string responses: '200': description: A page of agreements. content: application/json: schema: $ref: '#/components/schemas/AgreementList' '401': $ref: '#/components/responses/Unauthorized' '429': $ref: '#/components/responses/RateLimited' post: operationId: createAgreement tags: - Agreements summary: Create an agreement (step 1 of import) description: >- First step of the two-step import flow. POSTs the file name and metadata (name, agreement_type, tags, optional parent agreement id) and returns a presigned upload URL on 200 OK. The second step is a PUT of the binary DOCX/PDF to that presigned URL (an Amazon S3 upload; Base64 is not supported). Confirmed. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgreementCreateInput' responses: '200': description: Agreement metadata created; presigned upload URL returned. content: application/json: schema: $ref: '#/components/schemas/AgreementUpload' '401': $ref: '#/components/responses/Unauthorized' '429': $ref: '#/components/responses/RateLimited' /api/analyze/v1/agreements/{agreement_id}: parameters: - $ref: '#/components/parameters/AgreementId' get: operationId: getAgreement tags: - Agreements summary: Retrieve a single agreement description: >- Retrieves the metadata and Smart Values for one processed agreement by its identifier. Confirmed. responses: '200': description: The requested agreement. content: application/json: schema: $ref: '#/components/schemas/Agreement' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/analyze/v2/agreements/{agreement_id}: parameters: - $ref: '#/components/parameters/AgreementId' patch: operationId: updateAgreement tags: - Agreements summary: Update an agreement description: >- Updates fields on an existing agreement. Confirmed (v2). requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '200': description: The updated agreement. content: application/json: schema: $ref: '#/components/schemas/Agreement' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/analyze/v1/agreements/{agreement_id}/hierarchy: parameters: - $ref: '#/components/parameters/AgreementId' get: operationId: getAgreementHierarchy tags: - Metadata and Smart Values summary: Retrieve parent/child hierarchy description: >- Returns the parent/child hierarchy tree for a given agreement as an unsorted JSON hash, including the IDs and names of all related agreements and their relationships. Confirmed. responses: '200': description: The hierarchy tree. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/analyze/v1/agreements/{agreement_id}/terms: parameters: - $ref: '#/components/parameters/AgreementId' get: operationId: getAgreementTerms tags: - Metadata and Smart Values summary: Retrieve agreement terms description: >- Retrieves the terms (Smart Values) extracted for a single agreement. Confirmed. responses: '200': description: The agreement's terms. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/analyze/v2/agreements/{agreement_id}/terms/{term_id}: parameters: - $ref: '#/components/parameters/AgreementId' - name: term_id in: path required: true description: The identifier of the term / Smart Value. schema: type: string patch: operationId: updateAgreementTerm tags: - Metadata and Smart Values summary: Update an agreement term description: >- Updates the value of a single term (Smart Value) on an agreement. Confirmed (v2). requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '200': description: The updated term. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/analyze/v1/agreement_types: get: operationId: listAgreementTypes tags: - Metadata and Smart Values summary: List agreement types description: >- Lists the agreement types configured in the Analyze environment. Confirmed. responses: '200': description: A list of agreement types. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' /api/analyze/v1/agreements/{agreement_id}/attachments: parameters: - $ref: '#/components/parameters/AgreementId' post: operationId: addAgreementAttachment tags: - Attachments summary: Add an additional attachment description: >- Adds an additional attachment to an agreement. Confirmed (v1). requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '200': description: The created attachment. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' /api/analyze/v2/agreements/{agreement_id}/attachments: parameters: - $ref: '#/components/parameters/AgreementId' get: operationId: listAgreementAttachments tags: - Attachments summary: List additional attachments description: >- Retrieves the additional attachments on an agreement. Confirmed (v2). responses: '200': description: A list of attachments. content: application/json: schema: type: object properties: data: type: array items: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/analyze/v2/agreements/{agreement_id}/attachments/{attachment_id}/download: parameters: - $ref: '#/components/parameters/AgreementId' - name: attachment_id in: path required: true description: The identifier of the attachment. schema: type: string get: operationId: downloadAgreementAttachment tags: - Attachments summary: Download an attachment description: >- Downloads a single attachment on an agreement. Confirmed (v2). responses: '200': description: The attachment binary or a download reference. content: application/octet-stream: schema: type: string format: binary '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/analyze/v1/uploads/{upload_id}: parameters: - name: upload_id in: path required: true description: The identifier of the upload returned by the create-agreement step. schema: type: string get: operationId: getUpload tags: - Agreements summary: Retrieve upload status description: >- Retrieves the status of an in-progress or completed document upload. Confirmed. responses: '200': description: The upload status. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/finalize/v1/templates: get: operationId: listFinalizeTemplates tags: - Finalize summary: List Finalize templates (MODELED) description: >- MODELED PATH. Retrieves available Finalize templates and their Agreement Detail Questions and tokens, filterable by Draft, Intake, or Request Form. LinkSquares documents this capability in the API Overview; the exact path is behind the customer-gated API reference and must be confirmed. responses: '200': description: A list of templates. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' /api/finalize/v1/tasks: get: operationId: listFinalizeTasks tags: - Finalize summary: List Finalize tasks (MODELED) description: >- MODELED PATH. Retrieves the tasks associated with your LinkSquares environment. Documented as a capability; path not confirmed. responses: '200': description: A list of tasks. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' /api/finalize/v1/tasks/{task_id}: parameters: - name: task_id in: path required: true description: The identifier of the task. schema: type: string get: operationId: getFinalizeTask tags: - Finalize summary: Get a Finalize task (MODELED) description: >- MODELED PATH. Retrieves information about a specific task by ID. Documented as a capability; path not confirmed. responses: '200': description: The requested task. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' patch: operationId: approveFinalizeTask tags: - Finalize summary: Approve a Finalize task (MODELED) description: >- MODELED PATH. Updates the status of a single task to approved. Documented as a capability; path not confirmed. requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '200': description: The updated task. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/finalize/v1/agreements: post: operationId: createFinalizeAgreement tags: - Finalize summary: Create a Finalize agreement (MODELED) description: >- MODELED PATH. Creates a Draft, Intake, or Request agreement in Finalize from a completed template, enabling third-party systems to submit documents for legal review or request/draft agreements. Documented as a capability; path not confirmed. requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '200': description: The created Finalize agreement. content: application/json: schema: type: object additionalProperties: true '401': $ref: '#/components/responses/Unauthorized' components: securitySchemes: apiKeyAuth: type: apiKey in: header name: x-api-key description: >- LinkSquares API key passed as an `x-api-key` header on every request. Keys are self-managed by Administrator users and are shared across the Analyze and Finalize products. parameters: AgreementId: name: agreement_id in: path required: true description: The unique identifier (UUID) of the agreement. schema: type: string format: uuid responses: Unauthorized: description: Missing or invalid API key. content: application/json: schema: $ref: '#/components/schemas/Error' NotFound: description: The requested resource was not found. content: application/json: schema: $ref: '#/components/schemas/Error' RateLimited: description: >- Rate limit exceeded (documented as ~15 requests/second, burst 30); returns a "Rate exceeded" error. content: application/json: schema: $ref: '#/components/schemas/Error' schemas: Error: type: object properties: error: type: string message: type: string AgreementCreateInput: type: object required: - name - file_name properties: name: type: string description: Display name of the agreement. file_name: type: string description: File name of the document being imported (DOCX or PDF). agreement_type: type: string description: The agreement type name. tags: type: array items: type: string parent_id: type: string description: Optional identifier of the parent agreement. AgreementUpload: type: object properties: upload_id: type: string upload_url: type: string format: uri description: Presigned URL to PUT the binary document to. Agreement: type: object properties: id: type: string format: uuid name: type: string agreement_type: type: string tags: type: array items: type: string smart_values: type: object additionalProperties: true terms: type: object additionalProperties: true additionalProperties: true AgreementList: type: object properties: data: type: array items: $ref: '#/components/schemas/Agreement' next_cursor: type: string