Automate Schema for Every Client Site With One API Integration
How agencies and developers use the SchemaInject API to deploy AI-optimized structured data across every client site in minutes ā no per-site development, no manual maintenance.
Automate Schema for Every Client Site With One API Integration
> TL;DR
> - One API integration generates and deploys complete schema for every client site you manage
> - Add it to your onboarding workflow: new client ā project created ā snippet deployed ā schema active
> - Works with any CMS, any framework, any platform
> - Get API access ā
Updated: April 21, 2026
---
The Problem with Manual Schema at Scale
You onboard a new client. Their site needs Product schema, Organization schema, BreadcrumbList, and FAQ schema across 200 product pages. Prices change monthly. They add new products weekly.
Manual approach: developer edits theme files, writes JSON-LD, deploys. Repeat for every change. Repeat for every client. This doesn't work at agency scale.
The automated approach: one API call creates a project, generates a script tag, client adds it to their site header. Schema is live, always current, zero maintenance.
---
The Two-Step Automation
Step 1: Create a project via API (on client onboarding)
import requestsdef onboard_client_schema(domain, org_name, site_type, config):
"""
Call this during client onboarding.
Returns the script tag to add to the client's site.
"""
response = requests.post(
"https://robo-27abd188.base44.app/functions/schemaApi",
json={
"admin_token": ADMIN_TOKEN,
"action": "admin_create",
"data": {
"domain": domain,
"owner_email": f"schema@{domain}",
"plan": "pro",
"schema_types": get_schema_types(site_type),
"site_config": config,
"is_active": True
}
}
)
data = response.json()
api_key = data["project"]["api_key"]
snippet = f''
return snippet
def get_schema_types(site_type):
types = {
"ecommerce": ["Product", "Organization", "BreadcrumbList"],
"local_business": ["LocalBusiness", "BreadcrumbList"],
"saas": ["SoftwareApplication", "Organization"],
"content": ["Article", "Organization", "BreadcrumbList"],
"service": ["LocalBusiness", "Service", "BreadcrumbList"]
}
return types.get(site_type, ["Organization", "BreadcrumbList"])
Usage
snippet = onboard_client_schema(
domain="newclient.com",
org_name="New Client LLC",
site_type="ecommerce",
config={
"org_name": "New Client LLC",
"return_days": 30,
"free_returns": True,
"shipping_days_min": 3,
"shipping_days_max": 7
}
)
print(snippet)
ā
Step 2: Add the snippet to the client's site
WordPress (via REST API):
def add_snippet_to_wordpress(wp_url, wp_user, wp_pass, snippet):
# Using Insert Headers and Footers plugin option
import base64
auth = base64.b64encode(f"{wp_user}:{wp_pass}".encode()).decode()
requests.post(
f"{wp_url}/wp-json/wp/v2/settings",
headers={"Authorization": f"Basic {auth}"},
json={"insert_headers_and_footers_header": snippet}
)
Shopify (via Admin API):
def add_snippet_to_shopify(shop_domain, access_token, snippet):
# Add to theme.liquid via Shopify Assets API
requests.put(
f"https://{shop_domain}/admin/api/2024-01/themes/main/assets.json",
headers={"X-Shopify-Access-Token": access_token},
json={
"asset": {
"key": "layout/theme.liquid",
# Insert snippet before in the theme
}
}
)
---
Monitoring All Client Projects
def get_all_project_scores():
"""Run daily to check schema health across all clients."""
projects = get_all_projects() # fetch from your DB
report = [] for project in projects:
response = requests.post(
"https://robo-27abd188.base44.app/functions/schemaApi",
json={
"action": "audit",
"url": f"https://{project['domain']}",
"key": project['api_key']
}
)
data = response.json()
report.append({
"client": project["domain"],
"score": data["ai_visibility_score"],
"issues": data.get("missing_high_impact", [])
})
# Flag clients with score below 70
alerts = [r for r in report if r["score"] < 70]
return report, alerts
Run this daily. Alert your team if any client drops below your SLA threshold. Include the score in your monthly client report.
---
The Monthly Client Report Template
AI Visibility Report ā [Month] [Year]
Client: [Name] | Domain: [domain.com]
| Metric | Value |
|---|---|
| AI Visibility Score | 87/100 |
| Schema Types Active | Product, Organization, BreadcrumbList, FAQPage |
| Pages with Schema | 247 |
| Google Rich Results Status | ā
Valid (Product rich results active) |
| Top Missing Fields | OfferShippingDetails (medium priority) |
What this means: Your product pages are now discoverable by AI shopping agents including ChatGPT, Perplexity, and Google AI. When shoppers ask AI assistants for products in your category, your products are eligible to appear in recommendations and autonomous purchase flows.
Next month: We'll add OfferShippingDetails schema to enable delivery timeline queries and improve your score to 94+.
This positions schema as an ongoing AI visibility service ā recurring revenue, clear value delivery, easy to report on.
ā Get API access for agencies ā
---
Related articles: