Use the API Index to push documents directly via API using your Index UID and an API Key. This gives you full control over what goes into your index and when it changes.
Base route:
https://api.raffle.ai/v2/indexes/
Index UID: the unique id of your index (visible in the product UI). 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 API Keys (the secret is shown only once).
Use the header on every request:
X-API-Key: <your-api-key>
/documents — List documents {#get-documents}
GET https://api.raffle.ai/v2/indexes/{index_uid}/documents
Query parameters
limit
after-uid
Response
{ "documents": [ { "uid": "document-123", "title": "Example Document", "content": "<p>Content here</p>" } ] }
/documents/{document_uid} — Upsert (create or update) {#put-document}
PUT https://api.raffle.ai/v2/indexes/{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
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 204 No Content
/documents/{document_uid} — Delete an document {#delete-document}
DELETE https://api.raffle.ai/v2/indexes/{index_uid}/documents/{document_uid}
uid
Standardized error payload:
{ "code": 401, "message": "Invalid API Key" }
Read more about Api-Index in the API Reference.
Guides