Attachments
Get File
Download or retrieve metadata for a specific attachment.
GET
Download or retrieve metadata for a specific file (API:
attachment).
In the API, uploaded files are referred to as attachments. This is the technical term used in all endpoints and parameters.
Response Formats
The endpoint supports two response formats controlled by theAccept header:
| Format | Accept Header | Use Case |
|---|---|---|
| Binary | application/octet-stream | Download the actual file |
| JSON | application/json | Get metadata and Base64 data (for files < 50MB) |
JSON Response
When usingAccept: application/json, you’ll receive:
| Field | Type | Description |
|---|---|---|
id | string | File UUID |
name | string | Original filename |
type | string | MIME type (e.g., application/pdf, image/jpeg) |
metadata.size | number | File size in bytes |
metadata.width | number | Image width in pixels (null for non-images) |
metadata.height | number | Image height in pixels (null for non-images) |
uri | string | Direct download URL |
data | string | Base64-encoded file data (only for files < 50MB) |
Bulk Download
Download multiple files as a single ZIP archive:Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | string | Yes | Comma-separated list of file UUIDs |
filename | string | No | Custom filename for the downloaded archive |
Multiple files are packaged as a ZIP archive for download.
Finding File IDs
File IDs are included when you retrieve a form response:Supported File Types
Penbox supports various file types:| Category | MIME Types |
|---|---|
| Documents | application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| Images | image/jpeg, image/png, image/gif, image/webp, image/svg+xml |
| Spreadsheets | application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/csv |
| Archives | application/zip, application/x-rar-compressed, application/x-7z-compressed |
| Other | text/plain, application/json, application/xml |
Response Codes
| Code | Description |
|---|---|
200 | Success - File downloaded or metadata retrieved |
400 | Bad Request - Missing ids parameter (for bulk download) |
401 | Unauthorized - Invalid access token |
403 | Forbidden - No access to this file |
404 | Not Found - File doesn’t exist |
413 | Payload Too Large - File too big for JSON response (use octet-stream) |
429 | Too Many Requests - Rate limit exceeded |
500 | Server Error - Internal error |
Files are permanently stored and remain accessible even after the form is archived.
Authorizations
API token (starts with pnbx_). Create at https://app.penbox.io/workspace/settings/api. Include as: Authorization: Bearer {token}
Headers
Response format: application/json for metadata or application/octet-stream for file download
Available options:
application/json, application/octet-stream Path Parameters
Attachment UUID