Use an API source to push documents directly via API, using the source’s UID and an API Key. This gives you full control over what goes into the source and when it changes. In the API, a source is called an index.
Base route:
https://api.raffle.ai/v2/sources/
Source UID: the unique id of your API source, shown on the source’s Docs page in the Raffle web app. You will reference it in every endpoint as {index_uid}.
{index_uid}
For the most up to date technical documentation, refer to the API Reference.
You can set different parameters:
Check the Document Schema section below.
Available parameters
Create an API Key in Workspace → API (the key is shown only once). Only Account Admins can create keys. See API keys.
Use the header on every request:
X-API-Key: <your-api-key>
/documents — List documents {#get-documents}
GET https://api.raffle.ai/v2/sources/{index_uid}/documents
Documents are returned sorted by their uid. To fetch the next page, pass the uid of the last document you received as after-uid.
uid
after-uid
Query parameters
limit
Response
{ "documents": [ { "uid": "document-123", "title": "Example Document", "content": "<p>Content here</p>", "source_url": "https://example.com/document-123", "last_modified": "2026-01-31T12:00:00Z" } ] }
/documents/{document_uid} — Get a document {#get-document}
GET https://api.raffle.ai/v2/sources/{index_uid}/documents/{document_uid}
Returns a single document, with the same fields as in the list above. If the document doesn’t exist, the API answers 404.
404
/documents/{document_uid} — Upsert (create or update) {#put-document}
PUT https://api.raffle.ai/v2/sources/{index_uid}/documents/{document_uid}
Purpose
This endpoint both creates new documents and updates existing ones based on the document_uid you provide.
document_uid
Path parameters
Request body
title
content
source_url
last_modified
A missing or empty required field, or a value over its limit, is rejected with 400.
400
Why upsert?
Most teams already maintain content in a database or external system. Reusing your system’s stable id keeps mapping trivial. When creating, pass a stable id as document_uid — e.g., your DB entity id, a UUID you generate, or the source_url. One of those should be used as the id you send.
HTTP/1.1 200 OK
The response has no body.
/documents/{document_uid} — Delete a document {#delete-document}
DELETE https://api.raffle.ai/v2/sources/{index_uid}/documents/{document_uid}
Standardized error payload:
{ "code": 404, "message": "The specified index does not exist" }
X-API-Key
401
Read more about Api-Index in the API Reference.
Guides