Skip to main content
POST
Upload Attachments
Upload a single attachment to Penbox. Supports both JSON (base64) and multipart/form-data formats.
Size Limit: Maximum file size is 10GB per upload.

Query Parameters

string
Company UUID (optional if your token has company scope)

Request Body (JSON)

For JSON uploads, send base64-encoded file data:
string
required
File name
string
required
Base64-encoded file content
string
MIME type (e.g., “application/pdf”, “image/jpeg”). Optional - will be detected if not provided.
string
default:"restricted"
Attachment visibility scope: public or restricted

Request Body (Multipart)

For multipart uploads, use multipart/form-data with a file field.

Response Structure

Returns a single attachment object:

Response Codes

For large files, prefer multipart/form-data uploads as they’re more efficient. For small files or when embedding in JSON payloads, base64 encoding works well.

Authorizations

Authorization
string
header
required

API token (starts with pnbx_). Create at https://app.penbox.io/workspace/settings/api. Include as: Authorization: Bearer {token}

Query Parameters

workspace
string<uuid>

Workspace UUID (optional if token has workspace scope)

Body

name
string
required

File name

data
string<byte>
required

Base64-encoded file content

type
string

MIME type (optional, will be detected if not provided)

scope
enum<string>
default:restricted

Attachment visibility scope

Available options:
public,
restricted

Response

201 - application/json

File uploaded successfully

id
string<uuid>

Attachment UUID

name
string

Original filename

type
string

MIME type

scope
string | null

Attachment scope

data
string | null

Base64-encoded file content

metadata
object
uri
string<uri>

Direct download URL