tebarDocs
GuideDevelopersAPI ReferenceChangelog
Media

Upload a file in one request

POST
/v1/media/upload

The raw file as the body: an image (up to 8 MB) or a video (up to 300 MB); the type is read from the bytes. JSON or form bodies: 415 raw_body_required. In production the body is limited to 100 MB: use a chunked or presigned upload for larger files.

Requires the write scope.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (tb_live_...) from the dashboard, or an OAuth access token.

Query Parameters

keep?string
Value in"true""false"

Header Parameters

Tebar-Profile?string

Limits an owner key to one profile (id or external_id). Unknown: 404 profile_not_found.

Request Body

The file bytes.

body*fileapplication/octet-stream
Formatbinary

Response Body

The media, ready to use.

application/json
  1. response
id*string
Formatuuid
profile_id*string
Formatuuid
type*string
Value in"image""video"
mime_type*string
size_bytes*integer|null
width*|

Display width (video rotation applied).

height*integer|null
duration_ms*integer|null
frame_rate*|

Average frames per second of a video.

status*string
Value in"pending""ready""failed""expired"
public_url*string|null
poster_url*|

Videos: a small JPEG still, ready shortly after upload.

alt_text*string|null
keep*boolean

Kept in the media library. Otherwise removed 30 days after the last post using it finished, or 7 days after upload if unused.

created_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.tebar.app/v1/media/upload' \
  -H 'Content-Type: application/octet-stream' \
  -d 'string'
Example Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "profile_id": "bfcb6779-b1f9-41fc-92d7-88f8bc1d12e8",
  "type": "image",
  "mime_type": "string",
  "size_bytes": 0,
  "width": 0,
  "height": 0,
  "duration_ms": 0,
  "frame_rate": 0,
  "status": "pending",
  "public_url": "string",
  "poster_url": "string",
  "alt_text": "string",
  "keep": true,
  "created_at": "2019-08-24T14:15:22Z"
}