API Reference

Complete REST API for Webenta Index. All endpoints require HTTPS.

https://index.webenta.sk/api/v1
Download OpenAPI JSON
Health
GET /api/v1/health

Health check

Returns a simple ok response. Use this to verify the API is reachable before making authenticated calls.

No auth required
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/health
Response
{ "ok": true }
Authentication
POST /api/v1/auth/otp/request

Request OTP

Sends a one-time password to the given email. Rate-limited to 10 requests per hour per IP and 3 per 15 minutes per email.

No auth required

Body parameters application/json

email string required

Email address to send the OTP to.

Request
curl https://index.webenta.sk/api/v1/auth/otp/request \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'
Response
{ "ok": true }
Authentication
POST /api/v1/auth/otp/verify

Verify OTP

Verifies an OTP code. On success, sets a session cookie and returns ok.

No auth required

Body parameters application/json

email string required

Email the OTP was sent to.

code string required

The 6-digit OTP code.

Request
curl https://index.webenta.sk/api/v1/auth/otp/verify \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","code":"123456"}'
Response
{ "ok": true }
Authentication
POST /api/v1/auth/logout

Logout

Invalidates the current session and clears the session cookie.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/auth/logout \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{ "ok": true }
Authentication
GET /api/v1/auth/google/start

Start Google OAuth

Initiates Google OAuth flow. Redirects the browser to Google's authorization page. Use from a browser, not from server-side code.

No auth required
This endpoint takes no parameters.
Request
# Open in a browser:
# https://index.webenta.sk/api/v1/auth/google/start
Response
# 302 Redirect → https://accounts.google.com/o/oauth2/auth?...
Authentication
GET /api/v1/auth/google/callback

Google OAuth callback

Completes Google OAuth. Called automatically by Google after the user authorizes. On success, creates a session and redirects to /dashboard.

No auth required

Query parameters

code string required

Authorization code from Google.

state string required

CSRF state token set during the start step.

Request
# Handled automatically by the Google OAuth redirect
Response
# 302 Redirect → /dashboard
Account
GET /api/v1/me

Get current user

Returns the authenticated user's profile, active plan details, and current storage usage.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/me \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "id": "usr_01j9xyz",
  "email": "you@example.com",
  "name": "Ada Lovelace",
  "planId": "pro",
  "plan": {
    "id": "pro",
    "name": "Pro",
    "maxProjects": 10,
    "maxStorageBytes": "10737418240",
    "maxApiKeysPerProject": 20
  },
  "planExpiresAt": null,
  "usage": {
    "totalBytes": "2148731",
    "maxBytes": "10737418240"
  }
}
Account
GET /api/v1/whoami-key

Introspect API key

Returns the scope and project binding of the API key used in the request. Works only with an API key — session cookies are rejected.

API key required Pass as Authorization: Bearer YOUR_API_KEY
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/whoami-key \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "scope": "project",
  "projectId": "proj_01j9abc",
  "userId": "usr_01j9xyz"
}
Account
GET /api/v1/usage

API usage stats

Returns API call counts broken down by success/failure over a time window.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Query parameters

range string optional default: 24h

Time window.

60m24h7d30d
projectId string optional

Filter to a specific project.

Request
curl "https://index.webenta.sk/api/v1/usage?range=24h" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "buckets": [
    { "ts": "2026-06-25T00:00:00Z", "success": 142, "fail": 3 },
    { "ts": "2026-06-25T01:00:00Z", "success": 87,  "fail": 1 }
  ]
}
Account
POST /api/v1/me/redeem-code

Redeem promo code

Redeems a promotional code that upgrades the account plan. Requires a web session.

Web session required

Body parameters application/json

code string required

The promotion code to redeem.

Request
curl https://index.webenta.sk/api/v1/me/redeem-code \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"code":"PROMO-XXXX"}'
Response
{
  "ok": true,
  "planId": "pro",
  "planExpiresAt": "2026-09-25T00:00:00Z"
}
Plans
GET /api/v1/plans

List plans

Returns all available subscription plans with their resource limits.

No auth required
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/plans
Response
[
  {
    "id": "free",
    "name": "Free",
    "priceEurCents": 0,
    "maxProjects": 1,
    "maxStorageBytes": "1073741824",
    "maxApiKeysPerProject": 3
  },
  {
    "id": "pro",
    "name": "Pro",
    "priceEurCents": 900,
    "maxProjects": 10,
    "maxStorageBytes": "10737418240",
    "maxApiKeysPerProject": 20
  }
]
Projects
GET /api/v1/projects

