Send a small file (under about 700 KB) as base64 text and get a file_id.
Send a small file such as a logo or image inline as base64 and get a file_id to use with file_id on POST /kb/documents/import. Accepted: PDF, Word, PowerPoint, Excel, CSV, TXT, Markdown, JSON, HTML, PNG, JPG, GIF or WebP images, MP4 or MOV video, MP3, WAV or M4A audio, up to 100 MB (each knowledge base can set a lower limit). Request bodies are capped at 1 MB, so files over about 700 KB must use POST /files/upload-links instead. The real file type is read from its bytes, never from the name. Programs, SVG images, old .doc/.ppt/.xls files, Office files with macros, embedded objects or outside links, and PDFs with scripts are refused. A file is kept for 24 hours and can only be used by the same API key or connected app, with this service.
https://app.softsolz.uk/api/v1/services/smart-chat/filesRecent Requests
Log in to see full request historyHeaders
AuthorizationstringrequiredBearer token: `Bearer sk_live_...` (or `sk_test_...` for sandbox). A login token will not work here.
Idempotency-KeystringOptional idempotency key for safe retries.
Body Params
file_namestringFile name, e.g. logo.png.
content_base64stringThe file bytes, base64 encoded.
sha256stringOptional hex SHA-256 of the file, to catch a damaged transfer.
Response
Response Body
file_idstringPass this id to the service to use the file.statusstringready means the file passed every check and can be used.file_namestringCleaned file name.kindstring | nullWhat the file turned out to be, read from its bytes.mimestring | nullMedia type read from the bytes.size_bytesintegerSize in bytes.sha256string | nullHex SHA-256 of the file.reject_codestring | nullWhy the file was refused, when status is rejected.expires_atstring | nullWhen the file (or, before upload, the link) stops working.created_atstringWhen it was created.Request
import { SoftSolz } from '@softsolz/sdk';
const client = new SoftSolz({ apiKey: process.env.SOFTSOLZ_API_KEY });
const result = await client.smartChat.uploadFile({});console.log(result);Credentials
Sent as a Bearer token. Stored only in your browser.
Response · 201
{ "data": { "file_id": "string", "status": "string", "file_name": "string", "kind": "string", "mime": "string", "size_bytes": 0, "sha256": "string", "reject_code": "string", "expires_at": "string", "created_at": "string" }}