Skip to main content
POST
/
datasources
/
uploads
Python
from meibel import MeibelClient

client = MeibelClient(api_key="your-api-key")

# Upload a file
with open("document.pdf", "rb") as f:
    result = client.datasources.file_uploads.upload_content(file=f, filename="document.pdf")
    print(result)
{
  "success": true,
  "message": "<string>",
  "datasource_id": "<string>",
  "upload_id": "<string>",
  "sse_url": "<string>",
  "estimated_files": 123,
  "estimated_size": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Meibel-API-Key
string
header
required

Body

multipart/form-data
files
file[]
required

One or more files to upload

datasource_id
string

ID of an existing datasource to upload to. Provide this or name.

Example:

""

name
string

Name for a new datasource to create. Provide this or datasource_id.

Example:

""

description
string

Description of the new datasource (only used when creating with name).

Example:

""

metadata_config
MetadataConfigRequest · object

Configure automatic metadata extraction from documents on ingest.

Response

Successful Response

Result of an async upload — files are accepted and streamed asynchronously.

success
boolean
required

True if the upload was accepted for processing

message
string
required

Human-readable status message

datasource_id
string
required

ID of the datasource the files were uploaded to (created on the fly if name was supplied)

upload_id
string
required

Identifier for this upload batch — use with the SSE stream to track progress

sse_url
string
required

Server-sent-events URL to stream upload progress until 'stream_complete'

estimated_files
integer | null

Number of files the server expects to process for this upload

estimated_size
integer | null

Total estimated size of the upload in bytes