Upload media
POST/api/v1/media/upload
Get a media ID for an image. You then use the ID in Send RCS instead of sending the image again. For a PDF, use Start a PDF upload.
Give the image in one of two ways, one per call:
- A file. Send it as a
multipart/form-datarequest with the image in a part namedfile. - A link. Send a JSON body with a
urlmember. Theurlis a publichttpsaddress of the image, and the answer is the same as for a file.
Send a file or a link, not both. Only a top-level url member in a JSON body is read; a form field or query parameter named url is ignored.
The image has to be a JPEG, PNG or GIF of at most 2 MB, at most 10000 pixels on each side and 40 megapixels in all. HelloSMS judges the image by its content, so the file name and the type you send are not used.
The media ID lasts 24 hours from the upload, and you can use it as many times as you like until then. After that you have to upload the image again.
Three limits apply to each account. A refused call stores nothing.
- Uploads at once: 5. A refused call answers
429with aRetry-Afterheader of10seconds. - Uploads per hour: 500, counting every upload that got as far as being stored. A refused call answers
429with aRetry-Afterheader: the number of seconds until there is room for one more. - Storage: 10 GB, or 100 GB on Premium and Gold plans, and 1 GB for test accounts. It counts the images that haven't expired yet, plus the one you are uploading. A refused call answers
400, since room only frees up as images expire.
HelloSMS can raise or lower a limit for your account on request. The error text then shows your own number. A limit set to 0 refuses every upload, with no Retry-After.
Like Send RCS, the call needs RCS enabled for your account and an approved RCS sender: contact support.
Request
- multipart/form-data
- application/json
- Body
- A file
Bodyrequired
The image, as a file or as a link.
The image: a JPEG, PNG or GIF of at most 2 MB. Send exactly one file part.
{
"file": "@photo.jpg"
}
Responses
- 200
- 400
- 401
- 429
- 500
The image was stored. Use mediaId in Send RCS within 24 hours.
Bad Request. Nothing was stored.
Unauthorized.
Too Many Requests. You hit one of the upload limits. Nothing was stored. When the answer has a Retry-After header, wait that many seconds before you try again.
Response Headers
The number of seconds to wait before you try again. Left out when the account's limit is 0.
The image could not be stored. Nothing was stored, and trying again is safe.