Skip to content

Quickstart: Your First API Call

Query Trove’s GraphQL API to search your knowledge base, save documents, and manage connectors.

All API requests go to a single endpoint:

POST https://api.ontrove.sh/graphql

Every request requires two headers:

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Find documents by meaning using semantic search:

Terminal window
curl -X POST https://api.ontrove.sh/graphql \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "{ search(query: \"machine learning\", limit: 5) { results { document { id title author contentType } snippet relevanceScore } totalMatches queryTimeMs } }"
}'

Response:

{
"data": {
"search": {
"results": [
{
"document": {
"id": "a1b2c3d4e5f6g7h8",
"title": "Attention Is All You Need",
"author": "Vaswani et al.",
"contentType": "text"
},
"snippet": "The dominant sequence transduction models are based on complex recurrent or convolutional neural networks...",
"relevanceScore": 0.92
}
],
"totalMatches": 23,
"queryTimeMs": 45
}
}
}

Store text, notes, or any content in your knowledge base:

Terminal window
curl -X POST https://api.ontrove.sh/graphql \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation { saveDocument(input: { text: \"Important note about project architecture...\", title: \"Architecture Notes\", tags: [\"architecture\", \"notes\"] }) { id title wordCount tags } }"
}'

Saved documents are automatically indexed for semantic search.

See all configured data sources and their sync status:

Terminal window
curl -X POST https://api.ontrove.sh/graphql \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "{ connectors { id name connectorType status documentCount lastSyncedAt } }"
}'

Every response follows the standard GraphQL format:

  • data contains your query results on success.
  • errors contains an array of error objects if something went wrong.
{
"errors": [
{
"message": "Not authenticated",
"extensions": { "code": "UNAUTHENTICATED" }
}
]
}

A response can contain both data and errors if some fields resolved successfully while others failed.