Skip to main content

Upload Public Media

The following API allows you to upload a media file like a photo or a video to chakra. This is useful to host your files to be accepte by whatsapp apis while sending whatsapp template messages.

Please note that media uploaded via this api are accessible to anyone with the media url.

Note: All the apis accept api key based token authentication and return data within the wrapper { _data:{}, _meta: {}, _errors:[] }

Path

POST /v1/ext/plugin/whatsapp/<pluginId>/upload-public-media

Following are valid examples of the path

POST /v1/ext/plugin/whatsapp/d83e1d23-50b8-4d87-8f92-842a0ac516f6/upload-public-media

Path parameters

ParamDescription
pluginIdThe whatsapp plugin id where you have connected your whatsapp account. Its an UUID. You can copy it from the plugin details page url /admin/plugin/d83e1d23-50b8-4d87-8f92-842a0ac516f6 The last part of the url is the plugin id

Body

The body is a multipart form body with the following parameters

ParamDescription
fileA file object / buffer
filename (optional)The name of the file

Sample Response

{
"_data": {
"publicMediaUrl": "https://chakra-public-media.chakrahq.com/5fc9f8e3-af4a-4f29-bfd8-6c02e3abe3ee/2024-10-17/9b755981-74f7-4cde-b495-cd7039991964.png"
}
}