List projects

Returns all non-archived projects owned by the authenticated user.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/projects \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
[
  {
    "id": "proj_01j9abc",
    "name": "Fitness",
    "slug": "fitness",
    "createdAt": "2026-06-01T10:00:00Z"
  }
]
Projects
POST /api/v1/projects

Create project

Creates a new project with an isolated Postgres database. Requires a web session — project-scoped API keys cannot create projects.

Web session required

Body parameters application/json

name string required

Display name for the project (1–64 characters).

Request
curl https://index.webenta.sk/api/v1/projects \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"name":"Fitness"}'
Response
{
  "id": "proj_01j9abc",
  "name": "Fitness",
  "slug": "fitness"
}
Projects
GET /api/v1/projects/{id}

Get project

Returns project metadata including the internal database name and current storage usage in bytes.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "id": "proj_01j9abc",
  "name": "Fitness",
  "slug": "fitness",
  "dbName": "idx_fitness_01j9abc",
  "createdAt": "2026-06-01T10:00:00Z",
  "bytes": "2048731"
}
Projects
DELETE /api/v1/projects/{id}

Delete project

Permanently deletes a project and its Postgres database. This action cannot be undone. Requires a web session — API keys cannot delete projects.

Web session required

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc \
  -X DELETE
Response
{ "ok": true }
Projects
GET /api/v1/projects/{id}/info

Get project info

Returns extended project info including custom instructions, plan limits, and storage usage. The MCP server calls this endpoint on connect.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/info \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "id": "proj_01j9abc",
  "name": "Fitness",
  "instructions": "Track workouts using sets, reps and weight.",
  "bytes": "2048731",
  "plan": {
    "id": "pro",
    "name": "Pro",
    "maxStorageBytes": "10737418240",
    "maxRowsPerInsert": 500
  },
  "usage": {
    "totalBytes": "2048731",
    "maxBytes": "10737418240"
  }
}
Tables
GET /api/v1/projects/{id}/tables

List tables

Returns all tables in the project with their full column schemas.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
[
  {
    "name": "workouts",
    "columns": [
      { "name": "id",        "type": "number",  "nullable": false },
      { "name": "exercise",  "type": "text",    "nullable": false },
      { "name": "sets",      "type": "number",  "nullable": true },
      { "name": "reps",      "type": "number",  "nullable": true },
      { "name": "weight_kg", "type": "number",  "nullable": true },
      { "name": "logged_at", "type": "date",    "nullable": false }
    ]
  }
]
Tables
POST /api/v1/projects/{id}/tables

Create table

Creates a new table with the given schema. An auto-increment `id` column is always added automatically — do not include it in columns.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Body parameters application/json

name string required

Table name. snake_case recommended.

columns ColumnDef[] required

Array of column definitions. Each has: `name` (string), `type` (text|number|boolean|date|enum|json), `nullable` (boolean, default true), `enumValues` (string[], for enum type only).

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "workouts",
    "columns": [
      { "name": "exercise",  "type": "text",   "nullable": false },
      { "name": "sets",      "type": "number", "nullable": true },
      { "name": "reps",      "type": "number", "nullable": true },
      { "name": "logged_at", "type": "date",   "nullable": false }
    ]
  }'
Response
{ "ok": true, "name": "workouts" }
Tables
DELETE /api/v1/projects/{id}/tables/{table}

Drop table

Permanently drops a table and all its rows. This action cannot be undone.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts \
  -X DELETE \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{ "ok": true }
Columns
POST /api/v1/projects/{id}/tables/{table}/columns

Add column

Adds a new column to an existing table. Existing rows will have NULL for the new column regardless of the nullable setting.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

Body parameters application/json

name string required

Column name.

type string required

Column type.

textnumberbooleandateenumjson
nullable boolean optional default: true

Whether the column allows NULL.

enumValues string[] optional

Allowed values — required when type is "enum".

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/columns \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"weight_kg","type":"number","nullable":true}'
Response
{ "ok": true }
Columns
PATCH /api/v1/projects/{id}/tables/{table}/columns/{col}

Rename column

Renames a column. The rename is propagated to dashboard widget configs that reference this column.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

