Docs

HTTP API: vectors and embeddings

Vector columns and indexes in your tables, similarity and hybrid search, automatic embeddings, and vector collections with their records.

Updated Nov 25, 2026

Embeddings and similarity search over HTTP: knowledge bases (RAG), pgvector in your own tables, automatic embeddings, the project's embedding model, and simpler vector collections. Guides: Knowledge bases (RAG), Vector search and embeddings.

Base URLhttps://<project-ref>.sovarias.in — your project URL from Connect.
KeysSend the project's key as apikey. Calls made for a signed-in user also send Authorization: Bearer <access token>.
ErrorsA status code and {"detail": …} — a sentence, or {code, message} for errors your code may branch on (HTTP API).

#Knowledge bases (RAG)

GET/api/v1/data/rel/vector/knowledge

The project's knowledge bases with their size, embedding progress and estimated embedding cost.

For the project team and server keys.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/knowledge

Returns

knowledge_basesarray<object>
Name, table, access, user_uploads, chunk size, documents, chunks, tokens, chunks still embedding (pending) and embedding_cost_usd.
modelobject
The project's embedding model and who pays (managed or own_key).
limitinteger
Knowledge bases allowed per project (ai.knowledge_bases).

Responses

  • 200Success.
  • 403An app user or the anon key.
  • 401No valid session or key.
curl -s "$URL/api/v1/data/rel/vector/knowledge" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "knowledge_bases": [
    {
      "name": "support_docs",
      "table": "kb_support_docs",
      "description": "Help center",
      "access": "app_users",
      "user_uploads": false,
      "chunk_tokens": 450,
      "overlap_tokens": 60,
      "created_by": "7c1e…",
      "created_at": "2026-10-20T09:12:00+00:00",
      "documents": 12,
      "chunks": 214,
      "tokens": 96120,
      "pending": 0,
      "embedding_cost_usd": 0.0019224
    }
  ],
  "model": {
    "model": "openai/text-embedding-3-small@512",
    "dim": 512,
    "semantic": true,
    "billing": "own_key",
    "usd_per_million_tokens": 0.02
  },
  "limit": 5
}

POST/api/v1/data/rel/vector/knowledge

Create a knowledge base: a chunks table kb_<name> with row policies and automatic embeddings.

access=team: only the team and server keys search it. access=app_users: signed-in app users read the team's documents and their own; with user_uploads they may add private documents. Recorded as a migration.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/knowledge

Body

namestringrequired
2–41 lowercase letters, digits or _.
2–41 characters
descriptionstringoptional
Shown in the console.
0–500 characters
accessstringoptionaldefault team
team or app_users.
One of team, app_users
user_uploadsbooleanoptionaldefault false
App users may add their own documents (with app_users).
chunk_tokensintegeroptionaldefault 450
Section size in tokens (100–1300, default 450).
100.0–1300.0
overlap_tokensintegeroptionaldefault 60
Overlap between long sections (default 60).
0.0–400.0

Responses

  • 201Created.
  • 400Invalid name.
  • 403Not allowed to change the schema, an app user, or PLAN_LIMIT_REACHED.
  • 409The name is taken, or pgvector isn't available.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/knowledge" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name": "support_docs", "access": "app_users", "description": "Help center"}'
Response
{
  "status": "ok",
  "name": "support_docs",
  "table": "kb_support_docs",
  "access": "app_users",
  "user_uploads": false,
  "model": "openai/text-embedding-3-small@512",
  "dimensions": 512,
  "migration_version": "20261020091200",
  "reversible": true
}

PATCH/api/v1/data/rel/vector/knowledge/{name}

Change who can read it, whether app users may add documents, or its description.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/knowledge/{name}

Path parameters

namestringrequired

Body

descriptionstring | nulloptional
New description.
0–500 characters
accessstring | nulloptional
team or app_users.
One of team, app_users
user_uploadsboolean | nulloptional
App users may add their own documents.

Responses

  • 200Success.
  • 404No such knowledge base.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X PATCH "$URL/api/v1/data/rel/vector/knowledge/welcome" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"access": "app_users", "user_uploads": true}'
Response
{
  "status": "ok",
  "name": "support_docs",
  "access": "app_users",
  "user_uploads": true,
  "description": "Help center",
  "migration_version": "20261020091500",
  "reversible": true
}

DELETE/api/v1/data/rel/vector/knowledge/{name}

Delete a knowledge base and every document in it.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/knowledge/{name}

