Search the documentation

Pick a page and open it with Enter.

Uploads

Store attachments and get an address back (multipart).

POST/api/v1/uploads

Upload one or more original files as multipart/form-data. The response returns an ID and metadata for each file; use those IDs in a chat message's attachment_ids.

All file types are accepted, including text, ZIP, documents and unknown MIME types. An active session is required through X-Session-Id; the bundled frontend forwards it automatically.

Form fields

filesfile[] · multipartrequired

One or more files, at most UPLOADS_MAX_FILES per request, each within UPLOADS_MAX_BYTES.

Example request

bash
curl -X POST http://localhost:8000/api/v1/uploads \
  -H "X-Session-Id: $SMEEWARE_SESSION" \
  -F "files=@project.zip"

Response

json
{
  "files": [
    {
      "id": "a904577a208845c98dbce47c1d4655f5",
      "filename": "project.zip",
      "media_type": "application/zip",
      "bytes": 245113,
      "path": "/srv/smeeware/data/uploads/a904577a208845c98dbce47c1d4655f5.zip"
    }
  ]
}

The filename is kept for display and downloads. Disk names use generated IDs. path describes the backend location; chat requests use the ID rather than a caller-supplied filesystem path.

201

Stored.

401

No active session.

413

File too large: code file_too_large, details { max_bytes, filename }.

422

Empty file, invalid form or too many files. too_many_files includes details.max_files.

500

Uploads are disabled (UPLOADS_ENABLED=false).