Skip to main content
POST
Upload Knowledge

When to use it

Use this endpoint to add knowledge that your agents will recall later:
  • Files – PDFs, DOCX, Markdown, CSVs, and other documents you want HydraDB to parse and chunk
  • App knowledge – structured content from connected apps (Slack messages, Notion pages, Gmail threads, tickets, CRM records, etc.) where you already have the text, IDs, metadata, and relations, sent as the app_knowledge multipart field (JSON string)
For user-specific context (preferences, conversations), use POST /memories/add_memory instead.

Endpoint

  • Auth: Bearer token
  • Content type: multipart/form-data (always – even when sending only app_knowledge)
  • Idempotency: Controlled by upsert (default true – overwrites existing items with the same ID)
  • Async: Yes – returns 200 with a JSON body (SourceUploadResponse in OpenAPI) including one source_id per queued item. Use POST /ingestion/verify_processing to check status.
The interactive Try it panel is generated from api-reference/openapi.json and uses the multipart field name app_knowledge, matching the OpenAPI spec.

Two ingestion paths

This endpoint accepts two content formats in one request. Send either or both:

Example: Upload files

Example: Upload app knowledge

Form fields

You must provide at least one of files or app_knowledge. You can send both in the same request.

File metadata

Each entry in file_metadata corresponds to the file at the same index in files:

App knowledge

Each item in the app_knowledge JSON array represents a single piece of pre-parsed content. tenant_id and sub_tenant_id are required inside each item. For app-aware retrieval, include the typed app-source fields below. See App Sources for field-by-field guidance, relation examples, and search behavior.
If your data comes from an app, prefer the typed app-source fields over flattening everything into Markdown. Structured IDs and relations let search_apps: true use graph expansion and exact provider IDs during Recall.

Content formats

For typed app sources, primary searchable text belongs in fields, such as fields.body for messages/emails or fields.description for tickets. The top-level content object remains available for legacy or untyped app knowledge payloads. The content object supports multiple content types. Use the field that matches your source - only one needs to be set:
Attachment objects can also include a content object. HydraDB indexes attachments[].content.text and, when text is omitted, attachments[].content.markdown; attachment URLs and titles are metadata and are not fetched or parsed automatically.

Response

Behavior notes

Processing is asynchronous. This endpoint returns once items are queued. Use POST /ingestion/verify_processing with the returned source_ids to check when content is fully indexed.
Always use multipart form data. Even if you’re sending only app_knowledge (no files), the endpoint expects multipart/form-data. Sending JSON directly will return 422 VALIDATION_ERROR.
file_metadata and app_knowledge are JSON strings. Both must be serialized before being sent as form fields. Most HTTP libraries don’t auto-stringify nested JSON in multipart bodies.

Errors

Common codes: 400 INVALID_PARAMETERS, 404 TENANT_NOT_FOUND, 422 VALIDATION_ERROR. See Error Responses for the full list. Read more: Essentials → Memories · Essentials → Metadata

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
tenant_id
string
required

Unique identifier for the tenant/organization

Example:

"tenant_1234"

sub_tenant_id
string
default:""

Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.

Example:

"sub_tenant_4567"

upsert
boolean
default:true

If true, update existing sources with the same id.

Example:

true

files
file[]

Files to upload (documents). Omit or leave empty when only sending app_knowledge.

file_metadata
string | null

JSON array of file metadata objects; length must match files when provided. Each object may include: file_id (optional), metadata, additional_metadata, and relations (forceful relations to other HydraDB source IDs).

app_knowledge
string | null

JSON: single source object or array of app-generated sources to index. Omit when only uploading files.

Response

Successful Response

success
boolean
default:true
Example:

true

message
string
default:Upload initiated successfully
results
SourceUploadResultItem · object[]

List of upload results for each source.

Example:
success_count
integer
default:0

Number of sources successfully queued.

Example:

1

failed_count
integer
default:0

Number of sources that failed to upload.

Example:

1