Share a file
Grants one user, one team, or the whole organization the right to open and download the file. level must be view — a file has nothing to use and no settings to edit, and an edit grantee could re-share data pulled from a connection they may not see — so any other level is 400 invalid_share_level. Re-granting the same grantee replaces the row rather than stacking one. The grantee must be an active member of this organization (or a team of it), and sharing with yourself is 403, as on every other resource. A grantee opens the file with the same GET /file/{id}/content (and MCP elaichi://file/{id}) and sees it in GET /file with access: "view"; sharing never lets them share, revoke or delete it. Revoking, deleting or letting the file expire takes the access away. Audited as file.shared. Owner only: ownership is the gate, and there is no file:share permission. A caller who is not the owner gets 403 ("Only the owner…") whenever the file is visible to them in GET /file (an explicit share, or use on its source connection or toolbox, restricted or not), because they already know it exists; 404 otherwise, including a listed row whose access through a connection or toolbox has broken (can_open: false for a lapsed toolbox delegation or a deleted connection).
Request
- Base URL: https://api.elaichi.ai
- URL: https://api.elaichi.ai/file/{id}/share
- Auth: HTTP bearer
Path parameters
File id (file_…).
Headers
Target organization (org_…). Required for cookie/session auth on org-scoped routes; optional for API tokens, which carry their organization, and rejected when it names a different one.
Request body
Response
Created
Changes
No recorded changes to this operation across all 1 revision of this API.