Files Management
Uploads a file and returns its generated file ID.#
/lmkit/v1/files/uploadAccepts a multipart/form-data upload, saves the file to the configured upload directory using a GUID-based filename, writes a manifest containing the original filename, and returns the new fileId.
Request body
application/x-www-form-urlencoded · object
| Property | Type | Description |
|---|---|---|
ContentType | string | |
ContentDisposition | string | |
Headers | object | |
Length | object (int64) | |
Name | string | |
FileName | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 400 | Bad Request |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/files/upload" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/x-www-form-urlencoded"Lists every file extension the upload endpoints accept.#
/lmkit/v1/files/supported-extensionsReturns the complete set of file extensions accepted by POST /upload and POST /from-url, lowercase, dot-prefixed, sorted, and without duplicates. 'extensions' is the full union; 'document' carries the formats the document engine ingests (text, office documents, images, emails - content that can be parsed and indexed), 'audio' the containers accepted for transcription, and 'media' the video/mixed containers accepted for metadata/stream inspection. Clients should call this once at startup (cache the result) and validate file names before uploading, instead of hardcoding an extension list that drifts from server capabilities: a name whose extension is absent from 'extensions' is guaranteed to be refused by name. Membership is the guarantee of acceptance by name, not the only path in - an upload whose name carries NO recognizable extension is still accepted when magic-byte content detection recognizes the format.
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/files/supported-extensions" \
-H "Authorization: Bearer $LMKIT_API_KEY"Registers a file by downloading it from a URL and returns its generated file ID.#
/lmkit/v1/files/from-urlDownloads the content of the supplied http(s) URL server-side and stores it exactly like a direct upload (GUID-based filename + original-name manifest), returning the new fileId. Designed for content that already lives in object storage: pass a short-lived pre-signed URL (Amazon S3, Azure Blob SAS, Google Cloud Storage, MinIO, or any S3-compatible endpoint) and the transfer happens storage-to-server, so the caller never relays the bytes (no double transfer). The same size limit and format allowlist as /upload apply; the file name (explicit file_name, or derived from the URL path) drives the format check, and when the name carries no recognizable extension the downloaded CONTENT decides (magic-byte detection) before the request is rejected. The download follows no redirects, and URLs resolving to link-local addresses (cloud metadata services) are refused; private-network and loopback sources are allowed, so self-hosted object stores work. A source that cannot be fetched (unreachable, non-success status, expired signature) returns 502 Bad Gateway.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
urlrequired | string | Absolute http(s) URL of the content to download. Must be reachable from the server and remain valid for the duration of the transfer (mind short pre-signed URL expirations). |
file_name | string | Optional logical file name (e.g. 'report.pdf'). Its extension drives the same format validation as a direct upload, and it is recorded as the file's original name. When omitted, the name is derived from the last segment of the URL path - pass it explicitly when the URL path is opaque (a storage key without an extension). |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 400 | Bad Request | |
| 415 | Unsupported Media Type | |
| 502 | application/json | Bad Gateway |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/files/from-url" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "",
"file_name": ""
}'Downloads a file by its ID.#
/lmkit/v1/files/{fileId}Returns the file content as a binary download. The response includes the original filename in the Content-Disposition header. This endpoint can be used to retrieve any server-managed file, including files produced by the AI document splitting endpoint.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Deletes an uploaded file by its ID.#
/lmkit/v1/files/{fileId}Removes the file (and its associated manifest) whose filename begins with the provided fileId from the upload directory. Returns 204 on success or 404 if not found.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found |
curl -X DELETE "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Checks whether a file exists by its ID.#
/lmkit/v1/files/{fileId}Returns 200 OK if the file exists, or 404 Not Found if it does not. No file content is returned. Use this for lightweight existence checks.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found |
curl -X HEAD "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Returns file metadata (size, filename) without downloading the content.#
/lmkit/v1/files/{fileId}/infoReturns the file size in bytes and the original filename for the given file ID. Use this for lightweight metadata queries without transferring file content.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/files/$FILEID/info" \
-H "Authorization: Bearer $LMKIT_API_KEY"