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

# Create an attachment key

`POST /attachments/new-key`

Create an attachment key. Allows attachments to be uploaded separately from the related content.

## Response `200`

OK

- object
  - `key` string — The attachment key created. This should be used to upload additional files or to associate uploaded attachments with other content.
  - `attachment` Attachment
    - `filename` string
    - `file_size` integer
    - `height` integer
    - `width` integer
    - `thumbnail_url` string
    - `retina_thumbnail_url` string
    - `direct_url` string
    - `is_video` boolean
    - `is_audio` boolean
    - `attachment_id` integer
    - `content_type` string
    - `content_id` integer
    - `attach_date` integer
    - `view_count` integer

## Other responses

- `default` — Error

---

[API](https://skmtc.net/xenforo-ltd/apis/xenforo-api.md) · [All operations](https://skmtc.net/xenforo-ltd/apis/xenforo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xenforo-ltd/xenforo-api/revisions/b15eba33657a/schema)
