Skip to main content
POST
Upload a file

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required

The file to store

contextType
enum<string>
default:content-property

What the file is for. Send content-property for media that becomes widget content (images, video and PDF); the other values are used by Widgetic's own editor.

Available options:
widget-codegen,
browser-ic,
content-property
source
enum<string>
default:file-browser-upload

Which part of the product, or which client, the file comes from

Available options:
chat-upload,
chat-screenshot,
browser-ic-screenshot,
preview-screenshot,
file-browser-upload
managedUserId
string<uuid>

Upload the file for one of your managed users, by Widgetic's id for the user. Send this or managedUserExternalId, not both.

managedUserExternalId
string

The same, by your own identifier for the user, the externalId you gave when you created the managed user. Send this or managedUserId, not both.

Maximum string length: 255
purpose
enum<string>

Where in your product you use the file. It is kept with the file, so that a customer's storage can be counted by purpose (getManagedUserStorageUsage). Optional; any other value is refused with 400 and UPLOAD_INVALID_PURPOSE.

Available options:
canvas,
chat,
field

Response

The stored file

success
boolean
required

Always true on a success.

Example:

true

data
object
required

A file stored for the account that uploaded it.

Example:
meta
object

Extra information about the answer: where a page sits in a list, the cursor of the next page, or warnings about a call that succeeded with a caveat.