Upload a file to send
POST/v1/profiles/{profile_id}/uploads
- Scope
messages:send
For files that aren't at a public URL: this answers an upload_url; PUT the bytes there within 15 minutes, then send with attachments: [{ upload_id }]. Uploads can be sent for 7 days.
Parameters
Path
profile_idstringrequiredThe line (
prf_…).
Request body
file_namestringrequiredThe file's name.
mime_typestringIts type, such as
image/jpeg.size_bytesintegerrequiredIts exact size in bytes.
Response
201 CreatedWhere to upload.
idstringrequiredupl_…object"upload"requiredprofile_idstringrequiredprf_…file_namestringrequiredsize_bytesintegerrequiredmethod"PUT"requiredupload_urlstringrequiredPUT the file's bytes here, exactly
size_byteslong, within 15 minutes.upload_expires_attimestamprequiredexpires_attimestamprequiredUntil when sends may name this upload (7 days).
Errors
| Status | Code | Means |
|---|---|---|
| 503 | storage_disabled | File storage is off on this server. |
| 400 | validation_failed | A field is missing or invalid. |
| 401 | unauthorized | The API key is missing, unknown or revoked. |
| 403 | insufficient_scope | The API key lacks the scope this needs. |
| 404 | not_found | No such object, or the key can't see it. |
Every error is { "error": { "code", "message" } }. All error codes.