POST
/
admin
/
uploads
/
presigned-urls
import Medusa from "@medusajs/js-sdk"

export const sdk = new Medusa({
  baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
  debug: import.meta.env.DEV,
  auth: {
    type: "session",
  },
})

sdk.admin.upload.presignedUrl({
  name: "test.txt",
  size: 1000,
  type: "text/plain",
}))
{
"url": "<string>",
"filename": "<string>",
"originalname": "<string>",
"mime_type": "text/csv",
"extension": "csv",
"size": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The details of the file to upload.

Response

200
application/json

OK

The result of the pre-signed URL upload request.