File Attachments
Records can have one or more file-type fields, each holding an independent array of attachments. The files API lets you upload, delete, and download attachments on any file field of any record.
Transport
All requests and responses use JSON. File bytes are sent and returned as base64 strings in the JSON body — there is no multipart/form-data endpoint.
- Maximum request size: 10 MB decoded. Oversized requests return
413 Payload Too Large. - Download cap: the same 10 MB limit applies when reading a file back.
For larger files, use the web UI.
Upload a file
POST /api/table/<table_id>/record/<record_id>/files/create
Uploads a file and appends it to the named file field's attachment array. Existing attachments on the field are preserved.
Request body
{
"field_id": "attachments",
"name": "invoice.pdf",
"type": "application/pdf",
"data": "JVBERi0xLjQKJ..."
}
field_id(required) — slug of the target file field on the table.name(required) — original filename. Used by the UI when displaying the attachment.type(optional) — MIME type. If omitted, the server sniffs it from the decoded bytes.data(required) — base64-encoded file bytes.
Response
{
"field_id": "attachments",
"files": [
{
"name": "prior.pdf",
"path": "/uploads/2-31-prior.pdf",
"type": "application/pdf",
"size": 12345,
"host": "files.infolobby.com"
},
{
"name": "invoice.pdf",
"path": "/uploads/2-31-invoice.pdf",
"type": "application/pdf",
"size": 6789,
"host": "files.infolobby.com"
}
]
}
The files array is the updated value of that field after the upload. path is the stable identifier you pass to files/delete and files/get.
Example
DATA=$(base64 -w 0 invoice.pdf)
curl -X POST https://infolobby.com/api/table/101/record/42/files/create \
-H "Authorization: Bearer il_live_..." \
-H "Content-Type: application/json" \
-d "{\"field_id\":\"attachments\",\"name\":\"invoice.pdf\",\"type\":\"application/pdf\",\"data\":\"$DATA\"}"
Delete a file
POST /api/table/<table_id>/record/<record_id>/files/delete
Removes one attachment from a file field. Other attachments on the same field — and attachments on other file fields — are untouched.
Request body
{
"field_id": "attachments",
"path": "/uploads/2-31-invoice.pdf"
}
Response
{
"field_id": "attachments",
"files": [ ... remaining attachments ... ]
}
Returns the field's updated attachment array. If no attachment in the field matches the given path, the call fails with Attachment not found.
Storage reclamation
Deletes remove the attachment metadata from the record immediately. On managed InfoLobby storage, the underlying file object is reclaimed by a background sweep after a 30-day grace period — delete operations are recoverable within that window by the InfoLobby team. Bring-your-own-storage integrations (customer S3, FTP, SFTP) are not touched by InfoLobby; reclaim those through your own tooling.
Download a file
POST /api/table/<table_id>/record/<record_id>/files/get
Returns the bytes of a single attachment, base64-encoded. Read-only API keys can call this.
Request body
{
"field_id": "attachments",
"path": "/uploads/2-31-invoice.pdf"
}
Both field_id and path are required. The server verifies that the attachment is referenced by that specific field on that specific record — you cannot read an attachment by pointing at a sibling field.
Response
{
"name": "invoice.pdf",
"type": "application/pdf",
"size": 6789,
"data": "JVBERi0xLjQK..."
}
Multiple file fields per record
A table can define any number of file-type fields. Each file field holds its own independent attachment array. Every call (create, delete, get) must specify field_id in the body — operations are always scoped to a single field.
To read the complete set of attachments across all file fields of a record in one request, use the standard record endpoint:
GET /api/table/<table_id>/record/<record_id>/get
The response includes every file field with its full attachment array.
Replacing the full attachment list
files/create is strictly append-only. To replace or reorder the complete list of attachments on a field in a single call, use the regular record update endpoint with a pre-constructed array of attachment objects:
POST /api/table/<table_id>/record/<record_id>/update
{
"data": {
"attachments": [
{"name":"keep.pdf","path":"/uploads/2-31-keep.pdf","type":"application/pdf","size":1234,"host":"files.infolobby.com"}
]
}
}
Each attachment object must carry the full {name, path, type, size, host} shape. Paths come from a prior files/create response or from reading the record.
Errors
| Status | Condition |
|---|---|
| 400 | Missing or invalid parameters, invalid base64, field is not a file field, record not found, attachment not found |
| 403 | Field-level edit permissions denied, read-only API key attempting create or delete |
| 413 | Request or file exceeds 10 MB |
| 429 | Rate limit exceeded |
See Errors for the general response format.