Endpoints
A live public URL bound to a workflow. How anything on Tessryx becomes reachable on the web, with caching and access control.
An endpoint is a live public URL bound to a workflow. A visitor hits the address, the workflow runs, and its result is served: a page or a data response, whatever the workflow returns. Endpoints are how anything on Tessryx becomes reachable on the web.
#What one endpoint holds
- A workflow: the logic that produces the response.
- Optionally, a content record bound as the workflow's data, so a page renders from it server-side. (Or the workflow fetches its own data, or the page loads it in the browser.)
- Methods:
GETto serve; addPOSTto accept a submitted form or API call, andPUT,PATCHorDELETEfor an API route that changes or removes something. A method the endpoint doesn't list gets a405. - Input: how the workflow's input is supplied (below).
- Caching: how long a result is reused (below).
#Pages and API routes
An endpoint covers both halves of a site:
- Pages: the HTML a visitor sees.
- API routes: the addresses a page's own buttons and forms call to do things (submit, load more, take a payment). A page and the routes it calls are all endpoints.
#Input and path parameters
An endpoint decides what input its workflow receives:
- None: a plain page that needs nothing.
- Static: a fixed input on every request.
- From the request: built from the URL. This is how one endpoint serves many pages: a
slug like
post/:slugcaptures the part afterpost/and hands it to the workflow, so a single endpoint renders every blog post. APOST's submitted body can be mapped in the same way. The body can be JSON or a plain HTML form; a form arrives as an object of strings, and any other content type gets a415.
A malformed or unmatched URL is served as a 404: a bad address reads as "no such page," never an error that reveals how the route works.
An API route for one record can answer GET, PUT, PATCH and DELETE from the same
endpoint, and the workflow tells them apart by the request's method. Every method but GET
can carry a body, read like a POST's, and is never cached.
#Query strings
A page reads ?q=maps&page=2 only if the endpoint names those parameters. Named ones reach
the workflow; every other parameter is ignored and never makes the page build again, so links
carrying ?utm_source= or an ad click id cost nothing extra on a cached page. Each different
combination of named values is its own page in the cache, so name only what the page reads.
Visitors type these values, so the workflow should check them, for example that page is a
number. An API route only your own pages call can also refuse any parameter it didn't name,
with a 400.
#Visitor headers and cookies
An endpoint can also name a few request headers: the visitor's languages, browser, the page they came from, and their country. And it can name cookies your page's own script set, like a theme or language choice. Tessryx's own sign-in cookies can never be read, and neither can the visitor's IP address.
A page that reads either is built per visitor, so it's cached only in each visitor's own browser, and every visitor's first view is a run. To keep pages cheap, read the language once on an address that only redirects, and give each language its own cached pages.
#Addresses: redirects, catch-alls and not-found pages
Redirects. When you rename or move a page, publish a redirect at the old address so links
and search rankings follow. It sends visitors to another page of yours or any https address,
as a 301 (moved for good) or a 302 (temporary). Nothing runs and no credits are used. A
redirect at old/:slug can send to posts/:slug, carrying the captured part over. Since
nothing clears a cached page, a redirect published over one takes effect once that copy runs
out.
One address per page. An address with a trailing slash or capital letters, like
/Blog/Post/, gets a 301 to the page's own address, /blog/post. Old links keep working
and search engines see one page.
Catch-all routes. A slug ending in *name, like docs/*path, answers every address
beneath it: /docs/a and /docs/a/b/c alike, with the rest of the address handed to the
workflow. It needs a fixed first folder, so it can't cover the whole site, and a cache time, because every
different address under it is a run. The workflow can still answer 404 for paths it doesn't
know.
Your own not-found page. Mark an endpoint as the not-found page and it answers, with a
404, every unknown address in its folder and below; a top-level one covers the whole site.
One build serves every address for a whole cache time, so a flood of made-up addresses still
costs nothing. It needs a cache time and can't require sign-in.
#Calling your routes from another website
By default only pages on your own site can read what an endpoint returns. To let scripts on
other websites call it, list their origins (https://myshop.com), or * for any website. The
browser's preflight check is answered for you, without a run.
- Caching: with
*or one website, the route is cached as usual. With several, each answer names the caller, so it's cached in each visitor's browser only. - No sign-in: it can't be used on an endpoint that requires sign-in, and calls from other websites never carry a visitor's Tessryx sign-in.
#Caching
Caching is the biggest lever on speed and cost. An endpoint sets how long the edge may serve a cached copy:
- Cache time: how long a built page is reused before it's rebuilt. It's also how long an edit takes to appear, so keep it short while iterating (0–30s) and raise it once the page has settled (minutes to an hour).
- Serve-stale window: after the cache time lapses, keep showing the last version instantly while the next rebuilds in the background, so nobody waits.
No caching means a workflow run (and a credit) on every visit. Nothing clears a cached page on demand, so the cache time is a promise: it's the longest a change can take to show. See Credits and caching.
#Requiring sign-in
An endpoint can require a Tessryx sign-in before it serves anything. On its own that's a
plain login wall: any signed-in account is let in. You can narrow it to members of your
workspace holding a given role, and choose what a denied or not-signed-in
visitor sees (a 403, a redirect, a login prompt, or a 401 for an API route). A gated
endpoint is never shared-cached (its caching becomes browser-only), so one visitor's page is
never handed to another.
#Webhooks from another service
An endpoint can be a webhook: an address another service calls when something happens, like
a Stripe payment, a Slack slash command or a GitHub push. Name the service and the
secret holding its signing secret, and every request must be signed by that
service. One that isn't is refused with a 401 before your workflow runs.
- Services: Slack, Discord, Stripe, GitHub, GitLab, Shopify, and any sender that follows Standard Webhooks (Svix, Clerk, Resend, OpenAI and others).
- The route: it takes
POSTonly and can't also require sign-in. - Setup checks: Slack's URL verification and Discord's PING are answered for you.
- What the workflow sees: the body (JSON, or a form with Slack's
payloadalready parsed) and the service's delivery headers, such as GitHub's event name or Shopify's topic. Never the signing headers, and never the secret. - Reply fast: senders retry a reply that takes more than a few seconds (Slack and Discord about 3, others about 10), so answer at once and leave longer work to a chain.
Taking payments. There's no checkout built in. Make a Stripe Payment Link for each
product, link to it from your page with your order id added, and have a POST route verified
as Stripe receive the checkout.session.completed event. It records the order by that id.
#Live pages
An endpoint can also be live: instead of loading it, a page connects to it and changes the moment something happens, for everyone on it at once. Live scores, chat, multiplayer games and who's online are all built this way. See Live pages.
#Stop form spam with Turnstile
Cloudflare Turnstile is a free bot check that most people never notice. Make a widget in your
Cloudflare dashboard for your site's address, put its site key in the form (it's public),
and store its secret key in Secrets. Then set the form's POST route to
verify with Turnstile and that secret.
Every post must then carry a token from the widget, solved on your site. A missing, reused, expired or forged token is refused before your workflow runs, so spam costs you nothing, and the token is taken out of the body your workflow sees. Cloudflare's test keys work for trying it out.
#On the default address
Until you add a custom domain, a site serves from a
yourname.tessryx.app address. There, pages carry a small "Served by Tessryx" badge, aren't
indexed by search engines, and use the platform's robots file. All three lift the moment you
serve from your own domain.