Need public brand information? Keyless Optimly Index reads require no credentials.
Developer reference · REST
Keyed REST API
Ordinary HTTP against a bearer key. The same records the application and the MCP connector read, exposed as 18 routes under /api/v2.
Authentication
Send a key as a bearer credential. The key resolves the organization, and the brand comes from the key or from the request. No route takes a brand id in its path.
curl https://app.optimly.ai/api/v2/brand \
-H "Authorization: Bearer $OPTIMLY_KEY" \
-H "X-Optimly-Brand: $BRAND_ID"
Every brand in the organization
An sk_live_… key created under Connections, shown once. Every key is organization-scoped: one key reaches every brand, and each request names one with an X-Optimly-Brand header. The header is optional for reads when the organization has one active brand, and always required for writes. GET /api/v2/brands lists the ids it accepts. The same key works on the MCP connector, where the tool call carries the brand instead of a header.
Routes
| Method | Path | Returns |
|---|---|---|
GET |
/api/v2/brands |
Every brand in the key's org, ordered by name — the ids an `X-Optimly-Brand` selector accepts. |
POST |
/api/v2/brands |
Create a brand in the key's organization. Any key may call it; the key's owner must be a trusted user (`trust_required` otherwise). `entity_type` is `company` (default), `product_line`, `product`, or `person`; a `person` brand may not have a parent, and any other type's `parent_brand_id` must be a non-archived brand in the same organization. An exact canonical-URL match returns the existing brand with `created: false` and HTTP 200; a new brand returns 201, queues the site prefill, and starts no interview or report run. |
PATCH |
/api/v2/brand |
Change the brand's `entity_type` (`company`, `product_line`, `product`, or `person`). The key's owner must be a trusted user. A `person` brand may not keep a parent. |
GET |
/api/v2/brand |
Identity meta: name, entity type, canonical domain, slugs, and claim state. |
GET |
/api/v2/vault |
The active vault — every section with its `publish_state`, plus competitors and disambiguation. |
PUT |
/api/v2/vault |
Update and publish. Partial updates are allowed: sections you omit copy forward. Recorded with `origin_source='api'`. |
GET |
/api/v2/buyer-match/offers |
The brand's private BuyerMatch offers, `active` (default) or `archived`. Each offer is a name and a description; offers are never published on the Brand Profile. |
POST |
/api/v2/buyer-match/offers |
Add 1–200 private offers. Each is `{name, description}`; the source is recorded as `api`. A write must name the brand with `X-Optimly-Brand`; an archived brand is 404. |
PATCH |
/api/v2/buyer-match/offers/{offer_id} |
Edit an offer's `name`/`description` or set `status` to `archived`/`active`. A write must name the brand; an archived brand is 404. |
GET |
/api/v2/recommendations |
Every recommendation for the key's brand. |
PATCH |
/api/v2/recommendations/{rec_id} |
Act on a recommendation. `acted_by` stays NULL — the key acted, not a signed-in user — so the attribution overlay reads `acted_at` alone. |
GET |
/api/v2/reports |
Every report for the key's brand, newest version first. |
GET |
/api/v2/reports/{report_id} |
Report detail: the frozen summary metrics, the read-time per-model breakdown (`by_model`, keyed by model key) with the panel's models, and the run's panel snapshot. |
GET |
/api/v2/reports/{report_id}/questions |
Question Analysis: every question with its per-model answers and judgments. |
GET |
/api/v2/reports/{report_id}/sources |
Sources: per-domain citation aggregation with owned / competitor / third-party classification, broken down per provider (`by_provider`, `by_model`) so citations can be compared by model. |
GET |
/api/v2/attribution |
The attribution overlay: the aggregate metric trend across the brand's report versions, the same trend per model (`series`, one series per provider), and the acted-on recommendation timeline. |
GET |
/api/v2/vault/versions |
Version metadata for the key's brand, newest first. |
GET |
/api/v2/vault/versions/{version} |
One version snapshot: its metadata plus the full section rows. |
Conventions
Reports are read-only
Every route that returns report data is a GET. No route starts a run: measurement runs on schedules set in the application, so a report appears when the schedule produces it.
The write operations
PUT /api/v2/vault publishes a brand profile, PATCH /api/v2/recommendations/{rec_id} acts on a recommendation, PATCH /api/v2/brand changes a brand's entity type, POST /api/v2/brands creates a brand, and POST /api/v2/buyer-match/offers / PATCH /api/v2/buyer-match/offers/{offer_id} add, edit, or archive private BuyerMatch offers. Only POST /api/v2/brands does not address an existing brand. Partial vault updates are allowed — sections you omit copy forward — and writes are recorded with their origin, so an API-authored change is distinguishable from one made in the application.
Creating a brand
POST /api/v2/brands takes name and website_url, plus optional entity_type and parent_brand_id. Any key may call it; the key's owner must be a trusted user. An untrusted or ownerless credential answers 403 with code trust_required.
entity_type defaults to company and accepts company, product_line, product, or person; any other value is a 400 validation error. A person brand may not have a parent. Every other type may set parent_brand_id to an existing, non-archived brand in the same organization; a brand may not be its own parent. The parent link is living brand state, not a versioned vault section.
An exact canonical-URL match already in the organization is idempotent: the existing brand is returned with created: false and HTTP 200. A new brand returns 201 with created: true, queues the type-appropriate prefill (public-web research for a hosted person profile, a site scrape otherwise), and starts no interview or report run. Archived brands are excluded from the match, so re-adding an archived URL creates a new brand.
curl -sS -X POST 'https://app.optimly.ai/api/v2/brands' \
-H "Authorization: Bearer $OPTIMLY_KEY" \
-H 'Content-Type: application/json' \
-d '{"name": "Example Company", "website_url": "https://example.com"}'
To change an existing brand's type, send PATCH /api/v2/brand with {"entity_type": "product"} and the X-Optimly-Brand selector. The key's owner must be a trusted user. A person brand may not keep a parent — clear it through PUT /api/v2/vault first. A claimed brand's public page is rebuilt with the new section membership.
BuyerMatch offers
POST /api/v2/buyer-match/offers adds up to 200 private offers. Each offer is a name and a description covering what the buyer gets, who qualifies, and when you'd offer it. The source is recorded as api. PATCH /api/v2/buyer-match/offers/{offer_id} edits the name/description or sets status to archived or active.
Offers are private to the organization: they are not published on the Brand Profile or elsewhere in the index. When there is a match and the buyer opts in to an introduction, the details needed for the intro are shared with that buyer. Both writes require the X-Optimly-Brand selector and reject an archived brand with 404, matching the app route.
curl -sS -X POST 'https://app.optimly.ai/api/v2/buyer-match/offers' \
-H "Authorization: Bearer $OPTIMLY_KEY" \
-H "X-Optimly-Brand: $BRAND_ID" \
-H 'Content-Type: application/json' \
-d '{"offers": [{"name": "Switching credit", "description": "A $1,000 credit for teams moving from a comparable paid plan."}]}'
Rate limit
60 requests per minute per key. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (epoch seconds). A request over the limit answers 429; the body's details.retry_after says how long to wait.
Errors
Failures share one envelope with a machine-readable code, a human message, and any details the specific failure adds:
{
"error": {
"code": "trust_required",
"message": "Only trusted users can create brands through the API or MCP. Contact Optimly to request access.",
"details": { "reason": "not_trusted" }
}
}
The keyed API returns this envelope. The MCP connector surfaces the same message and details as a tool error; tool errors carry no code field.
The previous version
Anything under /api/v1 answers 410 Gone with a pointer to /api/v2.
Related
The MCP connector covers the same records for MCP clients, and is usually the shorter path for an agent. The public brand data quickstart covers the keyless read surface, which is separate from this API.