Create Instagram post
Input
caption optionalPost caption; empty for none. Max 2200 chars.
Default: ""image_url optionalDirect URL of the image to post (jpeg/png/gif/webp). Fetched by the browser itself, so it works on devices with no outbound network of their own. No size ceiling and no device requirement — the general answer, and the ONLY route for a photo of ordinary size on an extension-paired device.
image_path optionalPath to a local image file, attached straight from disk via CDP — no encoding, no size ceiling. Resolved on the machine RUNNING THE BROWSER, and only works on a device whose browser PERMITS DOM.setFileInputFiles. An extension-paired browser does NOT: it refuses with "Not allowed", and nothing gets around that (builtins.uploadFile with a format:file input is the same CDP call underneath). Absolute paths only. Takes precedence over image_url.
image_base64 optionalThe image bytes as base64 (a bare payload or a full data: URL), decoded in-page — needs no network and no CDP, so it is the only local-file route on an extension-paired device. CAPPED AT ~96KB OF BASE64, i.e. about a 72KB file: the MCP endpoint answers `Payload Too Large` above that, before this script runs, so nothing here can report it. A camera photo will not fit — use image_url. Line-wrapped output, base64url and missing padding are all accepted. Takes precedence over image_path and image_url.
Output
url requiredPermalink of the new post.
code requiredShortcode of the new post.
pk optionalMedia pk.
caption optionalimage_bytes optionalSize in bytes of the image injected into the composer. null for image_path, where the browser opens the file itself and the bytes never cross the driver boundary.
