انتقل إلى المحتوى الرئيسي

Put media on an AI attachment from links

POST 

/v1/agents/:agentId/attachments/:attachmentId/media/import

x-scope: "attachments:write"
x-rate-limit-per-minute: 10

Mojeeb downloads the attachment's media from https links and stores it as an upload would, replacing whatever was stored: one link for a photo, video or document, or up to 10 for an album's images, in order. For a client that can't send files, such as an AI assistant. A link can also be the url of a Mojeeb upload of this agent (createUpload), read from Mojeeb's storage instead of downloaded. Each link must answer 200 with the file itself within 20 seconds: redirects aren't followed, and a link to an address that isn't public is refused. A link that fails is 422 attachment_media_url_invalid; a file that arrives but isn't what the type takes is 422 invalid_media, with the same types and sizes as uploadAttachmentMedia. Nothing stored changes until every file passes. A video is re-encoded, so 503 media_processing_busy can answer here too. It shares the budget of 10 requests a minute per key with uploadAttachmentMedia.

Request​

Responses​

The attachment with its new media.

Response Headers
    X-Correlation-ID

    Correlation id for this request — paste into support tickets.