{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/api-reference/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["api-container","api-content","endpoint","api-examples","tabs","tab"]},"redocly_category":"API Reference","searchWeight":120,"type":"markdown"},"seo":{"title":"Upload a file to seal in an encrypted area","description":"Complete API reference and documentation for Freddy AI-powered backend system by Aitronos","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"upload-a-file-to-seal-in-an-encrypted-area","__idx":0},"children":["Upload a file to seal in an encrypted area"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Uploads one or more files that you are going to encrypt, and returns their ids for"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/encrypted-areas/create"},"children":["Create an encrypted area"]},"'s ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["file_ref"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Any file type is accepted"]}," — an archive, a video, a key file, a file whose type your"," ","browser could not determine. That is the difference between this endpoint and the general"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/files/upload"},"children":["file upload"]},", which accepts documents, images and text only: the"," ","general upload reads and indexes what you send it, so it has to understand the format. A file"," ","uploaded here is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["encrypted rather than read"]},", so there is nothing to understand."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Nothing uploaded here is indexed, searchable, or used as assistant context. It exists to be"," ","sealed."]}]},{"$$mdtype":"Tag","name":"ApiContainer","attributes":{},"children":[{"$$mdtype":"Tag","name":"ApiContent","attributes":{},"children":[{"$$mdtype":"Tag","name":"Endpoint","attributes":{"method":"POST","path":"https://api.aitronos.com/v1/organizations/{organization_id}/files/encrypted-area-upload"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requires authentication (bearer token or API key), membership of the organization, and the"," ","permission to create files. Send ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["multipart/form-data"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Encrypted areas are part of Conversations."]}," Where Conversations is switched off for your"," ","account this endpoint answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]},", exactly as the create endpoint does — there is no"," ","arbitrary-file upload surface without the feature."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"limits","__idx":1},"children":["Limits"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Limit"},"children":["Limit"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Files per request"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["10"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Size per file"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100 MB"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Request body"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1 GB (10 files plus multipart overhead)"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A file you intend to send as a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["secure link"]}," has a lower effective ceiling of ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["32 MB"]}," —"," ","that limit belongs to the seal, not to this upload, so an oversized file uploads here and is"," ","refused with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["413"]}," when you create the area. See"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/encrypted-areas/create"},"children":["Create an encrypted area"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"path-parameters","__idx":2},"children":["Path parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["organization_id"]}]}," string ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The organization the files belong to. You must be an active member of it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"body-parameters","__idx":3},"children":["Body parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["files"]}]}," file[] ",{"$$mdtype":"Tag","name":"em","attributes":{"style":{"color":"#ef4444 !important","fontWeight":"600 !important","fontStyle":"normal !important"}},"children":["required"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["One to ten files, as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["multipart/form-data"]}," parts. Each part's declared content type is stored"," ","as given when it is a valid media type, and recorded as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/octet-stream"]}," otherwise —"," ","so a file your browser could not classify still uploads. The filename is stored for display and"," ","travels ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["inside"]}," the sealed area when you encrypt the file; it is never used as a storage"," ","path."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"returns","__idx":4},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The same envelope as the general file upload, so one client parser serves both:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success"]}," — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," when every file stored."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]}," — a short human-readable summary."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["files"]}," — the created file records; take ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["file_ref"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total_uploaded"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total_failed"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errors"]}," — one entry per failed file (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filename"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mime_type"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]},","," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["file_size_bytes"]},"), or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," is written to be shown to a person"]}," — render it."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Status codes: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["201"]}," (all stored), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["207"]}," (some stored, some failed — read ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errors"]},"), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]}," (all"," ","failed for a non-size reason), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["413"]}," (all failed because they were too large, or the request"," ","body exceeded the batch limit)."]}]},{"$$mdtype":"Tag","name":"ApiExamples","attributes":{},"children":[{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.aitronos.com/v1/organizations/org_123/files/encrypted-area-upload\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n  -F \"files=@./secrets.zip\" \\\n  -F \"files=@./id_rsa\"\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import requests\n\nwith open(\"secrets.zip\", \"rb\") as archive:\n    response = requests.post(\n        \"https://api.aitronos.com/v1/organizations/org_123/files/encrypted-area-upload\",\n        headers={\"Authorization\": f\"Bearer {access_token}\"},\n        files={\"files\": (\"secrets.zip\", archive, \"application/zip\")},\n        timeout=120,\n    )\nuploaded = response.json()[\"files\"][0]\n\n# Then seal it, with a note alongside it.\nrequests.post(\n    \"https://api.aitronos.com/v1/encrypted-areas\",\n    headers={\"Authorization\": f\"Bearer {access_token}\"},\n    json={\n        \"audience\": \"link\",\n        \"content_text\": \"The archive password is in our password manager.\",\n        \"file_ref\": uploaded[\"id\"],\n        \"burn_after_read\": True,\n    },\n    timeout=60,\n)\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"JavaScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const form = new FormData();\nform.append('files', file); // a File from an <input type=\"file\"> or a drop\n\nconst response = await fetch(\n  'https://api.aitronos.com/v1/organizations/org_123/files/encrypted-area-upload',\n  { method: 'POST', headers: { Authorization: `Bearer ${accessToken}` }, body: form },\n);\nconst result = await response.json();\nif (result.total_failed > 0) {\n  // Render this verbatim — it is written for the person who tried to upload.\n  showError(result.errors[0].error);\n}\nconst fileRef = result.files[0].id;\n","lang":"javascript"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Response","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"201 Created","header":{"title":"201 Created","controls":{"copy":{}}},"source":"{\n  \"success\": true,\n  \"message\": \"Successfully uploaded 1 file(s)\",\n  \"files\": [\n    {\n      \"id\": \"file_9f2c1d7a4b3e4f0a8c5d6e7f80912345\",\n      \"original_filename\": \"secrets.zip\",\n      \"mime_type\": \"application/zip\",\n      \"file_size\": 20480,\n      \"organization_id\": \"org_123\"\n    }\n  ],\n  \"total_uploaded\": 1,\n  \"total_failed\": 0,\n  \"errors\": null\n}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"Errors","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"413 File too large","header":{"title":"413 File too large","controls":{"copy":{}}},"source":"{ \"success\": false, \"error\": { \"code\": \"FILE_TOO_LARGE\", \"message\": \"This file is larger than the 100 MB limit for an encrypted area.\", \"system_message\": \"This file is larger than the 100 MB limit for an encrypted area.\", \"type\": \"validation_error\", \"status\": 413, \"details\": { \"file_size_bytes\": 209715200, \"cap\": 104857600 }, \"trace_id\": \"...\", \"timestamp\": \"...\" } }\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"403 Not enabled","header":{"title":"403 Not enabled","controls":{"copy":{}}},"source":"{ \"success\": false, \"error\": { \"code\": \"FEATURE_DISABLED\", \"message\": \"This feature is not currently enabled for your organization.\", \"system_message\": \"Encrypted areas are not enabled for this account\", \"type\": \"authorization_error\", \"status\": 403, \"details\": { \"feature\": \"encrypted_area\" }, \"trace_id\": \"...\", \"timestamp\": \"...\" } }\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"422 Too many files","header":{"title":"422 Too many files","controls":{"copy":{}}},"source":"{ \"success\": false, \"error\": { \"code\": \"INVALID_INPUT\", \"message\": \"An error occurred. Please try again.\", \"system_message\": \"Maximum 10 files per request\", \"type\": \"validation_error\", \"status\": 422, \"details\": { \"file_count\": 11, \"max_allowed\": 10 }, \"trace_id\": \"...\", \"timestamp\": \"...\" } }\n","lang":"json"},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-resources","__idx":5},"children":["Related Resources"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/encrypted-areas/create"},"children":["Create an encrypted area"]}," — seal the uploaded file."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/encrypted-areas/fetch-secure-link"},"children":["Fetch a secure-link encrypted area"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/encrypted-areas/fetch-recipient-bound"},"children":["Fetch a recipient-bound encrypted area"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/encrypted-areas/introduction"},"children":["Encrypted areas"]}]}]}]},"headings":[{"value":"Upload a file to seal in an encrypted area","id":"upload-a-file-to-seal-in-an-encrypted-area","depth":1},{"value":"Limits","id":"limits","depth":3},{"value":"Path parameters","id":"path-parameters","depth":2},{"value":"Body parameters","id":"body-parameters","depth":2},{"value":"Returns","id":"returns","depth":2},{"value":"Related Resources","id":"related-resources","depth":2}],"frontmatter":{"title":"Upload a file to seal in an encrypted area","keywords":["encrypted area","upload","any file type","archive","secure send"],"seo":{"title":"Upload a file to seal in an encrypted area"}},"lastModified":"2026-10-26T18:32:31.569Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/api-reference/encrypted-areas/upload","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}