---
title: "Create Attachment"
method: POST
path: "/finalize/v2/agreements/{agreement_id}/attachments"
tags: ["Finalize Attachments"]
---

# Create Attachment

`POST /finalize/v2/agreements/{agreement_id}/attachments`

## Request

- Base URL: `https://api.linksquares.com/api`
- URL: `https://api.linksquares.com/api/finalize/v2/agreements/{agreement_id}/attachments`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/linksquares/apis/linksquares-api/docs/finalize/v2/agreements/:agreement_id/attachments/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `agreement_id` string, uuid, required

## Request body

- object
  - `data` object
    - `attachment_file` object, required
      - `name` string, required: The name of the attachment file.

## Response `201`

created

- object
  - `data` object, required
    - `id` string, uuid, required: The UUID of the attachment record.
    - `created_at` string, date-time, required: The ISO 8601 datetime of when the attachment was created.
    - `file_name` string, nullable, required: The name of the attachment file. Expected to be null if file has not been uploaded yet.
  - `_links` object, required: For attachment creation.
    - `attachment_file_upload` object, required
      - `href` string, required: Presigned upload URL for the attachment file.
      - `operation` string, required: The HTTP verb. PUT only.
      - `file` string, required: File name with extension.
    - `attachment_upload_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 attachment creation, patch this field as `true` when the attachment file has been uploaded.

## Other responses

- `404`: not_found
- `422`: unprocessable_entity

---

[API](https://skmtc.dev/linksquares/apis/linksquares-api.md) - [All operations](https://skmtc.dev/linksquares/apis/linksquares-api/llms.txt) - [OpenAPI document](https://skmtc.dev/linksquares/apis/linksquares-api/revisions/4d597e83cd78?raw)
