Knowledge

Start an upload

POST
/api/v1/knowledge/bases/{kb_id}/uploads

Opens an upload of one file into the base. PUT each parts[i].url with exactly part_size bytes (the last part may be shorter) and exactly parts[i].headers — no Authorization header — then complete it with each part's ETag, as the ETag header gave it. A part's URL is good for an hour; the session expires at expires_at. Only the key that started an upload can complete it.

More in Knowledge API.

apiKey
headerAuthorizationBearer <token>

An API key, sk-syn- and 32 characters. On SynapseOrch Cloud an owner or admin makes it under Settings → Developer; on a self-hosted install, under Settings → API Keys.

kb_id*string
application/json
  1. body
filename*string
Length1 <= length <= 255
size_bytes*integer
Range1 <= value
mime*string
Lengthlength <= 255
path?|null
metadata?

Response Body

Successful Response

application/json
  1. response
upload_id*string
part_size*integer
parts*array<>
expires_at*string
curl -X POST "https://api.synapseorch.com/api/v1/knowledge/bases/kb_01a10d3f5a7c9e1b3d5f7a9c1e3b5d7f/uploads" \  -H "Authorization: Bearer sk-syn-..." \  -H "Content-Type: application/json" \  -d '{    "filename": "string",    "size_bytes": 1,    "mime": "string"  }'
{  "upload_id": "string",  "part_size": 0,  "parts": [    {      "part_number": 0,      "url": "string",      "method": "PUT",      "headers": {        "property1": "string",        "property2": "string"      }    }  ],  "expires_at": "string"}