Path parameters

namestringrequired

Responses

  • 200Success.
  • 404No such knowledge base.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/data/rel/vector/knowledge/welcome" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "ok",
  "name": "support_docs",
  "deleted": true,
  "migration_version": "20261020092000",
  "reversible": false
}

GET/api/v1/data/rel/vector/knowledge/{name}/documents

Documents the caller may read, newest first.

Row policies apply: app users see the team's documents and their own.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/rest/rel/vector/knowledge/{name}/documents

Path parameters

namestringrequired

Query parameters

limitintegeroptionaldefault 50
How many to return.
1–200
offsetintegeroptionaldefault 0
How many to skip.
0–…

Returns

documents[].statusstring
ready, or embedding while sections wait for their vectors.
documents[].privateboolean
Added by an app user (visible to them and the team only).

Responses

  • 200Success.
  • 404No such knowledge base.
  • 401No valid session or key.
curl -s "$URL/api/v1/data/rel/vector/knowledge/welcome/documents" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "name": "support_docs",
  "limit": 50,
  "offset": 0,
  "documents": [
    {
      "document_id": "refunds",
      "title": "Refund policy",
      "kind": "markdown",
      "source_uri": null,
      "chunks": 4,
      "tokens": 1630,
      "pending": 0,
      "private": false,
      "status": "ready",
      "created_at": "2026-10-20T09:13:00+00:00",
      "updated_at": "2026-10-20T09:13:00+00:00",
      "metadata": {
        "area": "billing"
      }
    }
  ]
}

POST/api/v1/data/rel/vector/knowledge/{name}/documents

Add or replace a document from text, a file or a web page.

Exactly one of text, content_base64 (+ filename) or url. Files: PDF (with a text layer), DOCX, HTML, Markdown, TXT, CSV, JSON, up to 7 MB. Sections are embedded in the background; re-adding the same document_id keeps unchanged sections' vectors. The team's documents are shared; an app user's are private to them (needs user_uploads).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/rest/rel/vector/knowledge/{name}/documents

Path parameters

namestringrequired

Body

document_idstring | nulloptional
Your id; re-using it replaces that document.
1–200 characters
titlestring | nulloptional
Defaults to the file name or page title.
0–300 characters
textstring | nulloptional
The document's text.
1–2,000,000 characters
formatstring | nulloptional
text, markdown or html (for text).
One of text, markdown, html
content_base64string | nulloptional
A file, base64-encoded.
0–10,485,760 characters
filenamestring | nulloptional
The file's name (its extension picks the format).
0–300 characters
content_typestring | nulloptional
The file's MIME type.
0–200 characters
urlstring | nulloptional
A public web page.
0–2,000 characters
metadataobjectoptional
Tags to filter searches by (4 KB at most).
refresh_hoursinteger | nulloptional
URL documents: fetch the page again every N hours (team only)
1.0–720.0

Returns

new_tokensinteger
Tokens in new or changed sections — the ones embedded (and paid for).
estimated_cost_usdnumber
Embedding cost from list prices; null when the model's price is unknown.
pendinginteger
Sections still waiting for their vector (searchable by keyword meanwhile).

Responses

  • 201Created.
  • 400No text found, an unsupported or unreadable file, more than 7 MB, or a private web address.
  • 401Signed out (app users must be signed in).
  • 403App users can't add documents here.
  • 409The document_id belongs to someone else.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/knowledge/welcome/documents" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"document_id": "refunds", "title": "Refund policy", "text": "# Refunds\nWithin 30 days of purchase.\n\n## Gift cards\nNever refunded.", "format": "markdown", "metadata": {"area": "billing"}}'
Response
{
  "name": "support_docs",
  "document_id": "refunds",
  "title": "Refund policy",
  "kind": "markdown",
  "source_uri": null,
  "tokens": 18,
  "chunks": 2,
  "new_chunks": 2,
  "reused_chunks": 0,
  "removed_chunks": 0,
  "new_tokens": 18,
  "embedded_now": 2,
  "pending": 0,
  "model": "openai/text-embedding-3-small@512",
  "billing": "own_key",
  "estimated_cost_usd": 3.6e-07,
  "private": false
}

DELETE/api/v1/data/rel/vector/knowledge/{name}/documents/{document_id}

Remove a document (its owner, or the team).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/rest/rel/vector/knowledge/{name}/documents/{document_id}

Path parameters

