Create Image Upload Link
media_upload_link_createGet an upload link for a photo on the user's own device (phone/computer) — the right tool whenever the image is not already at a public URL. Pass pageId (+ editToken for demo pages) and the placement (e.g. header_photo). Then show the returned uploadPageUrl to the user as a clickable link and ask them to open it and pick their photo: the page resizes the image for the web automatically and attaches it to the page, so you do NOT call media_attach afterward. The link expires (see expiresAt). After the user says they've uploaded, call page_get to confirm the photo is on the page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The pageId returned by page_create. | |
| altText | No | Meaningful alt text for the image. | |
| editToken | No | Required for anonymous demo pages. Use the editToken returned by page_create. | |
| placement | No | Where the image should be used. header_photo = business-card top photo, avatar = profile header avatar, block_image = image inside a block (requires blockId), gallery_item = appended to a gallery block, background = page background. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| url | No | ||
| pageId | No | ||
| status | Yes | ||
| altText | Yes | ||
| content | No | ||
| attached | No | ||
| nextStep | No | ||
| variants | No | ||
| deletedAt | No | ||
| expiresAt | No | ||
| placement | Yes | ||
| revisionId | No | ||
| uploadedAt | No | ||
| mediaAssetId | Yes | ||
| uploadPageUrl | No | ||
| revisionVersion | No |