Convert a file
convertConvert a file to another format and return a download link. Give it one of: source_url (any URL the server can fetch — the best option when the file is already somewhere reachable) or import_id (from create_upload — the way in for a file on someone's device or in your own sandbox, whatever its size). There is deliberately no way to pass the bytes inline: those calls are relayed and routinely never arrive, leaving the person watching a spinner. Settings such as resizing, quality or codecs go in options — call list_options first to get the exact names for the conversion. Runs against your account and counts toward your quota.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | Conversion settings, keyed by the option names from list_options — e.g. {"resize_width_image": 1000, "aspect_ratio_image": true}. Names differ per conversion, so do not guess them. | |
| filename | No | File name of the source, e.g. "photo.jpg". Required with source_base64 unless input_format is given. | |
| import_id | No | Id returned by create_upload, after the bytes have been PUT to its upload_url. Use this for local files of any size. | |
| source_url | No | URL of the file to convert, fetched by our server. Any link reachable from the internet works, including a temporary or signed URL for a file the user attached to this conversation — prefer this whenever you have such a URL, because nothing about the file has to pass through the conversation itself. | |
| input_format | No | Source format (optional; inferred from the file name or URL). | |
| output_format | Yes | Target format, e.g. "jpg", "pdf", "mp3". |