col string required

Current column name.

Body parameters application/json

rename string required

New column name.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/columns/weight_kg \
  -X PATCH \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rename":"weight"}'
Response
{ "ok": true }
Columns
DELETE /api/v1/projects/{id}/tables/{table}/columns/{col}

Drop column

Drops a column from a table. All data in that column is permanently deleted.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

col string required

Column name to drop.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/columns/weight_kg \
  -X DELETE \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{ "ok": true }
Rows
GET /api/v1/projects/{id}/tables/{table}/rows

List rows

Returns rows from a table with optional filtering, ordering, and pagination.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

Query parameters

filter JSON optional

URL-encoded JSON filter. Supported operators per column: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `like`, `in`. Example: `{"exercise":{"eq":"squat"}}`.

orderBy JSON optional

URL-encoded JSON sort. Example: `{"logged_at":"desc"}`.

limit number optional default: 100

Max rows to return.

offset number optional default: 0

Rows to skip (for pagination).

Request
curl "https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/rows?limit=10&orderBy=%7B%22logged_at%22%3A%22desc%22%7D" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "rows": [
    {
      "id": 42,
      "exercise": "squat",
      "sets": 4,
      "reps": 8,
      "weight_kg": 100,
      "logged_at": "2026-06-25T07:30:00Z"
    }
  ],
  "total": 142
}
Rows
POST /api/v1/projects/{id}/tables/{table}/rows

Insert rows

Inserts one or more rows into a table. Pass either a `rows` array for batch insert, or a single `values` object for one row.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

Body parameters application/json

rows object[] optional

Array of row objects (batch insert). Use either `rows` or `values`, not both.

values object optional

Single row object. Use either `rows` or `values`, not both.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/rows \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rows": [
      { "exercise": "squat", "sets": 4, "reps": 8, "weight_kg": 100, "logged_at": "2026-06-25T07:30:00Z" },
      { "exercise": "bench", "sets": 3, "reps": 10, "weight_kg": 80,  "logged_at": "2026-06-25T07:45:00Z" }
    ]
  }'
Response
{
  "rows": [
    { "id": 42, "exercise": "squat", "sets": 4, "reps": 8, "weight_kg": 100, "logged_at": "2026-06-25T07:30:00Z" },
    { "id": 43, "exercise": "bench", "sets": 3, "reps": 10, "weight_kg": 80,  "logged_at": "2026-06-25T07:45:00Z" }
  ]
}
Rows
PATCH /api/v1/projects/{id}/tables/{table}/rows/{rowId}

Update row

Partially updates a row by ID. Only the fields present in `values` are changed; all other fields remain as-is.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

rowId number required

Row ID (the auto-increment `id` field).

Body parameters application/json

values object required

Key-value pairs of fields to update.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/rows/42 \
  -X PATCH \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values":{"weight_kg":105}}'
Response
{
  "id": 42,
  "exercise": "squat",
  "sets": 4,
  "reps": 8,
  "weight_kg": 105,
  "logged_at": "2026-06-25T07:30:00Z"
}
Rows
DELETE /api/v1/projects/{id}/tables/{table}/rows/{rowId}

Delete row

Permanently deletes a single row by its ID.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

rowId number required

Row ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/rows/42 \
  -X DELETE \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{ "ok": true }
Querying
POST /api/v1/projects/{id}/query/aggregate

Aggregate query

Runs a GROUP BY aggregate query — count, sum, average, min, or max — with optional grouping and filtering. This is what dashboard widgets use under the hood.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Body parameters application/json

table string required

Table to query.

metrics MetricDef[] required

Aggregate metrics. Each has `type` (count|sum|avg|min|max) and `column` (the column to aggregate).

groupBy string[] optional

Columns to group results by.

filter object optional

Filter object (same format as the row list filter query param).

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/query/aggregate \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "table": "workouts",
    "metrics": [
      { "type": "sum",   "column": "weight_kg" },
      { "type": "count", "column": "id" }
    ],
    "groupBy": ["exercise"]
  }'
Response
{
  "rows": [
    { "exercise": "squat", "sum_weight_kg": 4200, "count_id": 42 },
    { "exercise": "bench", "sum_weight_kg": 2400, "count_id": 30 }
  ]
}
Events
GET /api/v1/projects/{id}/events

Event stream (SSE)

