---
title: "Create Agreement"
method: POST
path: "/finalize/v2/agreements"
tags: ["Finalize Agreements"]
---

# Create Agreement

`POST /finalize/v2/agreements`

## Request body

- object
  - `data` object, required
    - `name` string, required — The name of the agreement.
    - `kind` 'draft' | 'intake' | 'request', required — The kind of the agreement.
    - `template_id` string, uuid, required — The UUID of the template or request form to create from.
    - `agreement_file` object — Information about the file to be uploaded with this agreement. Only applicable for 'intake' templates.
      - `name` string — File name with extension. File must be type docx, pdf, or xlsx.
    - `tokens` union[] — The values for the template tokens. Only applicable for 'draft' templates. Must provide 'selected' for single and multi select token types and 'value' for every other token type.
      - union
        - object
          - `id` string, uuid, required — The UUID of the template token.
          - `value` union, required — The value of the token.
            - string
            - integer
        - object
          - `id` string, uuid, required — The UUID of the template token.
          - `selected` object[], required
            - `id` string, uuid, required — The UUID of the token option.
    - `answers` union[] — The answers to the template questions. Must provide 'selected' for single and multi select question types and 'value' for every other question type.
      - union
        - object
          - `id` string, uuid, required — The UUID of the template question.
          - `value` union, required — The answer to the question.
            - string
            - integer
        - object
          - `id` string, uuid, required — The UUID of the template question.
          - `selected` object[], required
            - `id` string, uuid, required — The UUID of the answer option.
            - `custom_description` string — A user-defined description for the answer option
        - object
          - `id` string, uuid, required — The UUID of the template question.
          - `files` object[], required
            - `name` string, required — The name of the answer file.
    - `tables_values` object[] — The table tokens to populate corresponding table token placeholders in the template, tokens must be be prefixed by #[ and suffixed by ]#
      - `id` string, uuid — The UUID of the table token.
      - `start_token` string, required — Start table token identifier.
      - `end_token` string, required — End table token identifier.
      - `total_tokens` object, required — The total token identifiers and their values.
      - `row_tokens` object[], required — The row token identifiers and their values.
    - `source` object — Information about the ingestion source of agreements
      - `source_name` string, required — Name of the ingestion source
      - `metadata` object, required
        - `source_record_id` string — Ingestion source record id
        - `source_record_name` string — Name of the ingestion source record
        - `source_record_url` string — Link to ingestion source record
        - `color` string — Hex value of color associated with the ingestion source

## Response `201`

created

- object
  - `data` object, required
    - `id` string, uuid, required — The UUID of the agreement record.
    - `name` string, required — The name of the agreement.
    - `created_at` string, date-time, required — The ISO 8601 datetime of when the agreement record was created.
    - `status_updated_at` string, date-time, nullable, required — The ISO 8601 datetime of when the agreement status was updated. Expected to be null if the agreement is not fully created.
    - `kind` 'draft' | 'intake' | 'request' | 'sign' | 'webform', required — The kind of the agreement.
    - `analyze_agreement_id` string, uuid, nullable, required — The UUID of the Analyze agreement that was created and referenced by a Fully Signed Finalize agreement.
    - `template_id` string, uuid, nullable, required — The UUID of the template the agreement was created from. Expected to be null if the agreement was not created from a template.
    - `author_id` string, uuid, required — The UUID of the user record that created the agreement.
    - `owner_id` string, uuid, nullable, required — The UUID of the user record that is currently the agreement owner. Expected to be null if the agreement does not have an owner.
    - `collaborator_ids` string[], required — Array of the agreement collaborator User UUIDs.
    - `status_id` string, uuid, nullable, required — The UUID of the current status record. Expected to be null if the agreement is not fully created.
    - `question_ids` string[], required — Array of the agreement question UUIDs.
    - `token_value_ids` string[], required — Array of the agreement token value UUIDs.
    - `pen` object
      - `assigned_to_counterparty` boolean — Indicates whether the pen is assigned to the counterparty.
      - `holder_ids` string[] — Array of the agreement pen holder User UUIDs.
  - `_links` object, required — Upload links to finish intake agreement creation.
    - `agreement_file_upload` object, required
      - `href` string, required — Presigned upload URL for the agreement file.
      - `operation` string, required — The HTTP verb. PUT only.
      - `file` string, required — File name with extension.
    - `answer_file_uploads` object[]
      - `href` string, required — Presigned upload URL for the answer file.
      - `operation` string, required — The HTTP verb. PUT only.
      - `file` string, required — File name with extension.
    - `agreement_uploads_complete` object, required
      - `href` string, required — URL for completing file uploads.
      - `operation` string, required — The HTTP verb. PATCH only.
      - `body` object, required
        - `data` object, required
          - `upload_complete` boolean, required — For agreement creation flow, patch this field as `true` when all agreement files have been uploaded.

## Other responses

- `422` — unprocessable_entity

---

[API](https://skmtc.net/linksquares/apis/linksquares-api.md) · [All operations](https://skmtc.net/linksquares/apis/linksquares-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/linksquares/linksquares-api/versions/4d597e83cd78/schema)
