API Endpoints
OpenSync exposes a REST API through Convex HTTP endpoints. All endpoints are authenticated with API keys.Base URL
For the hosted version:.convex.cloud with .convex.site:
Authentication
All endpoints (except/health) require an API key in the Authorization header:
osk_ and are tied to your user account.
Sync endpoints
These endpoints are used by sync plugins to push session and message data.POST /sync/session
Create or update a session. Uses upsert logic based onexternalId, so calling this multiple times with the same externalId is safe.
Request body:
Optional fields:
Response:
POST /sync/message
Create or update a message within a session. The session is identified bysessionExternalId and will be auto-created if it does not exist.
Request body:
Optional fields:
Part types:
POST /sync/batch
Sync multiple sessions and messages in a single request. Preferred for bulk operations to reduce write conflicts. Request body:Query endpoints
GET /api/sessions
List sessions for the authenticated user. Query parameters:
Response:
GET /api/sessions/:id
Get a single session with all its messages. Response:Search endpoints
POST /search
Search across all sessions using full-text or semantic search. Request body (full-text):sessions.searchableText, which contains the session title and all message content. Results are ranked by relevance.
Request body (semantic):
text-embedding-3-small model and performs a vector similarity search against sessionEmbeddings. Results are ranked by cosine similarity.
Response:
Export endpoints
GET /api/export
Export sessions in evaluation framework formats. Query parameters:
Response: The response is the exported file content with the appropriate Content-Type header (
application/json for DeepEval/OpenAI, text/plain for text format).
Context endpoint
GET /api/context
Retrieve relevant session context for RAG (Retrieval-Augmented Generation) pipelines. Returns the most relevant session snippets for a given query. Query parameters:
Response:
Health endpoint
GET /health
Public endpoint (no auth required). Returns the API status. Response:Error responses
All endpoints return errors in this format:Rate limits
The API enforces rate limits per API key. Current limits:
If you hit a rate limit, the response includes a
Retry-After header with the number of seconds to wait.