Create attachment upload url
create_attachment_upload_urlUpload a file to FeatureOS storage, or get a presigned URL to upload it yourself.
Two kinds of upload:
Editor image (resource_type set): a jpg/jpeg/png/gif to embed in an article, changelog, post or comment body.
file_urlis a public URL.File custom field (resource_type omitted): any file for a file-type custom field. Requires the custom fields power-up.
Two ways to send the bytes:
content_base64 (files up to 1 MB): the server uploads the file in this same call. No outbound network needed on your side. Use this from a sandbox that cannot reach the storage host.
Presigned PUT (any size up to the org limit): pass file_size, then run the returned
curl_command(a plain HTTP PUT with exactly the signed headers - Content-Length, and Content-Type for images). Callers that cannot reach the storage host should use content_base64 for files up to 1 MB.
Then use file_url. Editor image: embed <img src="{file_url}"> in the
description/body HTML of create/update_article, create/update_changelog,
create/update_feature_request or create/update_comment. Custom field: pass
file_url as the field's value, e.g.
create_feature_request(custom_fields={"<field_slug>": file_url}).
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": {
"filename": "<filename>"
},
"name": "create_attachment_upload_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Name of the file to upload, e.g. 'spec.pdf' or 'screenshot.png'. Used to derive the file extension. | |
| file_size | No | Exact size of the file in bytes. The URL is signed against this size, so an upload of any other size is rejected. Required unless content_base64 is given. | |
| for_resource | No | Custom field uploads only (ignored when resource_type is set): what the file custom field belongs to, 'feature_request' (post fields, default), 'survey', or 'user'. | feature_request |
| resource_type | No | Set to upload an image to embed in that resource's HTML body: 'article', 'changelog', 'feature_request' (post), or 'comment'. jpg, jpeg, png or gif only. Omit for a file custom field upload. | |
| content_base64 | No | Optional: the file's bytes, base64-encoded (a 'data:...;base64,' prefix is fine). Max 1 MB decoded. When given, the server uploads the file itself and returns the ready file_url - use this when you cannot make outbound HTTP requests. Omit for larger files and upload with the returned curl_command instead. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| upload | No |