namestringrequired
document_idstringrequired

Responses

  • 200Success.
  • 404Not found, or not yours.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/data/rel/vector/knowledge/welcome/documents/<document_id>" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "name": "support_docs",
  "document_id": "refunds",
  "deleted_chunks": 2
}

POST/api/v1/data/rel/vector/knowledge/{name}/search

Passages that answer a question, best first, with numbered citations.

Only passages the caller may read. hybrid combines meaning and exact words.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/rest/rel/vector/knowledge/{name}/search

Path parameters

namestringrequired

Body

querystringrequired
The question.
1–2,000 characters
kintegeroptionaldefault 5
How many passages (1–20, default 5).
1.0–20.0
modestringoptionaldefault hybrid
hybrid (default), vector or keyword.
One of vector, keyword, hybrid
metadata_filterobject | nulloptional
Sections whose metadata contains these keys and values.
document_idsarray<string> | nulloptional
Limit to one document.
1–50 items
max_distancenumber | nulloptional
Drop passages farther than this (0–2).
0.0–2.0
rerankbooleanoptionaldefault false
Reorder passages with the managed reranker (ai.rerank_month)

Returns

results[].citationinteger
The number of the document in citations (cite as [1]).
citationsarray<object>
One entry per document used, with the sections.

Responses

  • 200Success.
  • 404No such knowledge base.
  • 503The embedding model is unavailable (keyword mode still works).
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/knowledge/welcome/search" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"query": "Can I return a gift card?", "k": 3}'
Response
{
  "name": "support_docs",
  "query": "Can I return a gift card?",
  "mode": "hybrid",
  "model": "openai/text-embedding-3-small@512",
  "results": [
    {
      "document_id": "refunds",
      "title": "Refund policy",
      "heading": "Refunds › Gift cards",
      "content": "## Gift cards\nNever refunded.",
      "source_kind": "markdown",
      "source_uri": null,
      "chunk_index": 1,
      "metadata": {
        "area": "billing"
      },
      "distance": 0.21,
      "score": 0.0328,
      "citation": 1
    }
  ],
  "citations": [
    {
      "n": 1,
      "document_id": "refunds",
      "title": "Refund policy",
      "source_uri": null,
      "sections": [
        "Refunds › Gift cards"
      ]
    }
  ]
}

#Embedding model and usage

GET/api/v1/embeddings/settings

The model this project embeds with, who pays for it, and Sovaria's managed alternative.

Never returns the key, only has_key.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Returns

billingstring
managed (Sovaria's model, counted against ai.embeddings_month) or own_key (your provider bills you).
semanticboolean
false for the built-in word-matching model.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/embeddings/settings" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "billing": "own_key",
  "provider": "openai",
  "model": "openai/text-embedding-3-small@512",
  "model_name": "text-embedding-3-small",
  "dimensions": 512,
  "semantic": true,
  "usd_per_million_tokens": 0.02,
  "managed": {
    "model": "gemini/gemini-embedding-001@768",
    "semantic": true,
    "dimensions": 768,
    "usd_per_million_tokens": 0.15
  },
  "providers": [
    "openai",
    "gemini",
    "openai_compatible"
  ],
  "base_url": null,
  "has_key": true,
  "updated_by": "7c1e…",
  "updated_at": "2026-10-20T09:00:00+00:00"
}

PUT/api/v1/embeddings/settings

Use your own provider key for embeddings.

Owners and admins. The key is tested with one tiny embedding, encrypted and never returned. Custom base URLs must be public https hosts. Changing the model means stored vectors no longer match: rebuild automatic embeddings and re-add documents.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Body

providerstringrequired
openai, gemini or openai_compatible.
One of openai, gemini, openai_compatible
modelstringrequired
The provider's model name.
1–100 characters
dimensionsinteger | nulloptional
Vector size (64–4096); empty for the model's default.
64.0–4096.0
base_urlstring | nulloptional
For openai_compatible: e.g. https://api.voyageai.com/v1.
0–300 characters
api_keystring | nulloptional
Leave out to keep the stored key (same provider).
8–400 characters

Responses

  • 200Success.
  • 400The provider rejected the key, the model or size is wrong, or the base URL isn't public https.
  • 403Not an owner or admin.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X PUT "$URL/api/v1/embeddings/settings" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"provider": "openai", "model": "text-embedding-3-small", "dimensions": 512, "api_key": "sk-…"}'
