Setting up an API data source
1
Create the data source
On the Data sources page, click Add next to API data source and give it a name. After creating it, you can upload a custom icon on the data source page. The name and icon appear in search results so users can identify where the content came from.
2
Create an API key
Go to Settings > API Keys and click Create New Key. Enable the Write documents to Realm permission. Copy the key immediately, as it won’t be shown again. See API Keys for full details.
3
Push documents
Use the REST API to push documents to your data source. See the Upsert Documents API reference and the examples below.
Pushing documents
Send a POST request to add or update documents. To update a document, send another request with the sameid.
url, meta, createdAt, readAccess, and verified.
Set verified to true on each upsert or upload while the source system
currently treats the document as authoritative. If a later request for the same
document omits verified or sends false, Realm stops asserting that
source-managed verification:
Uploading files
For binary files (PDFs, Word documents, etc.), use the two-step upload flow:Listing documents
Retrieve documents from your data source with cursor-based pagination:nextCursor from the response to fetch the next page. See the API Reference for all query parameters.
Deleting documents
Delete all documents older than a given timestamp:Access control
By default, documents are visible to all users in your organization. To restrict access, include areadAccess array with the email addresses of users who should see the document:
Sync behavior
Unlike native data sources, API data sources do not sync automatically. You are responsible for keeping documents up to date. Common approaches:- Cron job that periodically exports data and pushes it to Realm
- Webhook handler that pushes documents when they change in your source system
- CI/CD pipeline that pushes documentation after each deploy

