Bloss Docs

Upload a file for an onboarding question

Developers
POST
/creator/onboarding/runs/{runId}/uploads

Uploads the file answer to a file question (a form field of type "file_upload") in an open step of your onboarding run (see creator.onboarding.run.get for the fields, which types they accept and their size limit). 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: creator.onboarding.uploads.finalize. Either way you get a file object: put it, as is, under the field's id in the step's answers (creator.onboarding.step.answers.save or creator.onboarding.step.submit). A question that isn't open is 409 conflict; a type or size the field doesn't take is validation_failed; a run takes at most 50 files and 1 GB in all (validation_failed, code "quota").

Authorization

bearerAuth creator: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: creator:write

Path Parameters

runId*string

Your onboarding run's id, from creator.onboarding.start.

Length1 <= length

Request Body

application/json
  1. body
fieldId*string

The file question's field id, from the step's form.

Length1 <= length <= 64
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 (image/jpeg, application/pdf, video/mp4…). Required in mode (a); in mode (b), only when the link reports the wrong type.

Length1 <= length <= 100
sizeBytes?integer

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

Range0 < value <= 9007199254740991
name?string

The file name the brand sees. Defaults to the link's file name.

Lengthlength <= 500

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"
fileId*string
uploadToken?string

Mode (a): send it to creator.onboarding.uploads.finalize. It expires after an hour.

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 answer for the field, when status is "ready".

curl -X POST 'https://example.com/api/v1/creator/onboarding/runs/string/uploads' \  -H 'Content-Type: application/json' \  -d '{  "fieldId": "string"}'
{  "status": "awaiting_upload",  "fileId": "string",  "uploadToken": "string",  "uploadUrl": "string",  "method": "PUT",  "headers": {    "property1": "string",    "property2": "string"  },  "expiresInSeconds": 0,  "file": {    "fileId": "string",    "name": "string",    "size": 0,    "contentType": "string"  }}

Was this page helpful?