Opens a Server-Sent Events stream that delivers real-time notifications whenever data in the project changes — rows inserted, tables created, etc. The dashboard uses this to refresh without polling.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: text/event-stream"
Response
data: {"kind":"hello","ts":1750844400000}

data: {"kind":"rows_inserted","table":"workouts","count":2}

data: {"kind":"heartbeat","ts":1750844425000}

data: {"kind":"table_created","table":"exercises"}
Dashboard
GET /api/v1/projects/{id}/dashboard

Get dashboard

Returns the saved dashboard layout and variables for a project. Auto-creates an empty dashboard if none has been saved yet.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/dashboard \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "layout": [
    {
      "id": "widget_01",
      "type": "bar",
      "title": "Sets per exercise",
      "config": { "table": "workouts", "x": "exercise", "y": "sets" },
      "x": 0, "y": 0, "w": 6, "h": 4
    }
  ],
  "variables": [],
  "updatedAt": "2026-06-25T08:00:00Z"
}
Dashboard
PUT /api/v1/projects/{id}/dashboard

Save dashboard

Saves the dashboard layout and optional variables. The entire layout is replaced on each save.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Body parameters application/json

layout Widget[] required

Array of widget definitions. Each widget has type, title, config, and grid position (x, y, w, h).

variables Variable[] optional

Dashboard-level variable definitions for filtering widgets.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/dashboard \
  -X PUT \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"layout":[...],"variables":[]}'
Response
{
  "layout": [...],
  "variables": [],
  "updatedAt": "2026-06-25T08:05:00Z"
}
Instructions
GET /api/v1/projects/{id}/instructions

Get instructions

Returns the custom agent instructions for a project. These are injected into the MCP system prompt on every connection.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/instructions \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "instructions": "Track workouts using sets, reps and weight. Always log the date."
}
Instructions
PUT /api/v1/projects/{id}/instructions

Update instructions

Replaces the custom agent instructions for a project (max 64 KB). Pass an empty string to clear. Requires a web session.

Web session required

Path parameters

id string required

Project ID.

Body parameters application/json

instructions string optional

New instructions text. Empty string clears existing instructions.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/instructions \
  -X PUT \
  -H "Content-Type: application/json" \
  -d '{"instructions":"Track workouts using sets, reps and weight."}'
Response
{
  "instructions": "Track workouts using sets, reps and weight."
}
API Keys
GET /api/v1/apikeys

List global API keys

Returns all API keys owned by the authenticated user (both global and project-scoped). Requires a web session — API keys cannot list other keys.

Web session required
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/apikeys
Response
[
  {
    "id": "key_01j9abc",
    "name": "Claude.ai",
    "projectId": null,
    "scope": "global",
    "createdAt": "2026-06-01T10:00:00Z"
  },
  {
    "id": "key_01j9def",
    "name": "Fitness agent",
    "projectId": "proj_01j9abc",
    "scope": "project",
    "createdAt": "2026-06-02T10:00:00Z"
  }
]
API Keys
POST /api/v1/apikeys

Create global API key

Creates a new global API key that works across all projects. The key value is only returned once — store it immediately.

Web session required

Body parameters application/json

name string required

Human-readable label for this key.

Request
curl https://index.webenta.sk/api/v1/apikeys \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"name":"Claude.ai"}'
Response
{
  "id": "key_01j9abc",
  "name": "Claude.ai",
  "projectId": null,
  "scope": "global",
  "key": "wi_gbl_xxxxxxxxxxxxxxxxxxxx",
  "createdAt": "2026-06-25T10:00:00Z"
}
API Keys
DELETE /api/v1/apikeys/{keyId}

Delete API key

Permanently revokes an API key. Any agent using this key will immediately lose access.

Web session required

Path parameters

keyId string required

Key ID.

Request
curl https://index.webenta.sk/api/v1/apikeys/key_01j9abc \
  -X DELETE
Response
{ "ok": true }
API Keys
GET /api/v1/projects/{id}/apikeys

List project API keys

Returns all API keys scoped to a specific project.

Web session required

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/apikeys
Response
[
  {
    "id": "key_01j9def",
    "name": "Fitness agent",
    "projectId": "proj_01j9abc",
    "scope": "project",
    "createdAt": "2026-06-02T10:00:00Z"
  }
]
API Keys
POST /api/v1/projects/{id}/apikeys

Create project API key

