Skip to main content

Create an upload

POST 

/v1/agents/:agentId/uploads

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

Stages one file for 24 hours, so it can be used anywhere a media link is taken. Two ways:

  • Send the bytes yourself. Give file_name and the exact size_bytes. The upload comes back pending, with upload: the URL, method (PUT) and headers to send the file with, valid for 15 minutes. Send the whole file as the request body with those headers (putUploadContent), for example curl -X PUT -H "X-Upload-Token: …" -H "Content-Type: application/octet-stream" --data-binary @photo.png "$UPLOAD_URL", with upload.url as UPLOAD_URL.
  • Hand over a file as a link. Give file, as ChatGPT passes a file the user attached (download_url, file_id, and maybe mime_type and file_name). Mojeeb downloads it in this call, within 20 seconds, from a public https address (following up to 3 redirects, each to a public https address too), and the upload comes back ready.

An upload holds a JPEG, PNG or WebP image, an MP4 or MOV video, or a PDF or DOCX document, up to 20 MB, its type read from its bytes. Each feature that then reads it checks it against its own types and sizes. Use its url in the media field you need, within 24 hours. A member of the agent can create one; using it needs that feature's own scope. It spends a budget of 10 requests a minute per key.

Request​

Responses​

The upload, pending until its bytes are sent, or ready when it was downloaded.

Response Headers
    X-Correlation-ID

    Correlation id for this request — paste into support tickets.