Skip to main content
POST
Upload a file to the Knowledge Base

Authorizations

Authorization
string
header
required

A group API key, sent as Authorization: Bearer sw_live_…. Keys from staging and the demo start sw_test_ instead. A group admin creates keys in Settings → Integrations → API keys.

Scopes

files:write

Headers

Idempotency-Key
string

Unique per file: any printable text up to 255 characters. A retry with the same key and body within 24 hours answers with the first file instead of making another. Recommended.

Required string length: 1 - 255

Body

multipart/form-data
file
file
required

The file, up to 25 MB.

folderId
string<uuid>

File it in this folder. Omit to leave it in no folder. It takes the folder’s restriction and sharing.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Response

The file an earlier request with the same Idempotency-Key made, or the file the group already held with these exact contents.

data
object
required

A Knowledge Base file. Its description is never returned: it is free text.

{key}
any