---
title: "Create an attachment."
method: POST
path: "/v0/sessions/{sessionId}/attachments"
tags: ["Workspaces"]
---

# Create an attachment.

`POST /v0/sessions/{sessionId}/attachments`

## Request

- Base URL: `https://api.conductor.build` (the document declares no server; this is the origin it was published from)
- URL: `https://api.conductor.build/v0/sessions/{sessionId}/attachments`
- Auth: HTTP bearer

Allocates a file attachment in a session and returns a presigned upload URL. PUT the file bytes to upload.url with upload.headers within 15 minutes, then pass attachment.id in the attachments of POST /v0/sessions/{sessionId}/messages. Files can be up to 100 MB and of any type. Attachments can only be added to existing sessions: create the session, upload, then send the message. Attachments are in preview and enabled per user; requests from users without access receive 403.

## Path parameters

- `sessionId` string, required

## Request body

- object
  - `attachmentId` string, uuid
  - `filename` string, required
  - `contentType` string, required
  - `byteSize` integer, required

## Response `201`

Default Response

- object
  - `attachment` object, required
    - `id` string, required
    - `path` string, required
  - `upload` object, required
    - `url` string, required
    - `headers` object, required
    - `expiresAt` string, required

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid bearer token.
- `404`: Resource not found.
- `default`: Error response.

---

[API](https://skmtc.dev/conductor-build/apis/roundhouse-public-api.md) - [All operations](https://skmtc.dev/conductor-build/apis/roundhouse-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/conductor-build/apis/roundhouse-public-api/revisions/1f39c7f7f219?raw)
