Bloss Docs

Upload a file for a managed account

Developers
POST
/managed/uploads

Uploads a post's media or a profile picture for a managed account, and gives back its file id. Name what it's for: accountId for a post on a delivered account (you must be able to post from it), or orderId for an unfinished setup or its first post (full admins and account owners). purpose: "post_video" (a video post's one video: MP4, MOV or WebM), "post_image" (carousel images: JPG, PNG or WebP), "story_image" (a story's one image), or "avatar" (a profile picture). Two ways to send the file. (a) Two steps: send contentType and sizeBytes (the exact byte count), PUT the raw bytes to the returned uploadUrl with the returned headers before expiresInSeconds runs out, then call the finalize operation named below. (b) One call: send url, a public https link to the file; Bloss downloads it (the link must report its size) and answers with the finished file (status: "ready"), so no PUT and no finalize are needed. Use (b) when the file is already online, (a) for a file you hold. Finalize: managed.uploads.finalize. Then use the file id in mediaFileIds (managed.account.post.create / .update, managed.order.first-post.media.replace), avatarFileId (managed.order.update) or pictureFileId (managed.account.review). A type or size the purpose doesn't take is validation_failed (details.code MEDIA_TYPE_UNSUPPORTED or MEDIA_TOO_LARGE). Uploads are limited per hour and in megabytes per day (429 rate_limited).

Authorization

bearerAuth managed:write
headerAuthorizationBearer <token>

Personal access token. Scopes: account:read, creator:read, creator:earnings, managed:read, coach:read, brand:read, creators:read, videos:read, analytics:read, onboarding:read, onboarding:signatures, engagement:read, support:read, integrations:read, payouts:read, funds:read, billing:read, groups:write, videos:write, onboarding:write, sync:write, payouts:write, campaigns:write, brand:write, creators:write, engagement:write, support:write, accounts:write, payments:write, creator:write, creator:payouts:write, managed:write, coach:write, agency:write.

Scope: managed:write

Request Body

application/json
  1. body
accountId?string

The managed account a post's media is for.

Length1 <= length
orderId?string

The order (unfinished setup) a profile picture or first post file is for.

Length1 <= length
purpose*string

"post_video", "post_image", "story_image" or "avatar".

Value in"post_video""post_image""avatar""story_image"
url?string

Mode (b): a public https link to the file. Bloss downloads and finishes it in this call.

Formaturi
Lengthlength <= 2000
contentType?string

The file's type (video/mp4, image/jpeg…). Required in mode (a); in mode (b), only when the link reports the wrong type.

Length1 <= length <= 120
sizeBytes?integer

Mode (a): the file's exact size in bytes. The upload URL is signed for this size.

Range0 < value <= 9007199254740991
fileName?string

The file's name, for your own reference.

Length1 <= length <= 200

Response Body

Success.

application/json
  1. response
status*string

"awaiting_upload" (mode a: PUT the bytes, then finalize) or "ready" (mode b: the file is done).

Value in"awaiting_upload""ready"
uploadId*string

The upload's id, which is also the file's id once finished.

uploadUrl?string

Mode (a): PUT the file's bytes here.

method?string
headers?

Mode (a): send these headers with the PUT (its Content-Type).

expiresInSeconds?number

Mode (a): how long the upload URL works.

file?

The finished file, when status is "ready".

curl -X POST 'https://example.com/api/v1/managed/uploads' \  -H 'Content-Type: application/json' \  -d '{  "purpose": "post_video"}'
{  "status": "awaiting_upload",  "uploadId": "string",  "uploadUrl": "string",  "method": "PUT",  "headers": {    "property1": "string",    "property2": "string"  },  "expiresInSeconds": 0,  "file": {    "fileId": "string",    "contentType": "string",    "sizeBytes": 0,    "previewUrl": "string"  }}

Was this page helpful?