Skip to main content
POST
/
documents
/
{data_source_id}
/
upload
Error
A valid request URL is required to generate request examples
{
  "uploadUrl": "<string>",
  "sourceId": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.withrealm.com/llms.txt

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

These endpoints require a custom API data source. See Custom API for setup instructions. This endpoint returns an uploadUrl. Upload your file content using a PUT request to that URL. The file will be processed in the background and indexed into your knowledge base.
curl -X PUT --data-binary @yourfile.pdf "$UPLOAD_URL"
You can pass an optional id to upsert. Calling this endpoint again with the same id overwrites the previous document once the new upload completes. Each call still returns a fresh uploadUrl. For detailed documentation on the upload step, see the Google Cloud Storage resumable uploads documentation.

Rate Limits

600 requests per minute.

Authorizations

Authorization
string
header
required

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

Path Parameters

data_source_id
string
required

Body

application/json
title
string
required
id
string

Optional unique identifier for the document. We enforce uniqueness on our end. Calling this endpoint again with the same id will overwrite the previously uploaded document once the new upload finishes processing. If not provided, a UUID will be generated automatically and returned as sourceId in the response. Must be alphanumeric and can include underscores and hyphens.

Pattern: ^[a-zA-Z0-9_-]+$
meta
object
mimeType
string
url
string<uri>
createdAt
string<date-time>

UTC timestamp in ISO 8601 format (e.g. '2024-03-20T10:00:00Z')

updatedAt
string<date-time>

UTC timestamp in ISO 8601 format (e.g. '2024-03-20T10:00:00Z')

readAccess
string[]

Email addresses of the users that have read access to the document. If not provided, the document can be seen by anyone in Realm. Cannot be an empty array — omit the field instead.

Minimum array length: 1

Response

Success

uploadUrl
string
required
sourceId
string
required