Attachment Module
The attachment module provides dynamic endpoints for file management using RecordTableType + RecordFunctionType in config/attachments.php.
Scope
- Upload and optional image resizing
- Attachment metadata management
- Link/unlink attachments to arbitrary records
- Folder organization
- Public/private/temp visibility strategies
- Temp attachment lifecycle with timeout and cleanup command
Data Tables
sp_attachmentssp_attachment_linkssp_attachment_folders(renamed fromsp_document_folders; the old config key is kept registered, pointing at the same table, as a deprecated alias for the generic/{table}CRUD route — see Attachment Folder Management)
Main Endpoints
POST /{api_prefix}/{attachment_prefix}/uploadPOST /{api_prefix}/{attachment_prefix}/clone-tempGET /{api_prefix}/{attachment_prefix}/{rpc_prefix}/{id}/view(optional read-time resizing)GET /{api_prefix}/{attachment_prefix}/{rpc_prefix}/{id}/download
With the default rpc_prefix (rpc) the url and download_url fields on an attachment carry the rpc segment (…/sp_attachments/rpc/{id}/view), like preview_url. With an empty rpc_prefix the segment is omitted.
GET|POST /{api_prefix}/{attachment_prefix}/record/{table}/{record_id}(POST body:attachment_idsarray, or the legacy singleattachment_id)DELETE /{api_prefix}/{attachment_prefix}/record/{table}/{record_id}/{attachment_id}GET|POST /{api_prefix}/{attachment_prefix}/foldersPUT|PATCH|DELETE /{api_prefix}/{attachment_prefix}/folders/{id}