API Reference

Complete API documentation for the Sinas platform

Getting Started with the SINAS API

The SINAS API is RESTful and returns JSON responses. All API requests must be made over HTTPS and authenticated with JWT tokens or API keys.

curl https://api.sinas.io/api/v1/your-endpoint \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"

Authentication & Authorization

POST
/api/v1/auth/login

Request OTP code for passwordless login

POST
/api/v1/auth/verify-otp

Verify OTP and receive JWT token

POST
/api/v1/auth/api-keys

Create API key for programmatic access

GET
/api/v1/auth/api-keys

List all API keys

GET
/api/v1/auth/me

Get current user information

AI Chat & Assistants

POST
/api/v1/assistants

Create AI assistant with configurable provider and tools

GET
/api/v1/assistants

List all assistants

POST
/api/v1/chats

Create new chat conversation

POST
/api/v1/chats/:chat_id/messages

Send message to chat (non-streaming)

POST
/api/v1/chats/:chat_id/messages/stream

Send message to chat (streaming with SSE)

Functions

POST
/api/v1/functions

Create Python function with JSON schema validation

GET
/api/v1/functions

List all functions with filtering

GET
/api/v1/functions/:id/versions

View function version history

GET
/api/v1/executions

List function executions

GET
/api/v1/executions/:id/steps

View execution tree with nested calls

Webhooks

POST
/api/v1/webhooks

Create webhook endpoint

GET
/api/v1/webhooks

List all webhooks

POST
/webhooks/:path

Invoke webhook (triggers function execution)

Schedules

POST
/api/v1/schedules

Create cron-based scheduled job

GET
/api/v1/schedules

List all scheduled jobs

PATCH
/api/v1/schedules/:id

Update schedule configuration

Ontology System

POST
/api/v1/ontology/datasources

Connect external database (PostgreSQL, Snowflake, BigQuery)

POST
/api/v1/ontology/concepts

Create concept (entity type)

POST
/api/v1/ontology/queries

Create query with external or synced mode

POST
/api/v1/ontology/endpoints

Create custom query endpoint

POST
/api/v1/ontology/execute/:route

Execute query endpoint with filters

POST
/api/v1/ontology/data/:namespace/:concept

Create record in self-managed concept

Documents

POST
/api/v1/documents/folders

Create document folder

POST
/api/v1/documents

Create document with content

GET
/api/v1/documents

List documents with tag filtering

POST
/api/v1/documents/:id/generate-description

Generate AI description for document

Tagging System

POST
/api/v1/tags/definitions

Create tag definition with value type

POST
/api/v1/tags/:resource/:id/tags

Apply tag to resource

POST
/api/v1/tags/tagger-rules

Create AI-powered auto-tagging rule

POST
/api/v1/tags/:resource/:id/run-tagger

Run tagger on specific resource

POST
/api/v1/tags/tagger-rules/:id/run-bulk

Bulk tag all documents in folder

Email Management

POST
/api/v1/email-templates

Create Jinja2 email template

POST
/api/v1/email-inboxes

Create email inbox with webhook

POST
/api/v1/emails/send

Send email with template or direct content

GET
/api/v1/emails

List emails with filtering

Context Store

POST
/api/v1/contexts

Create context entry for AI injection

GET
/api/v1/contexts

List contexts by namespace

PUT
/api/v1/contexts/:id

Update context value or relevance score

Users & Groups

GET
/api/v1/users

List all users (admin only)

POST
/api/v1/groups

Create group

POST
/api/v1/groups/:id/members

Add member to group

POST
/api/v1/groups/:id/permissions

Set group permission

Request Logs

GET
/api/v1/request-logs

Query request logs from ClickHouse

Official SDKs

JavaScript / TypeScript

npm install @sinas/client

Python

pip install sinas-client

Go

go get github.com/sinas/sinas-go

Rust

cargo add sinas

Ready to Start Building?

Explore the full documentation and get your API keys