Creates a new API key scoped to a single project. The key value is only returned once.

Web session required

Path parameters

id string required

Project ID.

Body parameters application/json

name string required

Human-readable label for this key.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/apikeys \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"name":"Fitness agent"}'
Response
{
  "id": "key_01j9def",
  "name": "Fitness agent",
  "projectId": "proj_01j9abc",
  "scope": "project",
  "key": "wi_prj_xxxxxxxxxxxxxxxxxxxx",
  "createdAt": "2026-06-25T10:00:00Z"
}
API Keys
DELETE /api/v1/projects/{id}/apikeys/{keyId}

Delete project API key

Permanently revokes a project-scoped API key.

Web session required

Path parameters

id string required

Project ID.

keyId string required

Key ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/apikeys/key_01j9def \
  -X DELETE
Response
{ "ok": true }
Data Transfer
GET /api/v1/projects/{id}/transfer

Export project (ZIP)

Exports all tables as a ZIP archive containing one JSON file per table (up to 50 000 rows each).

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/transfer \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o project-export.zip
Response
# Binary ZIP download
# Contains: workouts.json, exercises.json, ...

# workouts.json:
[{"id":1,"exercise":"squat","sets":4,...}]
Data Transfer
POST /api/v1/projects/{id}/transfer

Import project data

Bulk-imports data into one or more tables with wipe or append mode and configurable conflict handling.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

Body parameters application/json

mode string required

Import mode: `wipe` truncates the table first; `append` keeps existing rows.

wipeappend
onConflict string required

ID conflict strategy: `replace` overwrites, `skip` ignores, `newid` assigns a new ID.

replaceskipnewid
tables TableImport[] required

Array of table import specs. Each has `name`, `rows`, `columns`, and optionally `createTable` / `createTableColumns` to create the table if it does not exist.

Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/transfer \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "append",
    "onConflict": "skip",
    "tables": [
      {
        "name": "workouts",
        "rows": [{ "exercise": "squat", "sets": 4 }],
        "columns": ["exercise", "sets"]
      }
    ]
  }'
Response
{
  "tables": [
    { "name": "workouts", "imported": 1, "created": false }
  ]
}
Data Transfer
GET /api/v1/projects/{id}/tables/{table}/transfer

Export table

Exports a single table as a JSON or CSV file (up to 50 000 rows).

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

Query parameters

format string optional default: json

Export format.

jsoncsv
Request
curl "https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/transfer?format=csv" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o workouts.csv
Response
# JSON (default):
[{"id":1,"exercise":"squat","sets":4,"reps":8}]

# CSV (format=csv):
id,exercise,sets,reps,weight_kg,logged_at
1,squat,4,8,100,2026-06-25T07:30:00Z
Data Transfer
POST /api/v1/projects/{id}/tables/{table}/transfer

Import into table

Imports rows into a specific table with wipe or append mode and conflict handling.

Session or API key Pass as Authorization: Bearer YOUR_API_KEY

Path parameters

id string required

Project ID.

table string required

Table name.

Body parameters application/json

rows object[] required

Rows to import.

columns string[] required

Column names present in each row object.

mode string required

Import mode.

wipeappend
onConflict string required

Conflict strategy.

replaceskipnewid
Request
curl https://index.webenta.sk/api/v1/projects/proj_01j9abc/tables/workouts/transfer \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rows": [{ "exercise": "squat", "sets": 4 }],
    "columns": ["exercise", "sets"],
    "mode": "append",
    "onConflict": "skip"
  }'
Response
{ "imported": 1 }
Billing
POST /api/v1/billing/checkout

Create checkout session

Creates a Stripe checkout session for a paid plan upgrade. Returns a URL to redirect the user to.

Web session required

Body parameters application/json

planSlug string required

The plan ID to subscribe to (e.g. "pro").

Request
curl https://index.webenta.sk/api/v1/billing/checkout \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"planSlug":"pro"}'
Response
{ "url": "https://checkout.stripe.com/pay/cs_..." }
Billing
POST /api/v1/billing/portal

Open billing portal

Creates a Stripe billing portal session. Returns a URL for the user to manage their subscription, invoices, and payment method.

Web session required
This endpoint takes no parameters.
Request
curl https://index.webenta.sk/api/v1/billing/portal \
  -X POST
Response
{ "url": "https://billing.stripe.com/p/..." }