uploads

Request pre-signed URLs to upload files

Request one or more pre-signed URLs to upload your own files (image, video or audio) and reference them in other AI endpoints.

Flow:

  1. Call this endpoint with the content_type of each file. You get, per file, an upload_url (pre-signed PUT), an opaque file_id, and a readable asset_url.
  2. PUT the raw file bytes to each upload_url, including ALL the returned headers. The upload_url expires quickly (expires_in).
  3. Reference the upload by file_id (preferred on AI endpoints) or by asset_url (a plain URL usable anywhere a URL is accepted).
post/v1/ai/uploads/request-url

Request

  • Base URL: https://api.magnific.com
  • URL: https://api.magnific.com/v1/ai/uploads/request-url
  • Auth: API key in header x-magnific-api-key

Request body

Response

OK - Pre-signed upload URLs generated.

Example response

{
  "files": [
    {
      "headers": {
        "Content-Type": "image/png",
        "x-goog-content-length-range": "0,1073741824"
      },
      "file_id": "upl_a1b2c3d4e5f6",
      "upload_url": "https://openapi-generator.tech",
      "asset_url": "https://cdn-magnific.freepik.com/uploads/109580722/upl_img_a1b2c3?token=exp=1783147635~hmac=...",
      "expires_in": 120,
      "asset_url_expires_in": 86400
    },
    {
      "headers": {
        "Content-Type": "image/png",
        "x-goog-content-length-range": "0,1073741824"
      },
      "file_id": "upl_a1b2c3d4e5f6",
      "upload_url": "https://openapi-generator.tech",
      "asset_url": "https://cdn-magnific.freepik.com/uploads/109580722/upl_img_a1b2c3?token=exp=1783147635~hmac=...",
      "expires_in": 120,
      "asset_url_expires_in": 86400
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.