> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getaptly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a file to a card

> 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




## OpenAPI

````yaml /openapi.yaml post /api/board/{boardId}/{cardId}/file
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/board/{boardId}/{cardId}/file:
    post:
      tags:
        - Cards
      summary: Upload a file to a card
      description: >
        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
      operationId: uploadFile
      parameters:
        - name: boardId
          in: path
          required: true
          schema:
            type: string
        - name: cardId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: File uploaded and attached.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      fileId:
                        type: string
                      name:
                        type: string
                      size:
                        type: integer
                      type:
                        type: string
        '400':
          description: Missing file or unsupported file type.
        '401':
          description: Invalid or missing API key.
        '404':
          description: Card not found.
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
components:
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'

````