Response
{
  "billing": "own_key",
  "provider": "openai",
  "model": "openai/text-embedding-3-small@512",
  "model_name": "text-embedding-3-small",
  "dimensions": 512,
  "semantic": true,
  "usd_per_million_tokens": 0.02,
  "managed": {
    "model": "gemini/gemini-embedding-001@768",
    "semantic": true,
    "dimensions": 768,
    "usd_per_million_tokens": 0.15
  },
  "providers": [
    "openai",
    "gemini",
    "openai_compatible"
  ],
  "base_url": null,
  "has_key": true,
  "updated_by": "7c1e…",
  "updated_at": "2026-10-20T09:00:00+00:00"
}

DELETE/api/v1/embeddings/settings

Go back to Sovaria's managed embedding model (the stored key is deleted).

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Responses

  • 200Success.
  • 403Not an owner or admin.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/embeddings/settings" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "removed": true,
  "billing": "managed",
  "provider": "gemini",
  "model": "gemini/gemini-embedding-001@768",
  "model_name": "gemini-embedding-001",
  "dimensions": 768,
  "semantic": true,
  "usd_per_million_tokens": 0.15,
  "managed": {
    "model": "gemini/gemini-embedding-001@768",
    "semantic": true,
    "dimensions": 768,
    "usd_per_million_tokens": 0.15
  },
  "providers": [
    "openai",
    "gemini",
    "openai_compatible"
  ],
  "base_url": null,
  "has_key": true,
  "updated_by": "7c1e…",
  "updated_at": "2026-10-20T09:00:00+00:00"
}

GET/api/v1/embeddings/usage

Texts embedded, tokens and estimated cost per month, model and who paid.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Query parameters

monthsintegeroptionaldefault 3
1–12

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/embeddings/usage" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "usage": [
    {
      "month": "2026-10-01",
      "model": "openai/text-embedding-3-small@512",
      "billing": "own_key",
      "texts": 1840,
      "tokens": 412300,
      "cost_usd": 0.008246
    }
  ]
}

#Vectors in your tables (pgvector)

GET/api/v1/data/rel/vector/status

Whether pgvector is installed and which vector columns exist.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/status

Returns

availableboolean
The extension can be installed.
enabledboolean
It is installed.
versionstring
pgvector version.
columnsarray<object>
Vector columns: table, column, dimensions.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/data/rel/vector/status" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "available": true,
  "enabled": true,
  "version": "0.8.0",
  "columns": [
    {
      "table": "documents",
      "column": "embedding",
      "dimensions": 1536
    }
  ]
}

POST/api/v1/data/rel/vector/enable

Install (or check) the pgvector extension.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/enable

Body

enabledbooleanoptionaldefault true
true to install.

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/enable" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"enabled": true}'
Response
{
  "available": true,
  "enabled": true,
  "version": "0.8.0",
  "columns": [
    {
      "table": "documents",
      "column": "embedding",
      "dimensions": 1536
    }
  ]
}

POST/api/v1/data/rel/vector/tables

Create a table for embeddings: id, content, metadata and a vector column.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/tables

Body

table_namestringrequired
The new table.
1–63 characters
dimensionsintegerrequired
Vector size of your embedding model (e.g. 1536).
1.0–16000.0
owner_rowsbooleanoptionaldefault false
Add owner_id and row-level security so each user only sees their own rows.

Responses

  • 200Success.
  • 400Bad name or dimensions, or the table exists.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/tables" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"table_name": "documents", "dimensions": 1536, "owner_rows": true}'
Response
{
  "status": "ok",
  "table": "documents",
  "dimensions": 1536,
  "owner_rows": true
}

POST/api/v1/data/rel/vector/columns

Add a vector column to an existing table.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/columns

Body

table_namestringrequired
The table.
1–63 characters
column_namestringoptionaldefault embedding
The new column (default embedding).
1–63 characters
dimensionsintegerrequired
Vector size (1–16,000; HNSW indexes work up to 2,000).
1.0–16000.0

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/columns" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"table_name": "products", "column_name": "embedding", "dimensions": 768}'
Response
{
  "status": "ok",
  "table": "products",
  "column": "embedding",
  "dimensions": 768
}

POST/api/v1/data/rel/vector/indexes

Create an HNSW index on a vector column for fast similarity search.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/indexes

Body

