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.
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
| Status | Description |
|---|---|
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. |
Returns the attachment's metadata: bocp_id, doctype, doc_id, client_id, title, original_filename, filesize, is_public, attachment_type_id, uploaded_ts.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
attachment_id |
path | integer | yes |
Responses
| Status | Description |
|---|---|
200 |
OK — response uses the shared envelope. |
401 |
Missing or invalid Basic Auth credentials. |
404 |
The requested resource does not exist. |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
attachment_id |
path | integer | yes |
Responses
| Status | Description |
|---|---|
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.