Upload Knowledge
Ingest documents (files) and/or app-generated content (app knowledge) into a tenant.
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_knowledgemultipart field (JSON string)
POST /memories/add_memory instead.
Endpoint
- Auth: Bearer token
- Content type:
multipart/form-data(always – even when sending onlyapp_knowledge) - Idempotency: Controlled by
upsert(defaulttrue– overwrites existing items with the same ID) - Async: Yes – returns
200with a JSON body (SourceUploadResponsein OpenAPI) including onesource_idper queued item. UsePOST /ingestion/verify_processingto check status.
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
files or app_knowledge. You can send both in the same request.
File metadata
Each entry infile_metadata corresponds to the file at the same index in files:
App knowledge
Each item in theapp_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.
search_apps: true use graph expansion and exact provider IDs during Recall.Content formats
For typed app sources, primary searchable text belongs infields, 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:
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
POST /ingestion/verify_processing with the returned source_ids to check when content is fully indexed.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.Related endpoints
- Next: Verify processing – poll for ingestion status
- Next: Full recall – retrieve ingested content
- Alternative: Add memory – for user memories instead of knowledge
- Related: Delete knowledge – remove sources
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 → MetadataAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Unique identifier for the tenant/organization
"tenant_1234"
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
"sub_tenant_4567"
If true, update existing sources with the same id.
true
Files to upload (documents). Omit or leave empty when only sending app_knowledge.
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).
JSON: single source object or array of app-generated sources to index. Omit when only uploading files.
Response
Successful Response
true
List of upload results for each source.
Number of sources successfully queued.
1
Number of sources that failed to upload.
1