Attach file to post
attach_mediaAttach one image or video from ChatGPT to an existing personal post. Pass the file reference (including a generated image if the client supports it); ChatGPT resolves it to a temporary download URL via openai/fileParams. Never invent a download URL or pass a sandbox path/base64 as a URL; if the client cannot resolve the file, use a real public mediaUrls URL or upload local bytes. Publora downloads, validates and stores the bytes immediately. Optional fileName overrides the original name for SEO. Leaves the post in draft, demoting scheduled posts; never publishes. No HTTP PUT or complete_media is needed. Supports jpeg, png, gif, webp, tiff, avif (up to 25MB), mp4, mov, webm (up to 150MB). Verify the ready attachment with get_post and schedule separately only if requested. Retries for the same post/file ID are deduplicated for 24 hours even if the temporary URL changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| fileName | No | Optional descriptive file name with extension, e.g. temporary-lpn-jobs-connecticut.png; overrides file.file_name. The basename is sanitized for storage. | |
| postGroupId | Yes | Existing post group ID; create a draft first if needed | |
| idempotencyKey | No | Optional explicit retry key. Defaults to a stable key for this post and file ID. Reuse the same key, file ID and file name when retrying; the download URL may change. |