table_namestringrequired
The table.
1–63 characters
column_namestringoptionaldefault embedding
The vector column.
1–63 characters
metricstringoptionaldefault cosine
cosine, l2 or inner_product — use the one you search with.
One of cosine, l2, inner_product
methodstringoptionaldefault hnsw
One of hnsw, ivfflat
minteger | nulloptional
2.0–100.0
ef_constructioninteger | nulloptional
4.0–1000.0
listsinteger | nulloptional
1.0–32768.0
concurrentlybooleanoptionaldefault true

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/indexes" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"table_name": "documents", "metric": "cosine"}'
Response
{
  "status": "ok",
  "index": "documents_embedding_cosine_idx",
  "method": "hnsw",
  "metric": "cosine"
}

POST/api/v1/data/rel/vector/rows

Insert rows with their vectors (up to 500 per request).

Vectors are bound as parameters. A vector of the wrong size fails with an error naming the expected size.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/rows

Body

table_namestringrequired
The table.
1–63 characters
column_namestringoptionaldefault embedding
The vector column.
1–63 characters
rowsarray<object>required
1–500 objects: column values, with the vector under column_name.
1–500 items
embedbooleanoptionaldefault false
Embed rows without a vector now (tables with automatic embeddings, small batches: ai.sync_embed_max_rows)

Responses

  • 200Success.
  • 400Wrong vector size, or a column that doesn't exist.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/rows" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"table_name": "documents", "rows": [{"content": "How to reset your password", "metadata": {"lang": "en"}, "embedding": [0.012, -0.044, "…"]}]}'
Response
{
  "status": "ok",
  "inserted": 1
}

POST/api/v1/data/rel/vector/search

Find the rows closest to a vector — or to text, with keyword and hybrid ranking.

Runs as the caller, so row-level security applies, and still returns k results: the index keeps scanning past rows the caller can't see. Send vector for similarity search, text for keyword (full-text) search, or both (hybrid, the default when text is given): results are fused by rank.

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.
Also at
/rest/rel/vector/search

Body

table_namestringrequired
The table.
1–63 characters
column_namestringoptionaldefault embedding
The vector column.
1–63 characters
vectorarray<number> | nulloptional
The query vector (same size as the column).
textstring | nulloptional
Query text for keyword / hybrid search; with auto-embeddings on, it's embedded for you.
1–2,000 characters
modestring | nulloptional
vector, keyword or hybrid.
One of vector, keyword, hybrid
text_columnsarray<string> | nulloptional
Columns for keyword search (default: the auto-embedding sources, else content).
1–10 items
languagestring | nulloptional
Postgres text-search configuration (simple, english…).
pattern `^[a-z_]{1,32}$`
kintegeroptionaldefault 5
How many results (1–100).
1.0–100.0
metricstringoptionaldefault cosine
cosine, l2 or inner_product.
One of cosine, l2, inner_product
selectarray<string> | nulloptional
Columns to return (default: all but the vector).
0–50 items
filterobject<string, string | integer | number | boolean | null>optional
Exact-match filters on columns, e.g. {"lang": "en"}.
filter_inobject<string, array<string | integer | number>>optional
metadata_filterobject | nulloptional
Rows whose jsonb metadata contains these keys and values, e.g. {"area": "billing"}.
metadata_columnstringoptionaldefault metadata
The jsonb column metadata_filter applies to (default metadata).
1–63 characters
max_distancenumber | nulloptional
Drop results farther than this.
ef_searchinteger | nulloptional
1.0–1000.0
probesinteger | nulloptional
1.0–1000.0
rerankbooleanoptionaldefault false
rerank_candidatesintegeroptionaldefault 0
Candidates fetched for the reranker (default 4 x k)
0.0–100.0

Returns

resultsarray<object>
The selected columns plus distance (smaller is closer; inner product is reported positive). Hybrid adds score (fused), vector_rank and keyword_rank; keyword mode adds keyword_score.
mode, metric, kstring, string, integer
What ran.

Responses

  • 200Success.
  • 400Neither vector nor text, a size mismatch, or an unknown column.
  • 403Refused by your access policies.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/search" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"table_name": "documents", "text": "I forgot my login", "k": 3, "select": ["id", "content"], "filter": {"lang": "en"}}'
Response
{
  "table": "documents",
  "metric": "cosine",
  "k": 3,
  "mode": "hybrid",
  "results": [
    {
      "id": 12,
      "content": "How to reset your password",
      "distance": 0.182,
      "score": 0.0325,
      "vector_rank": 1,
      "keyword_rank": 1
    },
    {
      "id": 7,
      "content": "Signing in with a magic link",
      "distance": 0.247,
      "score": 0.0317,
      "vector_rank": 2,
      "keyword_rank": 3
    }
  ]
}

