---
title: "Upload a file to a card"
method: POST
path: "/api/board/{boardId}/{cardId}/file"
tags: ["Cards"]
---

# Upload a file to a card

`POST /api/board/{boardId}/{cardId}/file`

## Request

- Base URL: `https://core-api.getaptly.com`
- URL: `https://core-api.getaptly.com/api/board/{boardId}/{cardId}/file`
- Auth: one of:
  - API key in header `x-token`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/getaptly/apis/aptly-api/docs/api/board/:boardId/:cardId/file/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads a file and attaches it to a card. Send as `multipart/form-data` with the file in the `file` field.

**Max file size:** 50 MB

**Accepted types:** JPEG, PNG, GIF, WebP, SVG, PDF, Word, Excel, plain text, CSV, MP4, MOV, MP3, WAV

## Path parameters

- `boardId` string, required
- `cardId` string, required

## Request body `multipart/form-data`

- object
  - `file` string, binary, required

## Response `200`

File uploaded and attached.

- object
  - `data` object
    - `fileId` string
    - `name` string
    - `size` integer
    - `type` string

## Other responses

- `400`: Missing file or unsupported file type.
- `401`: Invalid or missing API key.
- `404`: Card not found.

---

[API](https://skmtc.dev/getaptly/apis/aptly-api.md) - [All operations](https://skmtc.dev/getaptly/apis/aptly-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getaptly/apis/aptly-api/revisions/75c367e0b8e5?raw)
