Build with AI agents
Hand the setup to the coding agent in your own code (Claude Code, Cursor, Codex): one prompt with everything it needs, and a key that can only do its job.
Hand it to your AI agent
In API keys (or under a site's install snippet in Sites), choose Hand it to your AI agent. Pick what the agent should do:
- Add VisitorLoop to your website: the script in every page's head, in the right file for your framework, and who's signed in. Site keys are public, so this needs no key.
- Send your app's sign-ups: new users become contacts. It makes a contacts key: Adds and updates contacts, looks one up by email, and reads widgets and email templates. It can't list your contacts or send emails.
- Send emails from your code: triggers and broadcasts. It makes a full-access key, which can email your contacts, so pick it only when you need it.
Copy the prompt and paste it into your agent. It's written for your workspace (your sites and their keys, your widgets and templates), so the agent doesn't guess. Keys made this way show in API keys, named “AI agent”, where you can delete them.
The key is a secret
Discovery API
GET https://visitorloop.app/api/v1 describes the whole API, the JavaScript SDK and webhooks as JSON, with no key. With a key (Authorization: Bearer …) it adds you: your workspace, the key's scope, your sites with their site keys, and your widgets.
curl https://visitorloop.app/api/v1 -H "Authorization: Bearer $VISITORLOOP_API_KEY"| Call | Key | What it does |
|---|---|---|
GET /api/v1 | none | This manifest. With a key, `you` adds the workspace: its sites (with their site keys), widgets and the key's scope. |
POST /api/v1/leads | contacts or full | Add a contact (a lead), or update the one with the same email: `data` is merged into what's there. Safe to call on every sign-up or login. When someone changes their email, send the new one with `previousEmail`. Without `widgetId`, API contacts are filed under "Contacts from your app", a widget made for them (archived: it never shows on a site). |
GET /api/v1/leads?email=… | contacts or full | The one contact with that email, or null: to check that a sign-up arrived, or what's known about someone. |
GET /api/v1/leads | full | The contacts, newest first. |
GET /api/v1/widgets | contacts or full | The widgets (popups, banners, messages, social proof, tooltips, embedded forms). |
GET /api/v1/templates | contacts or full | The email templates, for POST /api/v1/trigger. |
POST /api/v1/trigger | full | Email a template to every subscribed contact whose `data` has all the `match` values (for example everyone who bought a product). |
POST /api/v1/broadcasts/{token}/send | full | Send a saved broadcast now (its trigger token is on the broadcast's page in the dashboard). Each call sends a copy to its audience. Send an `Idempotency-Key` header so a retry doesn't send twice. |
For AI assistants
/llms.txt lists these docs and the API for AI assistants, and /llms-full.txt has the API, the SDK and webhooks in one file. Point an assistant at either and it can answer questions about VisitorLoop or write the code.
Install it yourself
The script, once per page, in the <head>, with your site's key from Sites:
<script async src="https://visitorloop.app/loader.js" data-site="YOUR_SITE_KEY"></script>