Files

Blueprint files (actionstools_app/files/views.py), table em_actions_files (_staging outside production), key (target_uuid, uuid). The file itself lives in B2B documents (B2B documents); this service keeps the metadata row that the UI lists and the activity stream shows.

Method Path Behaviour

POST

/files/

Store the upload response the client received from B2B documents as a file row. Headers X-Actions-TargetUUID, X-Actions-TargetType (default upload-file) and X-username (author email — a header because API Gateway base64-encodes multipart bodies).

GET

/files/

Files of the target, newest first (target_uuid-created_at-index).

GET

/files/<uuid>/

Download: proxies GET {B2BDOCUMENT_API_URL}/download/1/<uuid> with the caller’s headers, cookies and b2bdocument_token=<X-Session-Token>, and streams the bytes back.

DELETE

/files/<uuid>/<b2bdoc_uuid>/

Deletes the document in B2B documents first (/delete/1/<b2bdoc_uuid>), then soft-deletes the row. A 401/403 from B2B documents is returned as-is in meta.

The upload flow is therefore two calls from the client: upload the file to B2B documents, then POST /files/ with that response.