Skip to content
Browse documentation

Getting started

AI agent integration

AI agents and server automations integrate a Webtools project with a secret project key — no dashboard login. Instead of a raw OpenAPI dump, an agent fetches a feature-filtered documentation pack that describes only the modules the project has enabled, then seeds or writes content incrementally.

Secret key scopes

Agent routes require a Secret key (wt_sk_…). Issue it in the dashboard under Project settings → API keys.

ScopePurpose
storefront.docsDownload the agent documentation pack.
storefront.seedRun a batch seed (each section also needs its write scope).
storefront.write.catalogueProducts and product categories.
storefront.write.contentPosts, authors and blog categories.
storefront.write.mediaMedia uploads.
storefront.write.servicesService catalogue.
storefront.write.past_worksPast works portfolio.
storefront.write.crmCRM contacts, companies and opportunities.
storefront.write.landing_pagesLanding page types and entries.
  • A key with * satisfies any scope; storefront.* satisfies any storefront.<action> scope.
  • Send the key as Authorization: Bearer wt_sk_… or X-Project-Key: wt_sk_…. Never from a browser.
  • Publishable keys cannot be issued with agent scopes and cannot call docs, seed or write routes.

Endpoints

MethodPathScopeNotes
GET/api/v1/storefront/projects/{project_slug}/agent-docsstorefront.docsQuery format=markdown (default) or format=json. Returns only sections for enabled project features.
POST/api/v1/storefront/projects/{project_slug}/seedstorefront.seedOptional Idempotency-Key header. Supports dry_run. Maximum 100 items per list in each seed section.

Write routes

Each granular write route requires the matching storefront.write.* scope and the project feature listed. Paths are relative to /api/v1/storefront/projects/{project_slug}.

MethodPathScopeFeature
POST / PATCH…/products, …/products/{product_slug}storefront.write.cataloguecommerce
POST / PATCH…/product-categories, …/product-categories/{category_slug}storefront.write.cataloguecommerce
POST / PATCH…/posts, …/authors, …/blog-categories (and their /{slug} forms)storefront.write.contentblog
POST…/media (multipart)storefront.write.mediablog, commerce, past_works, services, or landing_pages
POST / PATCH…/services, …/services/{service_slug}storefront.write.servicesservices
POST / PATCH…/past-works, …/past-works/{past_work_slug}storefront.write.past_workspast_works
POST / PATCH…/crm/contacts, …/crm/companies, …/crm/opportunitiesstorefront.write.crmcrm
POST / PATCH…/landing-pages, …/landing-pages/{page_slug}, …/entries, …/entries/{entry_slug}storefront.write.landing_pageslanding_pages

Integration sequence

  1. Issue a secret key with storefront.docs plus the write scopes you need (dashboard → Project settings → API keys).
  2. GET …/agent-docs?format=json and load only the returned sections into the agent context.
  3. Optionally POST …/seed with dry_run=true to validate payloads.
  4. Run a live seed, or use the granular write routes for incremental updates.
  5. Use publishable keys only for public reads, carts and checkout in the browser.
Fetch the docs pack
curl "https://api.webtools.ng/api/v1/storefront/projects/your-project/agent-docs?format=json" \
  -H "Authorization: Bearer wt_sk_your_secret_key"
Dry-run a seed
curl -X POST "https://api.webtools.ng/api/v1/storefront/projects/your-project/seed" \
  -H "Authorization: Bearer wt_sk_your_secret_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: seed-v1" \
  -d '{"dry_run":true,"catalogue":{"products":[{"name":"Demo","slug":"demo","default_variant":{"price_minor":1000}}]}}'

Behaviour notes

  • Disabled project features return 404 and are omitted from the docs pack entirely.
  • Missing scope returns 403; missing key returns 401.
  • Write and seed routes are rate limited to 30 requests per minute per key fingerprint and client IP.
  • Writes are attributed to the account that issued the API key.
  • Seed idempotency within a batch uses the entity slug (contact email when present). An existing slug is skipped.

For public reads, carts and checkout in the browser, use a publishable key — see Authentication.