Skip to main content
POST
Upload Attachments
Upload a single attachment to Penbox. Supports both JSON (base64) and multipart/form-data formats.
Size limits. Multipart uploads accept up to 10GB per file. JSON uploads accept a body of 20MB. That limit applies to the transmitted, base64-inflated payload, so roughly 15MB of file. Downloads are limited to 50MB.
To store an uploaded document on a case field, follow Add a Document to a Case for the full sequence.

Query Parameters

string
Workspace UUID. Optional for a token scoped to a single workspace. A token scoped to several workspaces should name the target one — the first workspace of the token is used otherwise. Note the bracket syntax: ?workspace[id]=<uuid>.

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
Not applied. Every upload is created with the same access rules: the workspace API token and workspace admins can download the attachment. Use a step attachment if a contact or another member needs access to the file.

Request Body (Multipart)

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

Response Structure

Returns a single attachment object:

Response Codes

Use multipart/form-data for large files. It is the only form that goes past 20MB, and it is faster because nothing is base64-encoded. Keep the JSON form for small files.

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[id]
string<uuid>

Workspace UUID. Optional for a token scoped to a single workspace; a token scoped to several workspaces should name the target one, otherwise the first workspace of the token is used.

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>

Not applied. Every upload is created with the same access rules: the workspace API token and workspace admins can download the attachment.

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