Quickstart: Your First API Call
Query Trove’s GraphQL API to search your knowledge base, save documents, and manage connectors.
Prerequisites
Section titled “Prerequisites”- A Trove account (Trove is currently in private beta. Contact the team for an invitation.)
- A Bearer token (see Authentication)
The GraphQL Endpoint
Section titled “The GraphQL Endpoint”All API requests go to a single endpoint:
POST https://api.ontrove.sh/graphqlEvery request requires two headers:
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Search Your Knowledge Base
Section titled “Search Your Knowledge Base”Find documents by meaning using semantic search:
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 } }}Save a Document
Section titled “Save a Document”Store text, notes, or any content in your knowledge base:
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.
List Your Connectors
Section titled “List Your Connectors”See all configured data sources and their sync status:
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 } }" }'Response Structure
Section titled “Response Structure”Every response follows the standard GraphQL format:
datacontains your query results on success.errorscontains 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.
Next Steps
Section titled “Next Steps”- Authentication: How to obtain and manage tokens
- API Reference: Full GraphQL schema documentation
- Queries: All available GraphQL queries
- Mutations: All available GraphQL mutations