« All modules

Attachments

Fișiere atașate — upload files and attach them to any document, read attachment metadata, delete attachments. Files are stored on the account's external FTP storage (Setări cont → Setări Avansate → External FTP storage), which must be configured.

Filters on list endpoints are URL path segments, not query strings — see Conventions. The Swagger tester works best for JSON body endpoints.
POST /attachments/upload/ Upload a file and attach it to a document

Uploads a file and attaches it to an existing BOCP document. Multipart form-data body.

The file is stored on the account's external FTP storage (Setări cont → Setări Avansate → External FTP storage); a 503 is returned when that storage is not configured or unreachable.

Notes:
- server-executable file extensions (php, cgi, sh, asp, ...) are rejected with 400
- large images are automatically resized and some document types are compressed by the storage layer — always download the file through its BOCP access URL, never directly from the FTP host
- GET /attachments/upload/ returns this documentation inline

Responses

StatusDescription
200 OK — `data.attached_file_rec_ids` holds the new attachment id(s).
400 Request is malformed or a required field is missing / invalid.
401 Missing or invalid Basic Auth credentials.
503 The account's external FTP storage is not configured or is unreachable — retry later.
GET /attachments/{attachment_id}/ Attachment metadata

Returns the attachment's metadata: bocp_id, doctype, doc_id, client_id, title, original_filename, filesize, is_public, attachment_type_id, uploaded_ts.

Parameters

NameInTypeRequiredDescription
attachment_id path integer yes

Responses

StatusDescription
200 OK — response uses the shared envelope.
401 Missing or invalid Basic Auth credentials.
404 The requested resource does not exist.
DELETE /attachments/{attachment_id}/ Delete an attachment

Deletes the attachment: the file on the external FTP storage, the metadata row and its download secret key.

When the external FTP storage is unreachable the attachment is kept and a 503 is returned — retry later. Requires the DELETE HTTP method to be allowed for your API user.

Parameters

NameInTypeRequiredDescription
attachment_id path integer yes

Responses

StatusDescription
200 Deleted — `data.deleted_attachment_id` confirms the removed id.
401 Missing or invalid Basic Auth credentials.
404 The requested resource does not exist.
503 The account's external FTP storage is unreachable — the attachment was NOT deleted, retry later.

This page is generated from openapi.json.