Skip to content

Upload a file to a card

POST
/boards/{board}/cards/{card}/files
curl --request POST \
--url https://projects.work.optidata.cloud/api/boards/1/cards/1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form name=example \
--form size_bytes=1 \
--form mime_type=example \
--form blob=@file \
--form is_editor_upload=true

Attaches a file to the card by uploading the binary from the caller’s machine (multipart form-data with blob). The file is stored in the tenant’s Optiwork Drive. Editor media uploads (is_editor_upload: true) are restricted to an image/video allow-list with per-type size limits.

board
required
integer

Board id.

card
required
integer

Card id (must belong to the board).

Media typemultipart/form-data
object
name
required

File name.

string
size_bytes
required

File size in bytes.

integer
mime_type
required

File MIME type.

string
blob
required

The file content.

string format: binary
is_editor_upload

Set when uploading media from the card’s rich-text editor (enables the media allow-list and size limits).

boolean

The created file with access URLs.

Media typeapplication/json
object
file
object
id
integer
identifier

Opaque file identifier used in file URLs.

string
download_url
string format: uri
content_url

Inline-content URL (renders in the editor).

string format: uri
view_url

Signed Optiwork Drive viewer URL.

string | null format: uri
Example
{
"file": {
"id": 5001,
"identifier": "f0e1d2c3-7777-4888-9999-aaaabbbbcccc",
"download_url": "https://projects.work.optidata.cloud/projects/boards/42/cards/9001/files/f0e1d2c3-7777-4888-9999-aaaabbbbcccc/download",
"content_url": "https://projects.work.optidata.cloud/projects/boards/42/cards/9001/files/f0e1d2c3-7777-4888-9999-aaaabbbbcccc/content",
"view_url": "https://drive.work.optidata.cloud/view/abc123"
}
}

Missing, invalid or expired bearer passport.

Media typeapplication/json
object
error
string
Example
{
"error": "JWT passport exception: Missing bearer token in request"
}

The authenticated user lacks the required board permission.

Media typeapplication/json
object
message
string
Example
{
"message": "This action is unauthorized."
}

Resource not found, or a nested resource does not belong to its parent in the path.

Media typeapplication/json
object
message
string
Example
{
"message": "Not found."
}

Validation failed.

Media typeapplication/json
object
message

First validation error message.

string
errors

Map of field name → list of error messages.

object
key
additional properties
Array<string>
Example
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}