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

# Create Agreement

`POST /agreements`

Create a new AgreementGen document from a AgreementGen template.

## Request body

- AgreementCreateRequest
  - `method` 'template', required — Must be set to `template`.
  - `agreement_name` string — Human-friendly title of the agreement (1-255 chars). Defaults to input name or "New document" if not provided in the request body.
  - `agreement_data` AgreementTemplateData, required
    - `template_id` string, required — Unique identifier of the AG template. Obtainable from the template list API.
    - `variables` object — Key-value map of Variables in the template. Pass values for the variables to render them into the created document or leave values blank to make them available for insertion later.
    - `fields` object — Key-value pairs for Form Fields defined in the template. Keys must match field names. Values prefill the corresponding form fields in the generated document. Currently supports: `text` and `checkbox` fields.
    - `linked_objects` LinkedObject[] — CRM or external objects linked to the agreement.
      - `integration` string — The external system or integration where the linked object lives. Example: `salesforce`, `hubspot`.
      - `entity_type` string — The type of the linked object in that provider's data model. Example: `opportunity`, `contact`, `deal`.
      - `record_id` string — The unique identifier of the linked object in the provider system. Example: `0065g00000Vh123ABC` (Salesforce record ID).
      - `reference_url` string, uri — The reference URL of the linked object in the provider system.

## Response `201`

Returns the information of the created AgreementGen document.

- AgreementSummary
  - `id` string, required — The unique identifier for the agreement.
  - `name` string, required — The name of the agreement.
  - `preview_url` string, uri — The URL to preview the agreement in the browser.
  - `created_at` integer, required — The time the agreement was created (Unix timestamp in milliseconds).
  - `linked_objects` LinkedObject[] — CRM or external objects linked to the agreement.
    - `integration` string — The external system or integration where the linked object lives. Example: `salesforce`, `hubspot`.
    - `entity_type` string — The type of the linked object in that provider's data model. Example: `opportunity`, `contact`, `deal`.
    - `record_id` string — The unique identifier of the linked object in the provider system. Example: `0065g00000Vh123ABC` (Salesforce record ID).
    - `reference_url` string, uri — The reference URL of the linked object in the provider system.

## Other responses

- `default` — Unexpected error

---

[API](https://skmtc.dev/luminpdf/apis/lumin-api-reference.md) · [All operations](https://skmtc.dev/luminpdf/apis/lumin-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/luminpdf/lumin-api-reference/revisions/d50abec39581/schema)
