Share a file
share_fileShare a file in one call and get a download link. Pass name and content_text (or content_base64). Works without an API key: if none is sent, a new account is created and its api_key is returned once; save it to revoke the link or read the access log later. Default link: anyone with the link, expires in 7 days.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "share_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional attribution label. Lowercase letters, digits, dot, underscore, or hyphen. At most 64 characters. | |
| mime | No | MIME type. Inferred from the file name when omitted. | |
| name | Yes | File name with an extension. No slashes or control characters. | |
| api_key | No | Secret API key from signup. Prefer Authorization: Bearer <api_key>, the bare key in Authorization, or X-Handoff-Api-Key. Pass this only when you cannot set headers. Do not write it into a file you share. | |
| audience | No | Default anyone_with_link. | |
| max_opens | No | Successful downloads allowed. Omit for no limit. | |
| content_text | No | UTF-8 text. Pass exactly one of content_text or content_base64. | |
| audience_value | No | Required when audience is agent. | |
| content_base64 | No | Standard or url-safe base64. A data:*;base64, prefix is stripped. Example: aGk= | |
| expires_in_hours | No | Hours until the link expires. Default 168 (7 days). | |
| requires_approval | No | Default false. When true, downloads wait until the owner approves. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| next | Yes | ||
| api_key | No | ||
| file_id | Yes | ||
| grant_id | Yes | ||
| max_opens | Yes | ||
| expires_at | Yes | ||
| token_prefix | Yes | ||
| requires_approval | Yes |