Match your website
Give Samva a website address and get a template project whose theme, logo, and fonts follow the site, plus a brand you apply only when you approve it.
Start a template from your website instead of a blank starter. Samva checks that the site is a public page, creates a template project, and hands you a ready request for the editor's assistant. The assistant reads the site, rebuilds the project's theme and blocks to match its colors, type, logo, and layout, redesigns the email in them, and proposes a brand. The brand changes nothing until you apply it.
What you get
- A template project with the site's look in its own
theme.cssandtemplates/blocks/. Only this project changes. It is named after the site (its own name when the page gives one, otherwise its host, as inexample.com email), and its description says which address it matches. - A handle you can send by. The template's handle comes from that name, such as
example-domain-email, and the project's entry declares the same handle as itsdefineTemplateid. Publish the template, then send it by that handle. - A brand proposal in the editor with the theme, logos, and footer details the assistant found. Apply brand writes it to your organization with your own access, as a new brand named after the site. Not now writes nothing, and the project keeps its look either way.
Start from the dashboard
- Open Templates and choose Match your website.
- Enter the site's address, such as
example.com, and continue. - The editor opens on the new project with a short request, such as "Make this email look like https://example.com/.", written in the assistant's message box. Edit it if you like, and send it.
- Review the result in the preview, then choose Apply brand on the proposal if you want the site's look as a brand.
The assistant sends no email and publishes nothing.
Start from code
POST /v1/templates/from-website takes the address and an Idempotency-Key header:
import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const { template, website, ask } = await samva.templates.createFromWebsite({
url: "example.com",
}, { idempotencyKey: "match-example-com-1" });
console.log(template.id, website.host);curl https://api.samva.dev/v1/templates/from-website \
-H "Authorization: Bearer $SAMVA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: match-example-com-1" \
-d '{"url": "example.com"}'The response carries the new template, the website Samva checked (the url you gave,
normalized, and its host), and ask, the request to send the assistant. Pass name to choose the
template's name; otherwise it comes from the site. Repeat the call with the same idempotency key,
address, and name and you get the same template back, even if the site is down by then. The same key with another address, name, or namespace is refused with a 409. A key
scoped to a namespace creates the project in its own namespace, and a reused key never returns an
organization template shared with every namespace to it. Open the template in the dashboard editor
and send ask there. The CLI and the hosted MCP
server create the same project; see the
API reference for every field.
When a site cannot be matched
Samva checks the address before it creates anything. A site it cannot use creates no project, and
the 422 response says which of these happened:
| Cause | What to do |
|---|---|
| Not a web address | Use the site's address, for example https://example.com. |
| Not https | Use the https address. Samva only matches sites that open over https. |
| Not a public website | The site must open for anyone on the internet, not only on a private network. |
| No answer | The domain does not resolve, or the connection failed or timed out. |
| Page not found | The address answers 404 or 410. Use the address of a page that loads. |
| Refuses automated visits | The site answers 401, 403, 429, or 451, or serves a bot challenge. |
| Failing | The site answers with a server error. Try again later. |
| Not a web page | The address serves a file or data, not a page. |
A site that refuses automated visits cannot be read or screenshotted. Create a template without a website, attach a screenshot of the site in the editor, and ask the assistant to match it.
A site can also answer Samva's check and still refuse the assistant's research later. The assistant stops and says which step failed, instead of guessing a look from memory.
Use only assets you have the right to use
The assistant takes the logo and fonts the site serves and adds them to your project and your brand proposal. Samva does not check who owns them. Match your own site or a site you have permission to use, and review the logo and fonts in the proposal before you apply it. Matching a site again after a redesign is a new run: create a new project, or ask the assistant in the existing one to update the look.
Related
- Brands for what a brand holds and how templates import one.
- Agent loop for the checks the assistant runs on a project.