---
title: "Create Attachment"
method: POST
path: "/attachments"
tags: ["Expenses"]
---

# Create Attachment

`POST /attachments`

Upload a file and receive a one-time attachment token. The token can then be attached to an expense via `POST /expenses/{expense_id}/attachments` or included in `POST /expenses`.

## Request body

- AttachmentRequest
  - `name` string, required
  - `content` string, required — Base64 file content. Only jpg, png and pdf supported
  - `type` 'assignment' | 'task' | 'user' | 'expense' — Object the attachment is linked to. Defaults to `expense`.

## Response `201`

Created

- AttachmentDetails
  - `id` number
  - `name` string
  - `token` string

## Other responses

- `401` — Unauthorized

---

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