List a site's instruction library
Returns the site's own instructions and the iAdvize catalog entries in one list, as the dashboard's Instructions page shows them, told apart by `source`. Site rows come first and catalog rows after, in catalog order, whatever the sort. A site instruction counts as used by an agent only when the agent's live version selects it. `usage` and `agentId` keep site instructions only; `vertical` keeps catalog entries only (those tagged with that vertical, or with none). An `agentId` whose agent uses no instruction matches no row. Filters combine with AND. `meta.matching` counts the rows that match, across pages. `limit` is 1 to 100 (25 by default) and pages the site instructions: the matching catalog entries follow them on the last page, so that page can hold up to three rows more than `limit`. With `source=iadvize` or a `vertical`, the response is one page of catalog entries. A cursor is bound to the filters, the search and the sort it was issued for. Catalog names and descriptions are in the site's default language when it is English, French or German, in English otherwise.
ApiKeyAuthAuthorizationBearer <token>A WorkOS org-scoped API key, created from the dashboard's organization settings page. Identifies the tenant every read and write is scoped to. Missing, malformed, unknown, revoked, expired, or non-organization-owned keys all return 401 (no distinction, so the response can't be used to probe which keys or org ids exist).
siteId*stringThe site id (prefixed site_). A site id that isn't yours is a 404, same as any other cross-tenant id.
source?stringiadvize for the catalog entries, site for the site's own instructions.
"iadvize""site"type?stringOnly rows of this type.
"always""conditional"usage?stringOnly the site instructions with this usage: unused, dedicated (one agent) or shared (two or more). Leaves out every catalog entry.
"unused""dedicated""shared"agentId?stringOnly the site instructions this agent's live version uses. Leaves out every catalog entry.
vertical?stringOnly the catalog entries written for this vertical or for every vertical. Leaves out every site instruction.
"retail""health_beauty""electronics""food_beverage""home_garden""fashion_apparel""travel_hospitality""other"search?stringRows whose name or description contains this text, case-insensitively. At most 200 characters.
length <= 200sort?stringupdated (when the latest revision was written, the default), revisions (revision count) or type. Catalog entries come after every site instruction, in catalog order, whatever the sort and the order.
"updated""type""revisions""updated"order?stringdesc (the default) or asc, for the sort.
"desc""asc""desc"cursor?stringThe meta.nextCursor of the previous page, with the same filters, search and sort.
length <= 1024limit?integerThe page size, 1 to 100.
1 <= value <= 10025One page of the library. meta.nextCursor is null on the last page.
application/json- response
A page of the site's instruction library.
data*array<|>meta*curl -X GET 'https://example.com/api/v1/sites/string/instructions'{ "data": [ { "source": "site", "id": "instr_01kvnwmagvf27rc9cze5rm9e1r", "name": "Returns policy", "description": "When shoppers ask about returns", "type": "conditional", "revisionCount": 3, "updatedAt": "2026-11-18T10:42:00.000Z", "usage": "dedicated", "agents": [ { "id": "agt_01kvnwmagvf27rc9cze5rm9e1r", "name": "Sales agent" } ], "startedFrom": null }, { "source": "iadvize", "key": "cross_sell", "name": "Cross-sell", "description": "After a product is chosen, suggests one complementary product from your catalog, once.", "type": "always", "version": 1, "verticals": [], "addedInstructionId": "instr_01kw2c9b7rf3m8t4x6y0z1a2b3" }, { "source": "iadvize", "key": "gift_finding", "name": "Gift finding", "description": "When a shopper buys for someone else, asks who it is for, then suggests two or three products.", "type": "always", "version": 1, "verticals": [], "addedInstructionId": null } ], "meta": { "nextCursor": null, "matching": 3 }}Rename a version
Names a version of the agent, as Rename does in the dashboard. A name is a label, not configuration: no saved state changes, and a locked version (one that has been live or is part of an A/B test) can be renamed too. `null` or an empty name clears it, so the version reads as `V` followed by its number again. The version is the `lineId` of its saved states.
Get one instruction with its text
Returns one entry of the site's instruction library with its full text. `ref` is either a site instruction id, which returns the text and condition of its latest revision, or a catalog key (`cross_sell`, `key_sales_period`, `gift_finding`), which returns the entry's text in the site's default language when it is English, French or German, in English otherwise. An instruction of another site or organization, a deleted one, or any other value answers `404`.