Documentation
Teddy publishes HTML pages (artifacts) and small APIs (functions) with an instant URL. Built for your AI agent to use, and for you too, from code.
Get started
1. Create your account with your email (magic link, no password). For scripts or clients without OAuth, also create an agent API key tdy_ under Agent keys.
2. Connect your agent. In Claude (web, desktop, mobile, Cowork or Claude Code), add a custom connector with this URL. Claude will ask you to sign in to Teddy and grant permission; no API key is needed:
http://192.168.0.10:3579/mcp3. Publish. Ask your agent ("publish this on Teddy") or do it yourself:
curl -X POST http://192.168.0.10:3579/api/artifacts \
-H "Authorization: Bearer $TEDDY_KEY" \
-H "Content-Type: text/html" \
--data-binary @pagina.htmlThe response includes url: share it. Each artifact is served in isolation (sandboxed iframe with CSP), with no access to your session.
Artifacts
An artifact is a self-contained HTML file (CSS and JS inline). It is published at /a/<id> with a minimal Teddy bar and a report button.
curl -X POST http://192.168.0.10:3579/api/artifacts -H "Authorization: Bearer $TEDDY_KEY" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hola</h1>","title":"Saludo","folder":"Demos","expires_in":"7d"}'- Update:
PUT /api/artifacts/{id}with the new HTML (same URL). - Pause / publish:
PATCHwith{"status":"paused"}or"live". A paused artifact responds "not available". - Folders:
folderby name (created if missing) orfolder_id. List withGET /api/artifacts?folder=<id>|none&status=live|paused|hidden. - Expiry:
expires_inwith unitm(minutes),h,dorw:30m,12h,7d,2w;neverremoves it. When it expires it is deleted. (Note: on consumption keys,mmeans months andyis also accepted.) - Multiple files: besides the HTML,
fileswith CSS, JS, images, fonts or other pages, linked with relative paths (<img src="img/logo.png">):{"html":"…","files":[{"path":"css/estilo.css","content":"…"},{"path":"img/logo.png","content":"<base64>","encoding":"base64"}]}. Or upload a .zip containingindex.html:curl -X POST …/api/artifacts -H "Content-Type: application/zip" --data-binary @web.zip(also from Publish in the dashboard). OnPUT,filesreplaces all files; if you send onlyhtml, the existing files are kept. They count toward the plan's maximum size, and the security filter also checks the other pages and scripts. List:GET /api/artifacts/{id}/files. - Private:
"visibility":"private"(when publishing or withPATCH): only you can see it; for everyone else the URL responds "does not exist". To share it, create secret links withPOST /api/artifacts/{id}/links({"label":"Cliente Acme","expires_in":"7d"}): one per person, with a visit counter, revocable withDELETE …/links/{linkId}. The link URL is shown only when it is created. - Password:
"password":"…"(6–200 characters;nullremoves it). Anyone who opens it is asked for it, except you. It can be combined with private. All of this is also available from the dashboard: Library → share. When switching from public to private, browsers and caches may keep showing the public version for up to 60 s; someone who already has it open through a revoked link may keep seeing it for a few minutes. - Moderation: an anti-phishing filter reviews every publish: anything obvious is rejected (422) and anything doubtful stays hidden until an admin reviews it. Three reports from distinct visitors also hide it.
Functions
A function is a JavaScript module that Teddy runs in a sandbox (V8 isolate, the same engine as Cloudflare Workers) and exposes at /f/<id>, with any method and subpath.
export default {
async fetch(request, env) {
const { importe = 0 } = await request.json().catch(() => ({}));
return Response.json({ importe, iva: +(importe * 0.21).toFixed(2) });
}
};curl -X POST http://192.168.0.10:3579/api/functions -H "Authorization: Bearer $TEDDY_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"IVA","code":"export default { async fetch(r) { return Response.json({ ok: true }) } }"}'- Test without publishing:
POST /api/runwithcodeandinput(method, path, query, headers, body). - No network by default. Declare domains with
allow_net: ["api.ejemplo.com"]; public IPs only. - Standard web APIs only:
fetch,crypto.subtle,URL,TextEncoder, streams. No npm and no disk. - Time: each invocation has a limit (10 s on Free). Exceeding it several times suspends the function until you publish a new version.
- Open CORS: an artifact can call your function. Responses are served from an isolated origin (CSP
sandbox) and cannot set cookies. - Logs:
console.logis stored with each invocation (GET /api/functions/{id}/logs).
Access to your APIs
Each function has an access mode (access):
public: anyone with the URL, with a per-IP limit.key: requires a consumption keytfk_…that you issue, for one function or for all, with optional per-minute limit, daily quota and expiry. It is revoked instantly.owner: only your agent keytdy_….user: only customers who have signed in on your page (see Login for your customers).
curl -X POST http://192.168.0.10:3579/api/functions/<id>/keys -H "Authorization: Bearer $TEDDY_KEY" \
-H "Content-Type: application/json" -d '{"name":"Cliente Acme","rate_per_min":60,"expires_in":"30d"}'
curl http://192.168.0.10:3579/f/<id> -H "Authorization: Bearer tfk_…" # o X-API-Key, o ?api_key=The function never sees the key: it receives x-teddy-key-name with the key's name (encoded with encodeURIComponent) and x-teddy-key-id; any x-teddy-* header sent by the client is discarded. Calls with a tfk_ key receive X-RateLimit-Limit and X-RateLimit-Remaining. Rejected attempts (401/403/404/429) are logged with their reason, appear in the dashboard and in /rejections, and do not consume quota or rate limit.
Scheduled functions (cron)
A function can run on its own. You define a 5-field cron expression in UTC (minute hour day-of-month month day-of-week; it supports lists, ranges, steps, names such as mon-fri and the aliases @hourly, @daily, @weekly) and Teddy calls the function with a POST to the path you choose, with the body you configure. Three headers arrive that nobody outside can forge: x-teddy-cron: 1, x-teddy-schedule-id and x-teddy-scheduled-for (the planned time).
curl -X POST http://192.168.0.10:3579/api/functions/<id>/schedules \
-H "Authorization: Bearer $TEDDY_KEY" -H "Content-Type: application/json" \
-d '{"cron":"0 9 * * mon-fri","path":"/informe","body":{"dias":7},"name":"Informe diario"}'It counts against the plan's daily invocations and respects the maximum time per invocation. Free: 2 schedules, at most once per hour; Pro: 50, every 5 minutes. If Teddy is down at the scheduled time, the run happens once when it comes back (not every missed one). Each run is kept in a 14-day log (GET /api/functions/<id>/schedules/<sid>/runs, or in the dashboard); after 10 consecutive failures the schedule disables itself and says so, and re-enabling it resets the counter. If the function is paused or the account suspended, the run is skipped and noted.
Secrets
For keys to external APIs. Never put them in the code: store them as a secret and read them with env.NAME.
curl -X PUT http://192.168.0.10:3579/api/functions/<id>/secrets/OPENAI_API_KEY -H "Authorization: Bearer $TEDDY_KEY" \
-H "Content-Type: application/json" -d '{"value":"sk-…"}'export default {
async fetch(request, env) {
const r = await fetch("https://api.openai.com/v1/models", { headers: { Authorization: "Bearer " + env.OPENAI_API_KEY } });
return new Response(r.body, r);
}
}; // con allow_net: ["api.openai.com"]Names in UPPERCASE with digits and _ (KV, FN_* and TEDDY_* are reserved); values from 4 B to 4 KB. They are stored encrypted (AES-256-GCM). The value cannot be read back and, if it appears in a log or an error, it shows as ••••.
Memory (KV)
Each published function has its own key-value store, persistent across calls:
export default {
async fetch(request, env) {
const visitas = Number(await env.KV.get("visitas") ?? 0) + 1;
await env.KV.put("visitas", String(visitas));
await env.KV.put("ultima", JSON.stringify({ t: Date.now() }), { expirationTtl: 86400 });
const { keys } = await env.KV.list({ prefix: "u:" });
return Response.json({ visitas, ultima: await env.KV.get("ultima", "json"), usuarios: keys.length });
}
};Values are text (use JSON.stringify). From the dashboard or the API you can list, read and delete keys. run_code has no KV.
Data (collections)
A collection is a list of JSON records with its own API at http://192.168.0.10:3579/d/<id>: you store orders, form responses or an app's state without setting up a database. Reading and writing each have their own access: public (anyone, with a per-IP limit), key (a tfk_… key or a management key) or owner (only you). The pages you publish can call it directly with fetch (open CORS).
# crear un registro y leerlos con filtros
curl -X POST http://192.168.0.10:3579/d/ID -H "Content-Type: application/json" -d '{"nombre":"Ana","mesas":2}'
curl "http://192.168.0.10:3579/d/ID?mesas__gte=2&_order=-mesas&_limit=20"
# cambiar un campo (null lo borra) solo si nadie lo cambió antes
curl -X PATCH http://192.168.0.10:3579/d/ID/REGISTRO -H "If-Match: 1" -d '{"mesas":3}'Filters: field=value, field__gt, __gte, __lt, __lte, __ne; ordering _order=-field; _limit (max. 100), _offset, _count=1. Each record has id, version and dates; If-Match: <version> prevents overwriting someone else's changes (409 version_conflict). An optional schema (a subset of JSON Schema) validates what is written.
From a function: env.DB.collection("pedidos") with find, get, insert, put, patch and delete; it only sees its owner's collections. run_code has no DB. From the dashboard (Data) you can view records, change access and export to CSV or JSON; the management API (/api/collections) also imports up to 1,000 records per call.
Real time
A channel (http://192.168.0.10:3579/c/<id>) delivers JSON messages instantly to everyone listening: chat, scoreboards, notifications, dashboards that update themselves. Publishing and listening each have their own access (public, key or owner), as with collections. Create them in the dashboard (Channels), with the API or with your agent.
// en una página publicada: escuchar (SSE; se reconecta solo y no pierde mensajes)
const es = new EventSource("http://192.168.0.10:3579/c/ID");
es.onmessage = (e) => console.log(JSON.parse(e.data));
es.addEventListener("marcador", (e) => console.log("gol", JSON.parse(e.data)));
// publicar
fetch("http://192.168.0.10:3579/c/ID?event=marcador", { method: "POST", body: JSON.stringify({ local: 2, visitante: 1 }) });
// WebSocket: lo que llega es {id, event, data}; lo que escribas (JSON) se publica
const ws = new WebSocket("wss://TU-DOMINIO/c/ID");
ws.onmessage = (e) => console.log(JSON.parse(e.data));
ws.onopen = () => ws.send(JSON.stringify({ hola: "mundo" }));Channels with a key (tfk_…, account-wide) receive it in Authorization: Bearer or X-API-Key; browsers cannot set headers on EventSource or WebSocket, so there it goes in ?api_key=. Cookies are never used. On reconnect, Last-Event-ID (or ?after=) recovers what was missed from the channel's last 100 messages: messages are not stored on disk, so if you need history, save them to a collection.
GET /d/<id>/_events streams a collection's changes live (created, updated, deleted) with the same access rule as reading it: a page can display the data and keep it up to date without polling. From a function, await env.CHANNELS.publish("nombre", datos, "evento") notifies the listeners of your account's channel (it does not exist in run_code).
Known limitation: the message bus lives in the memory of a single Teddy process; with multiple instances a shared bus would be needed (Postgres LISTEN/NOTIFY). Heartbeats (: ping every 25 s) keep the connection alive behind proxies.
Login for your customers
Your page can ask its own visitors to sign in (with Google) without you building anything: Teddy handles the login on its own domain, the customer confirms they want to sign in, and your page and your functions know who they are. They are not Teddy accounts: they are your customers, yours alone (you see them under Customers).
<script src="http://192.168.0.10:3579/sdk/teddy.js"></script>
<script>
await Teddy.ready; // recupera la sesión si ya había una
if (!Teddy.user) await Teddy.login(); // abre el popup de Teddy
console.log(Teddy.user.email, Teddy.user.name);
Teddy.onChange((u) => console.log("ahora:", u));
// Teddy.fetch añade la sesión; tu función recibe la identidad en cabeceras de confianza
const r = await Teddy.fetch("http://192.168.0.10:3579/f/ID_FUNCION/mis-pedidos");
await Teddy.logout();
</script>The function (with access: "user") receives x-teddy-user-id (eu_…, stable per customer and owner), x-teddy-user-email, x-teddy-user-name (encoded with encodeURIComponent) and x-teddy-user-provider. They are trusted: Teddy discards any x-teddy-* header sent by the client and the function never sees the token. Without a valid session it responds 401 (login_required or invalid_session). Keeping each customer's data separate is up to you (e.g. an owner_email field in your records, filtering by it inside the function with env.DB): that way the page never reads other customers' data.
export default { async fetch(req, env) {
const email = decodeURIComponent(req.headers.get("x-teddy-user-email"));
const mine = await env.DB.query("presupuestos", { filters: { cliente: email } });
return Response.json(mine.items.map((r) => r.data));
} }/a/<id>), not in ?bare=1 mode (Teddy.login() fails with no_shell). The session lasts 14 days, lives in that customer's browser and can be closed or deleted from the dashboard; it stops being valid if you pause or delete the page where it started. Customers who have not signed in for 90 days and have no session are removed automatically (freeing up quota). Teddy.fetch only sends the session to this Teddy's functions (/f/…). Maximum customers per plan: Free 100, Pro 100,000. Your pages still run in an isolated environment: you cannot embed the Google button inside it (its origin is opaque); use Teddy.login(). You can embed third-party content with <iframe>, which inherits that isolation and sends no Referer: those that require it (the YouTube player) show an error; those that do not (many maps and widgets) work. Providers: Google (requires GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET on the server and registering http://192.168.0.10:3579/eu/google/callback as the redirect URI); the "test account" is for demonstration only and is never active in production.MCP for agents
Remote MCP server (Streamable HTTP) at http://192.168.0.10:3579/mcp. Two ways to authenticate:
- OAuth 2.1 (what Claude uses): the client receives a 401 with
resource_metadata, reads/.well-known/oauth-protected-resourceand/.well-known/oauth-authorization-server, registers itself (dynamic registration), and you grant permission in Teddy. PKCE S256 is mandatory; 1 h tokens with rotating refresh. You revoke access under Settings → Connected apps. - Agent key:
Authorization: Bearer tdy_…, for scripts and MCP clients without OAuth.
Every tool declares a title and whether it only reads or whether it changes/deletes things (readOnlyHint / destructiveHint). Available tools:
publish_artifact | Publishes HTML and returns the URL. Accepts title, folder (by name), status and expiry. |
update_artifact | Replaces the HTML or changes title, folder, status (live/paused) or expiry. |
delete_artifact | Deletes an artifact. |
get_artifact | Metadata of an artifact. |
list_artifacts | Lists your artifacts; filter by folder and status. |
list_artifact_versions | Version history of an artifact. |
restore_artifact_version | Republishes a previous version (as a new version). |
create_share_link | Creates a secret link for sharing (also if private), with optional label and expiry. |
list_share_links | Secret links of an artifact with their visit counts. |
revoke_share_link | Revokes a secret link (it no longer opens the artifact). |
list_folders | Your folders and how many artifacts each has. |
list_templates | Templates for students, developers and teams: class notes, quiz, flashcards, study plan, project guide and meeting minutes. |
get_template | The HTML of a template, to keep its structure and change only the content. |
run_code | Runs code once in the sandbox, without publishing. |
publish_function | Publishes a function as the endpoint /f/<id>. |
update_function | New version, name, access, network or status. |
list_functions | Lists your functions. |
function_logs | Latest invocations with status, timings, console.log and rejections. |
delete_function | Deletes a function. |
create_function_key | Creates a tfk_ consumption key with limits and expiry. |
list_function_keys | Lists consumption keys and their usage. |
revoke_function_key | Revokes a key instantly. |
set_function_secret | Stores an encrypted secret (env.NAME). |
list_function_secrets | Names of the secrets (never values). |
delete_function_secret | Deletes a secret. |
create_schedule | Schedules a function with a cron (UTC). |
list_schedules | Lists your scheduled functions and their last result. |
update_schedule | Changes cron/path/body or enables and disables a schedule. |
delete_schedule | Deletes a schedule. |
schedule_runs | Run log of a schedule. |
get_usage | How much of your plan you have used (artifacts, space, functions) and how much is left. |
list_domains | Your own domains and which artifact each serves (root and paths); each domain comes with automatic sitemap, robots and IndexNow. |
set_domain | Serves a public artifact at the root of your own domain (gives you the DNS record to create; the certificate is issued automatically). |
claim_subdomain | Publishes your artifact at name.teddyagent.app (free: 1 subdomain, Pro: 10; first come, first served). |
set_domain_route | Serves another artifact at a path on your domain (e.g. /opinion). |
remove_domain | Stops serving on your domain, or removes a path. |
whoami | Your email, plan, limits and usage. |
list_collections | Lists your data collections with their access and size. |
create_collection | Creates a data collection with its /d/<id> API (access and optional schema). |
update_collection | Changes the name, access or schema of a collection. |
delete_collection | Deletes a collection and all its records. |
list_channels | Lists your real-time channels with their access and listeners. |
create_channel | Creates a real-time channel (/c/<id>) for live messages over SSE or WebSocket. |
update_channel | Changes the name or access of a channel (closes open connections). |
delete_channel | Deletes a channel and disconnects its listeners. |
publish_message | Publishes a JSON message to a channel: it reaches its listeners instantly. |
read_messages | Reads the latest messages of a channel (in-memory ring buffer). |
query_records | Reads records with filters, ordering and pagination. |
write_record | Creates, replaces or merges a record (with version control). |
delete_record | Deletes a record. |
list_end_users | Lists the customers who have signed in on your pages. |
delete_end_user | Deletes a customer and closes their sessions. |
Your domain
An artifact always lives at https://teddyagent.app/a/<id>. You can also serve it at your own address, from the chat or the API, without touching servers:
- teddy subdomain (Free 1, Pro 10):
claim_subdomain(name, artifact_id)→https://name.teddyagent.app. First come, first served; names of 3-40 characters (a-z, 0-9, hyphen). - Your own domain:
set_domain(host, artifact_id)(orPUT /api/domains/<host>). Create anArecord at your registrar pointing to the IP it returns; the HTTPS certificate is issued automatically on the first visit.www.redirects to the bare domain, or the other way round withprefer_www: true(canonicalwww.). - More pages:
set_domain_route(host, "/opinion", artifact_id)serves another artifact at that path (exact paths; anything else is a clean 404). - Your functions under your domain:
https://<host>/f/<id>with any method, no CORS: the form on your site calls your own host. - Files: the root artifact's files (images, CSS, JS; not HTML) are served at
https://<host>/<path>with a one-hour cache: images without data URIs and a realog:image. - SEO included:
sitemap.xml(root and live routes with their dates),robots.txtand IndexNow (your own key at/<key>.txt; every publish notifies Bing, Yandex, Naver and Seznam). Google does not use IndexNow: add the domain to Search Console and submit the sitemap. - Measurement: in Pulso, per domain: views by path, people, where they come from (search engines, social, direct) and the last IndexNow notice.
Privacy: on your domain there is no teddy panel and no teddy cookies; only your content and an anonymous visit cookie (no third parties).
Plans and limits
| Free | Pro | |
|---|---|---|
| Artifacts | 50 | 1000 |
| Size per artifact | 2 MB | 10 MB |
| Publishes per hour | 60 | 600 |
| Agent keys | 5 | 20 |
| Functions | 10 | 200 |
| Code per function | 256 KB | 1 MB |
| Time per invocation | 10 s | 30 s |
| Invocations per day | 10.000 | 1.000.000 |
| Calls/min per key (default) | 600 | 6000 |
| Calls/min per IP (public APIs) | 120 | 600 |
| run_code executions per hour | 120 | 1200 |
| Secrets per function | 20 | 100 |
| KV: keys / space | 1000 / 10 MB | 100.000 / 1 GB |
| KV: size per value | 64 KB | 1 MB |
| Collections | 5 | 50 |
| Records per account | 5000 | 500.000 |
| Size per record | 16 KB | 256 KB |
| Data: total space | 20 MB | 5 GB |
| Channels | 5 | 100 |
| Channel message | 16 KB | 64 KB |
| Messages/s per channel | 20 | 200 |
| Listeners per channel | 100 | 2000 |
| Open connections per account | 200 | 5000 |
Exceeding a limit returns 429 (or 403 if it is a quota), with a clear message and, where applicable, Retry-After.
Upgrade to Pro: in the dashboard, Plan → "Upgrade to Pro" (monthly payment; cancel any time and keep Pro until the end of the paid month). Going back to Free deletes nothing: whatever exceeds the limits stays, but you cannot create more until you are below them. Buying or cancelling is only done from the dashboard; with a key you can check the status at GET /api/billing.
REST API
Base http://192.168.0.10:3579. Authentication Authorization: Bearer tdy_…. Full specification at /openapi.json (OpenAPI 3.1): import it into Postman or Insomnia, or generate a client.
Account
| GET | /api/health | Service status no key |
| GET | /api/plans | Plans and limits no key |
| GET | /api/me | Who am I: email, plan, limits and usage |
| GET | /api/billing | Plan, subscription and payment history |
| GET | /api/me/export | Download all your data (ZIP) |
| GET | /api/me/onboarding | "Getting started" status |
| GET | /api/usage | Plan usage: artifacts, space and functions against the limits (level ok, warn at 80 %, full at 100 %) |
Artifacts
| GET | /api/artifacts | List my artifacts |
| POST | /api/artifacts | Publish an artifact |
| GET | /api/artifacts/{id} | View an artifact (metadata) no key |
| PUT | /api/artifacts/{id} | Replace the HTML |
| PATCH | /api/artifacts/{id} | Change title, status (live/paused), folder, expiry, visibility (public/private) or password |
| DELETE | /api/artifacts/{id} | Delete |
| GET | /api/artifacts/{id}/files | The artifact's files besides the HTML (current version) |
| GET | /api/artifacts/{id}/versions | Version history (every published HTML) |
| GET | /api/artifacts/{id}/versions/{n} | Content of a version (JSON with html, or ?format=html to download it) |
| POST | /api/artifacts/{id}/versions/{n}/restore | Restore a version (published as a new version) |
| GET | /api/artifacts/{id}/diff | Line-by-line differences between two versions |
| POST | /api/artifacts/{id}/report | Report an artifact (abuse, phishing…) no key |
Folders
| GET | /api/folders | List folders |
| POST | /api/folders | Create folder |
| PATCH | /api/folders/{id} | Rename |
| DELETE | /api/folders/{id} | Delete (artifacts become "no folder") |
| POST | /api/folders/{id}/index | Create (or update) the "Index · folder" page with links to everything in the folder |
Agent keys
| GET | /api/keys | List my tdy_ keys |
| POST | /api/keys | Create a tdy_ key (shown only once) |
| DELETE | /api/keys/{id} | Revoke |
Functions
| GET | /api/functions | List my functions |
| POST | /api/functions | Publish a function as the endpoint /f/{id} |
| GET | /api/functions/{id} | View a function (with code) |
| PUT | /api/functions/{id} | Publish a new version of the code |
| PATCH | /api/functions/{id} | Change name, status (live/paused), access, network or folder |
| DELETE | /api/functions/{id} | Delete (with its keys, secrets and memory) |
| GET | /api/functions/{id}/logs | Latest invocations (including rejected ones, with reason) |
Function access
| GET | /api/functions/{id}/usage | Usage over the last 7 days per key |
| GET | /api/functions/{id}/rejections | Rejected attempts (7 days) by reason |
| GET | /api/functions/{id}/keys | Consumption keys valid for this function |
| POST | /api/functions/{id}/keys | Create a tfk_ consumption key for this function only |
| GET | /api/function-keys | All my consumption keys |
| POST | /api/function-keys | Create a consumption key (for one function or all) |
| PATCH | /api/function-keys/{id} | Change name and limits |
| DELETE | /api/function-keys/{id} | Revoke instantly |
Secrets
| GET | /api/functions/{id}/secrets | List secret names (never values) |
| POST | /api/functions/{id}/secrets | Create or replace a secret |
| PUT | /api/functions/{id}/secrets/{name} | Create or replace a secret by name |
| DELETE | /api/functions/{id}/secrets/{name} | Delete a secret |
Schedules
| GET | /api/schedules | All my scheduled functions |
| GET | /api/functions/{id}/schedules | Schedules of this function |
| POST | /api/functions/{id}/schedules | Schedule the function (5-field cron, in UTC) |
| GET | /api/functions/{id}/schedules/{sid} | View a schedule |
| PATCH | /api/functions/{id}/schedules/{sid} | Change cron, path, body, name, or enable/disable it |
| DELETE | /api/functions/{id}/schedules/{sid} | Delete the schedule (and its log) |
| GET | /api/functions/{id}/schedules/{sid}/runs | Run log (14 days) |
| POST | /api/functions/{id}/schedules/{sid}/run | Run it now (max. 20 per hour) |
Memory (KV)
| GET | /api/functions/{id}/kv | List the keys of the function's KV |
| DELETE | /api/functions/{id}/kv | Empty the KV |
| GET | /api/functions/{id}/kv/{key} | Read a key |
| DELETE | /api/functions/{id}/kv/{key} | Delete a key |
Execution
| POST | /api/run | Run code once, without publishing |
Data (collections)
| GET | /api/collections | List your collections |
| POST | /api/collections | Create a data collection |
| GET | /api/data-usage | Data usage: collections, records and bytes against the plan |
| GET | /api/collections/{id} | View a collection |
| PATCH | /api/collections/{id} | Change name, access or schema |
| DELETE | /api/collections/{id} | Delete the collection and all its records |
| GET | /api/collections/{id}/records | Records of the collection (owner view; same filters as the public API) |
| POST | /api/collections/{id}/records | Create a record (the body is the JSON object itself) |
| DELETE | /api/collections/{id}/records | Empty the collection |
| GET | /api/collections/{id}/records/{rid} | Read a record |
| PUT | /api/collections/{id}/records/{rid} | Replace (or create with that id) a record; `If-Match` header with the version |
| PATCH | /api/collections/{id}/records/{rid} | Merge fields into a record (null removes a field) |
| DELETE | /api/collections/{id}/records/{rid} | Delete a record |
| POST | /api/collections/{id}/import | Import up to 1000 records at once (all or nothing) |
| GET | /api/collections/{id}/export | Export all records (`format`: json, ndjson or csv) |
Channels (real time)
| GET | /api/channels | List your channels |
| POST | /api/channels | Create a real-time channel |
| GET | /api/channel-usage | Channel and open-connection usage against the plan |
| GET | /api/channels/{id} | View a channel |
| PATCH | /api/channels/{id} | Change name or access (closes open connections) |
| DELETE | /api/channels/{id} | Delete the channel and disconnect its listeners |
| POST | /api/channels/{id}/publish | Publish a message as owner |
| GET | /api/channels/{id}/messages | Latest messages (in-memory ring buffer; `after` = last id seen) |
Channels: public API
| GET | /c/{id} | Listen: SSE (`Accept: text/event-stream`), WebSocket (`Upgrade: websocket`) or, without them, the latest messages as JSON no key |
| POST | /c/{id} | Publish a message (body: any JSON; `?event=name`) no key |
End users
| GET | /api/end-users | List the customers who have signed in to your apps |
| DELETE | /api/end-users/{id} | Delete a customer and close their sessions |
End users: session API
| GET | /eu/api/me | Who the customer of this session is (`Authorization: Bearer tus_…`) no key |
| POST | /eu/api/logout | Sign the customer out no key |
Data: public API
| GET | /d/{id} | List records with filters no key |
| POST | /d/{id} | Create a record no key |
| GET | /d/{id}/{rid} | Read a record no key |
| PUT | /d/{id}/{rid} | Replace or create with a chosen id (`If-Match`: version) no key |
| PATCH | /d/{id}/{rid} | Merge fields (null removes; `If-Match`: version) no key |
| DELETE | /d/{id}/{rid} | Delete (`If-Match`: version) no key |
| GET | /d/{id}/_events | Live changes of the collection (SSE): `created`, `updated`, `deleted` no key |
Errors
Always JSON with error (human-readable text) and sometimes code (stable, for programs): unauthorized, invalid_api_key, quota_exceeded, rate_limited, too_large, moderation_rejected, no_default_export…
{ "error": "Tu plan permite 20 secretos por función", "code": "quota_exceeded" }