Skip to navigation

Upload Media

View as Markdown

Uploads one image to the media library. Needs a key with Website Content: Read and Write (website-content:write).

Send the body as form-data, not JSON. In Postman, choose the file in the file row.

Uploading the same image twice. When you send a source_url and a live media item already has that source_url, the existing item is returned and the new file is discarded, so a re-run does not fill the library with copies. A name or alt you send updates the existing item. Without a source_url, every upload stores a new item.

Two uploads with the same source_url at the same moment wait for each other. If one waits more than about 10 seconds it returns 409 and nothing is stored; send it again.

Headers

GorillaDash-Api-KeystringOptional
Gorilla Dash API Key
GorillaDash-Api-SecretstringOptional
Gorilla Dash API Secret

Request

This endpoint expects a multipart form containing a file.
filefileRequired
Required. JPEG, PNG, GIF or WebP, up to 20 MB. SVG and anything else returns 422.
namestringRequired
Optional, max 255. Defaults to the file name without its extension.
altstringRequired
Optional, max 255.
source_urlstringRequired

Optional, max 2048. A label only; Gorilla Dash never downloads it.

Response

Created
successboolean
statusinteger
dataobject

Errors

409
Conflict Error
422
Unprocessable Entity Error