#Automatic embeddings

GET/api/v1/data/rel/vector/auto

Tables that embed their rows automatically, and the embedding model.

The model is openai/<model>@<dims> or gemini/<model>@<dims> when an embedding provider is configured, otherwise local-hash-<dims> (hash-based: matches words, not meaning).

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/auto

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/data/rel/vector/auto" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "model": {
    "model": "openai/text-embedding-3-small@1536",
    "dim": 1536,
    "semantic": true
  },
  "tables": [
    {
      "table": "documents",
      "column": "embedding",
      "source_columns": [
        "title",
        "content"
      ],
      "model": "openai/text-embedding-3-small@1536",
      "embedded": 3120,
      "pending": 0,
      "synced_at": "2026-10-17T13:10:00Z",
      "last_error": null
    }
  ]
}

POST/api/v1/data/rel/vector/auto

Embed a table's rows automatically from text columns (and keep them up to date).

Adds the vector column if needed and embeds existing rows in the background; new and changed rows are embedded as they are written. Recorded as a migration you can roll back.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/auto

Body

table_namestringrequired
The table.
1–63 characters
column_namestringoptionaldefault embedding
Vector column (created if missing).
1–63 characters
source_columnsarray<string>required
1–10 text columns to embed (joined).
1–10 items
rebuildbooleanoptionaldefault false
Clear every vector and embed the table again.
languagestringoptionaldefault simple
Text search configuration of the keyword (GIN) index, e.g. english
pattern `^[a-z_]{1,32}$`

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/auto" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"table_name": "documents", "source_columns": ["title", "content"]}'
Response
{
  "status": "ok",
  "table": "documents",
  "column": "embedding",
  "source_columns": [
    "title",
    "content"
  ],
  "model": "openai/text-embedding-3-small@1536",
  "dimensions": 1536,
  "created_column": true,
  "background": true,
  "embedded": 128,
  "migration_version": "20261017131500",
  "reversible": true
}

POST/api/v1/data/rel/vector/auto/sync

Embed rows that are still waiting (up to 256 per call).

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/auto/sync

Body

table_namestring | nulloptional
One table (default: all).
1–63 characters
limitintegeroptionaldefault 128
Rows per call (1–256).
1.0–256.0

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/data/rel/vector/auto/sync" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"table_name": "documents", "limit": 128}'
Response
{
  "tables": [
    {
      "table": "documents",
      "embedded": 64
    }
  ],
  "embedded": 64
}

DELETE/api/v1/data/rel/vector/auto/{table_name}

Stop embedding a table automatically (the vectors stay).

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/auto/{table_name}

Path parameters

table_namestringrequired
The table.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/data/rel/vector/auto/documents" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "status": "ok",
  "table": "documents",
  "enabled": false,
  "migration_version": "20261017132000",
  "reversible": true
}

#Vector collections

POST/api/v1/vectors/upsert

Add or update texts in a vector collection; Sovaria embeds them.

The collections API embeds for you with the project's embedding model (see semantic in the list response: without a configured provider the built-in embeddings are hash-based, fine for exact-ish matching, not for meaning — Vector search and embeddings).

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Body

collectionstringrequired
The collection (created on first use).
1–64 characters
docsarray<object>required
1–256 documents.
1–256 items
3 fields
idstring | nulloptional
Your id; a new one is generated when left out.
textstringrequired
The text to embed.
metadataobjectoptional
Any JSON, for filtering.

Returns

inserted, updatedinteger
diminteger
Vector size.
sizeinteger
Records in the collection now.

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/vectors/upsert" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"collection": "help-articles", "docs": [{"id": "a1", "text": "How to reset your password", "metadata": {"lang": "en"}}, {"id": "a2", "text": "Exporting invoices as PDF", "metadata": {"lang": "en"}}]}'
Response
{
  "inserted": 2,
  "updated": 0,
  "dim": 1536,
  "size": 2
}

POST/api/v1/vectors/search

Search a vector collection by text.

App users can search a collection when it has app_search on (PATCH /api/v1/collections/{collection}).

Who
Your app: the project's anon key (apikey: <anon key>), with the user's access token once they are signed in.

Body

