01 — Overview

What this exposes

GThree publishes a small, focused set of HTTP endpoints for Share of Model benchmarking, demo conversion capture, nurture drip scheduling, and Shopify OAuth + audit. All endpoints respond in JSON unless noted.

Base URL: https://gthree.agency
Content negotiation: send Content-Type: application/json on every POST. Responses are always JSON or HTML (for OAuth callbacks and unsubscribe).
02 — Benchmark API

Share of Model benchmarking

Run synthetic purchase-intent queries against GPT-4o, GPT-4o Mini, Claude Sonnet 4, and Claude 3.5 Sonnet to measure how often AI assistants recommend a brand (and optionally a competitor).

POST /api/benchmark

Returns Share of Model percentages broken down by model and query type. Pass a competitorDomain for head-to-head compare mode; omit it for solo mode.

Request body
{
  "brandDomain":      "example.com",
  "competitorDomain": "competitor.com"  // optional — omit for solo mode
}
Response body (compare mode)
{
  "mode": "compare",
  "results": {
    "overall":      { "brand": 62, "competitor": 38 },
    "byModel":      [{ "name": "GPT-4o", "model": "gpt-4o", "brand": 70, "competitor": 30 }],
    "byQueryType":  { "product-research": { "brand": 65, "competitor": 35, "tests": 8 } }
  },
  "summary": {
    "headline":       "example.com is mentioned more often...",
    "gap":            24,
    "modelInsight":   "...",
    "typeInsight":    "...",
    "recommendation": "..."
  }
}
cURL
curl -X POST https://gthree.agency/api/benchmark \
  -H 'Content-Type: application/json' \
  -d '{"brandDomain":"example.com","competitorDomain":"competitor.com"}'
03 — Nurture API

Nurture drip scheduler

GThree runs a 4-email nurture drip after every demo request. The cron endpoint sends due emails; the unsubscribe endpoint cancels remaining sends for a prospect.

POST /api/nurture/send

Public cron-triggered endpoint. Pulls up to 20 due emails and dispatches them. Idempotent — safe to call on any schedule (GThree runs it every 10 minutes).

Response body
{ "processed": 12, "errors": 0 }
cURL
curl -X POST https://gthree.agency/api/nurture/send \
  -H 'Content-Type: application/json'
GET /api/nurture/unsubscribe

One-click unsubscribe. The token is the base64-encoded prospect email; id is the nurture row id. Cancels all pending emails for that prospect.

Query parameters
?id=123&token=amFtZXNAZXhhbXBsZS5jb20=
cURL
curl 'https://gthree.agency/api/nurture/unsubscribe?id=123&token=amFtZXNAZXhhbXBsZS5jb20='
04 — Shopify Integration

Shopify OAuth + catalog audit

Three-step flow: merchants start at /shopify/connect, complete OAuth at Shopify, and land on an audit page that scores their product catalog against GEO best practices.

Required environment variables
SHOPIFY_CLIENT_IDFrom Shopify Partner Dashboard app credentials. SHOPIFY_CLIENT_SECRETFrom Shopify Partner Dashboard app credentials. APP_URLBase URL of this app. Shopify redirect URI must be {APP_URL}/shopify/callback.
GET /shopify/connect?shop=<host>.myshopify.com

Validates the shop domain, generates an OAuth state token, and 302s to Shopify's authorize URL with scopes read_products,read_product_listings,read_metaobjects.

cURL
curl -i 'https://gthree.agency/shopify/connect?shop=acme.myshopify.com'
GET /shopify/callback?code=&state=&shop=

Exchanges the authorization code for an access token, saves the connection, runs the catalog audit, and 302s to /shopify/audit/:id.

GET /shopify/audit/:id

Renders the audit HTML page (total products, products with gaps, top gap categories, per-product findings).

05 — Demo & Marketing API

Demo conversion + UTM attribution

Endpoints used by the demo page form and by the GThree team's outbound campaigns. All return JSON.

POST /api/demo-conversion

Captures a demo-page submission with full UTM attribution. Generates a visitor id, looks up the matching marketing touchpoint, and persists the conversion.

Request body
{
  "name":         "Jane Doe",
  "email":        "jane@example.com",
  "store_url":    "https://example.com",
  "utm_source":   "linkedin",
  "utm_medium":   "cpc",
  "utm_campaign": "spring-launch",
  "utm_content":  "hero-cta",
  "utm_term":     "geo-agency"
}
Response body
{ "success": true, "conversion_id": 482 }
cURL
curl -X POST https://gthree.agency/api/demo-conversion \
  -H 'Content-Type: application/json' \
  -d '{"name":"Jane Doe","email":"jane@example.com","store_url":"https://example.com"}'
GET /api/marketing-touchpoints

Returns the list of active marketing touchpoints (UTM templates). Each touchpoint has base_url, the five UTM params, and a type (email, paid_search, etc.).

POST /api/admin/outbound/enroll

Admin only. Bulk-enrolls outbound contacts into the nurture drip. Skips contacts already on a sequence. See the Authentication section for the bearer token.

Request body
{
  "contacts": [
    { "name": "Jane", "email": "jane@example.com", "storeUrl": "example.com", "somScore": 42, "category": "skincare" }
  ]
}
Response body
{ "enrolled": 1, "skipped": 0, "errors": 0, "detail": [{ "email": "jane@example.com", "result": "enrolled" }] }
06 — Authentication

Auth model

Two surfaces with different auth: admin endpoints use a static bearer token; Shopify uses OAuth 2.0 against the merchant's store.

Admin Bearer Authorization: Bearer ${ADMIN_SECRET}

All endpoints under /api/admin/* require this header. The token must match the server's ADMIN_SECRET env var. Missing or mismatched tokens return 401 Unauthorized.

cURL
curl -X POST https://gthree.agency/api/admin/outbound/enroll \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer $ADMIN_SECRET' \
  -d '{"contacts":[{"name":"Jane","email":"jane@example.com"}]}'
Shopify OAuth https://<shop>.myshopify.com/admin/oauth/authorize

Merchants complete OAuth at Shopify. GThree exchanges the authorization code server-side using SHOPIFY_CLIENT_ID + SHOPIFY_CLIENT_SECRET. No user-facing API key is exposed.

No public API key — every other endpoint on this site (benchmark, demo-request, demo-conversion, nurture, marketing-touchpoints) is unauthenticated and rate-limited at the platform layer.
07 — OpenAPI Spec

Machine-readable reference

A complete OpenAPI 3.0 spec for every endpoint above is available at /docs/openapi.json. Import it into Swagger Editor, Postman, or any OpenAPI-aware tooling.

Fetch the spec
curl https://docs.gthree.agency/openapi.json | jq '.paths | keys'
AI assistants — a plain-text project overview is also published at /docs/llms.txt per the llms.txt convention. Use whichever surface your tooling prefers.