Prompts & prompt rules

How AskThis generates AI prompts per page, and how rules tailor them (Business and above).

Each “Ask AI” button hands the visitor a prompt built from your page — generated once and cached, never composed by an AI on click. On Business and above, rules let you tailor that prompt per page.

How rules match

A rule has a match and a priority:

  • match.urlPattern — tests the page URL/path. Supports * wildcards (/blog/*); a bare substring also matches (/products/).
  • match.pageType — an exact match against the detected page type (article, product, …).
  • If both are set, both must match.

On regeneration, active rules are consulted in priority order — lowest number first — and the first match wins. Put the most specific rules at the top (lowest number), broad catch-alls at the bottom. Rules change the prompt text only, not which buttons appear.

# Create a rule: product pages, high priority (requires the rules:write scope)
curl -X POST https://api.askthis.io/api/v1/rules \
  -H "Authorization: Bearer <key>" -H "Content-Type: application/json" \
  -d '{ "siteId": "cq_8f2a", "match": { "pageType": "product" }, "priority": 10 }'

Bulk prompt operations

Operation What it does
Apply tone Retone every prompt in a page-type category — no credits
Bulk regenerate Regenerate prompts across many pages at once
Regenerate one Regenerate a single page’s prompt
Export / Import Save prompts as JSON, then restore or migrate them

Full API reference

Rules and bulk ops use the rules:* and prompts:* API-key scopes. The complete endpoint reference is in the developer docs: prompt rules.

Was this helpful?

Last updated July 26, 2026 · Edit this page ↗