collectionstringrequired
The collection.
1–64 characters
querystringrequired
The search text.
1–2,000 characters
top_kintegeroptionaldefault 5
How many results (1–100).
1.0–100.0
metadata_filterobjectoptional
Only records whose metadata has these values.
modestring | nulloptional
vector, keyword or hybrid.
One of vector, keyword, hybrid

Returns

resultsarray<object>
{id, text, metadata, score}, best first.
semanticboolean
Whether the model captures meaning (a real embedding model) or is hash-based.

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/vectors/search" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"collection": "help-articles", "query": "I forgot my login", "top_k": 2, "metadata_filter": {"lang": "en"}}'
Response
{
  "results": [
    {
      "id": "a1",
      "text": "How to reset your password",
      "metadata": {
        "lang": "en"
      },
      "score": 0.83
    }
  ],
  "count": 1,
  "mode": "vector",
  "model": "openai/text-embedding-3-small@1536",
  "semantic": true
}

POST/api/v1/embed

Get embedding vectors for texts (up to 512).

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Body

textsarray<string>required
1–512 texts.
1–512 items

Returns

vectorsarray<array<number>>required
dimintegerrequired
countintegerrequired
modelstringoptional

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X POST "$URL/api/v1/embed" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"texts": ["red running shoes", "blue sandals"]}'
Response
{
  "vectors": [
    [
      0.012,
      -0.044,
      "…"
    ],
    [
      0.031,
      0.007,
      "…"
    ]
  ],
  "dim": 1536,
  "count": 2,
  "model": "openai/text-embedding-3-small@1536"
}

GET/api/v1/collections

The project's vector collections and the embedding model.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/collections" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "collections": [
    {
      "name": "help-articles",
      "dim": 1536,
      "size": 2,
      "model": "openai/text-embedding-3-small@1536",
      "app_search": false
    }
  ],
  "model": "openai/text-embedding-3-small@1536",
  "semantic": true
}

PATCH/api/v1/collections/{collection}

Change a collection's settings.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Path parameters

collectionstringrequired
The collection.

Body

app_searchboolean | nulloptional
Let signed-in app users search it.

Responses

  • 200Success.
  • 401No valid session or key.
  • 422The body is missing a required field or has a field of the wrong type.
curl -s -X PATCH "$URL/api/v1/collections/help-articles" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"app_search": true}'
Response
{
  "collection": "help-articles",
  "settings": {
    "app_search": true
  }
}

GET/api/v1/collections/{collection}/records

A collection's records.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Path parameters

collectionstringrequired
The collection.

Query parameters

limitintegeroptionaldefault 100
How many.
1–500
offsetintegeroptionaldefault 0
How many to skip.
0–…

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/collections/help-articles/records" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "collection": "help-articles",
  "dim": 1536,
  "total": 2,
  "records": [
    {
      "id": "a1",
      "text": "How to reset your password",
      "metadata": {
        "lang": "en"
      }
    }
  ]
}

DELETE/api/v1/collections/{collection}/records/{record_id}

Delete one record.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Path parameters

collectionstringrequired
The collection.
record_idstringrequired
The record's id.

Responses

  • 204Success, with no body.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/collections/help-articles/records/a2" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

DELETE/api/v1/collections/{collection}

Delete a collection and its records.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Path parameters

collectionstringrequired
The collection.

Responses

  • 204Success, with no body.
  • 401No valid session or key.
curl -s -X DELETE "$URL/api/v1/collections/help-articles" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

POST/api/v1/collections/{collection}/reembed

Embed every record again with the current model (after changing models).

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.

Path parameters

collectionstringrequired
The collection.

Responses

  • 200Success.
  • 401No valid session or key.
curl -s -X POST "$URL/api/v1/collections/help-articles/reembed" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
  "collection": "help-articles",
  "records": 2,
  "model": "openai/text-embedding-3-small@1536"
}

#More endpoints

GET/api/v1/data/rel/vector/knowledge/{name}/sources

URL documents fetched again on a schedule (refresh_hours): next fetch, last error.

Who
Your team or your backend: a member's session, or a server key (apikey: <service role or custom key>). Never from a browser or app.
Also at
/rest/rel/vector/knowledge/{name}/sources

Path parameters

namestringrequired

Responses

  • 200Success.
  • 401No valid session or key.
curl -s "$URL/api/v1/data/rel/vector/knowledge/welcome/sources" \
  -H "apikey: $ANON_KEY" \
  -H "Authorization: Bearer $ACCESS_TOKEN"