---
title: "Create a temporary attachment"
method: POST
path: "/v1/attachments"
tags: ["Attachments"]
---

# Create a temporary attachment

`POST /v1/attachments`

Create a temporary attachment for use as ad-hoc context on a Task Agent run. Submit as `multipart/form-data`. The `type` form field discriminates the payload carried on `value`: for FILE, send the file bytes as the `value` multipart part; for TEXT and URL, send the payload as the `value` form field. Reference the returned `id` in `attachmentIds` on a subsequent `POST /v1/tasks/{id}/run` call.

The returned attachment ID is currently only accepted by `POST /v1/tasks/{id}/run` (via the `attachmentIds` field). It is not supported by other endpoints.

Temporary attachments are intended for short-lived context (the same attachment can be referenced across retries of the same run) and should not be relied on for durable storage. Use the Knowledge API (`POST /v1/knowledge`) for content that should persist in your workspace.

## Response `201`

Attachment created successfully.

- CreateAttachmentResponseDto
  - `requestId` string, required
  - `resource` string, required
  - `data` CreateAttachmentResource, required
    - `id` string, required — The temporary attachment ID. Reference this value in `attachmentIds` on a subsequent `POST /v1/tasks/{id}/run` call.
    - `type` 'FILE' | 'TEXT' | 'URL', required — The attachment type, echoing back the request `type`.

## Other responses

- `400` — Bad request. Missing required fields or unsupported file type.
- `500` — Internal server error. Unable to create attachment.

---

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