---
title: "Create an attachment"
method: POST
path: "/attachments.create"
tags: ["Attachments"]
---

# Create an attachment

`POST /attachments.create`

Creating an attachment object creates a database record and returns the inputs needed to generate a signed url and upload the file from the client to cloud storage.

## Request body

- object
  - `name` string, required
  - `documentId` string, uuid — Identifier for the associated document, if any.
  - `contentType` string, required
  - `size` number, required — Size of the file attachment in bytes.

## Response `200`

OK

- object
  - `data` object
    - `maxUploadSize` number
    - `uploadUrl` string, uri
    - `form` object
    - `attachment` Attachment
      - `contentType` string
      - `size` number
      - `name` string
      - `url` string, uri
      - `documentId` string, uuid — Identifier for the associated document, if any.

## Other responses

- `400` — The request failed one or more validations.
- `401` — The API key is missing or otherwise invalid.
- `403` — The current API key is not authorized to perform this action.

---

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