Upload a file
Uploads a file to be stored by Telerivet.
After uploading a file, it can be attached to an outgoing message by passing its ID as a file_id item in the media parameter of project.sendMessage, project.sendBroadcast, or project.sendMulti. This makes it possible to upload a media file once and attach it to many messages, instead of including the file content in every API request.
The file content is provided inline via the data parameter, encoded via Base64, with a maximum decoded file size of 5 MB. Image, video, audio, PDF, and vCard files are supported.
Files are deduplicated by content: if a file previously uploaded via the API in the same project has the same content and MIME type, the existing stored file is returned instead of creating a duplicate.
Request
- Base URL: https://api.telerivet.com
- URL: https://api.telerivet.com/v1/projects/{project_id}/files
- Auth: one of:
- HTTP basic
- OAuth 2 (authorization code, authorization URL https://telerivet.com/oauth/authorize, token URL https://api.telerivet.com/oauth/token)
Path parameters
ID of the Project
Request body
Example request
{
"filename": "image.jpg",
"type": "image/jpeg"
}Response
Successful response
Example response
{
"id": "SF2c72e0be64f38ea9",
"filename": "image.jpg",
"type": "image/jpeg",
"size": 482133,
"category": "outgoing_media",
"source": "api",
"message_id": "SM66bba24d8b6a3a25",
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"time_created": 1751980000,
"user_id": "URba3e403e98f49735",
"project_id": "PJ2ad0100821a98bea"
}Changes
No recorded changes to this operation across all 1 revision of this API.