---
title: "Upload a file to GridFS for use in a chat message"
method: POST
path: "/api/lia/upload_source_file"
tags: ["Lia"]
---

# Upload a file to GridFS for use in a chat message

`POST /api/lia/upload_source_file`

## Request

- Base URL: `https://api.leapsurgebi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.leapsurgebi.com/api/lia/upload_source_file`
- Auth: OAuth 2
  - Password
  - Token URL: `/auth/token`
- TypeScript: <https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/docs/api/lia/upload_source_file/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `user-code` string, required: Base64 encoded user_code

## Request body `multipart/form-data`

- BodyUploadSourceFileApiLiaUploadSourceFilePost
  - `file` string, binary, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-24** `23b42df3193a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/changes/api/lia/upload_source_file/post.md)

---

[API](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi.md) - [All operations](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/llms.txt) - [OpenAPI document](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/revisions/13653cb8ee76?raw)
