{
"openapi": "3.0.2",
"info": {
"title": "Klaviyo API (Beta)",
"version": "2026-10-15.pre",
"description": "The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.",
"contact": {
"name": "Klaviyo Developer Experience Team",
"email": "developers@klaviyo.com",
"url": "https://developers.klaviyo.com"
},
"termsOfService": "https://www.klaviyo.com/legal/api-terms",
"license": {
"name": "License",
"url": "https://www.klaviyo.com/legal"
}
},
"servers": [
{
"url": "https://a.klaviyo.com",
"description": "Production"
}
],
"security": [
{
"Klaviyo-API-Key": []
}
],
"paths": {
"/api/agent-knowledge": {
"post": {
"operationId": "create_agent_knowledge_beta",
"summary": "Create Agent Knowledge",
"description": "\n > \ud83d\udea7 This endpoint is in beta and subject to change.\n >\n > A beta revision header (2026-10-15.pre) is required to use our beta APIs. Klaviyo APIs in beta are not intended for use in production. See our [versioning and deprecation policy](https://developers.klaviyo.com/en/docs/api_versioning_and_deprecation_policy) for more information.\n\nAdds an Agent Knowledge item from a text snippet (``source.source_type: snippet``, requires ``title`` and ``content``), a single URL (``source.source_type: webpage``, requires ``url``), a Q&A pair (``source.source_type: qa``, requires ``question`` and ``answer``), or a folder (``source.source_type: folder``, requires ``title``). Set ``parent_id`` to create the item inside a folder.\n\nTitles are unique across every knowledge type; a webpage's title is its normalized URL and a Q&A item's title is its question. Returns ``409 Conflict`` if the title is already in use, if an ``entire-site`` webpage overlaps an existing one, or if the company has reached its knowledge item limit. The resource is fetchable immediately; clients can poll its ``status`` until indexing completes. For files, use ``POST /agent-knowledge-files``.
*Rate limits*:
Burst: `10/s`
Steady: `150/m`\n\n**Scopes:**\n`agents:write`\n\n[OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/beta/apis/create_agent_knowledge_beta.json)",
"parameters": [
{
"name": "fields[agent-knowledge]",
"in": "query",
"description": "For more information please visit https://developers.klaviyo.com/en/v2026-10-15.pre/reference/api-overview#sparse-fieldsets",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"countries",
"created_at",
"error",
"id",
"indexed_at",
"source",
"source.answer",
"source.auto_reindex",
"source.child_count",
"source.content",
"source.exclude_prefixes",
"source.indexed_child_count",
"source.pending_child_count",
"source.question",
"source.scope",
"source.source_type",
"source.title",
"source.url",
"status",
"updated_at"
]
}
},
"explode": false
},
{
"name": "revision",
"in": "header",
"description": "API endpoint revision (format: YYYY-MM-DD[.suffix])",
"required": true,
"schema": {
"type": "string",
"default": "2026-10-15.pre"
}
}
],
"requestBody": {
"description": "Request to create snippet-, webpage-, Q&A-, or folder-backed Agent Knowledge.",
"required": true,
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/AgentKnowledgeCreateRequestRequestDataWrapper"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/AgentKnowledgeResponseDataWrapper"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/ClientError"
},
"5XX": {
"$ref": "#/components/responses/ServerError"
}
},
"tags": [
"Beta APIs"
],
"x-klaviyo-beta-revision": "2026-10-15.pre",
"x-klaviyo-beta-subtag": "Knowledge and Skills",
"x-klaviyo-pre-release": "BETA",
"x-klaviyo-ratelimit": {
"burst": "10/s",
"steady": "150/m"
},
"x-klaviyo-scopes": [
"agents:write"
],
"x-klaviyo-subtag": "Customer Agent"
}
}
},
"components": {
"responses": {
"ClientError": {
"description": "Client Error",
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"code",
"title",
"detail"
],
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"title": {
"type": "string"
},
"detail": {
"type": "string"
},
"source": {
"type": "object",
"properties": {
"pointer": {
"type": "string"
},
"parameter": {
"type": "string"
}
}
}
}
}
}
},
"required": [
"errors"
]
}
}
}
},
"ServerError": {
"description": "Server Error",
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"code",
"title",
"detail"
],
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"title": {
"type": "string"
},
"detail": {
"type": "string"
},
"source": {
"type": "object",
"properties": {
"pointer": {
"type": "string"
},
"parameter": {
"type": "string"
}
}
}
}
}
}
},
"required": [
"errors"
]
}
}
}
}
},
"schemas": {
"AgentKnowledgeCreateRequestRequest": {
"type": "object",
"properties": {
"source": {
"description": "Source payload for the new item. `snippet` requires `title` and `content`; `webpage` requires `url` and does not accept caller-provided content; `qa` requires `question` and `answer`; `folder` requires `title`. To upload a file, use `POST /agent-knowledge-files`.",
"oneOf": [
{
"$ref": "#/components/schemas/AgentKnowledgeSnippetCreateSourceRequest"
},
{
"$ref": "#/components/schemas/AgentKnowledgeWebpageCreateSourceRequest"
},
{
"$ref": "#/components/schemas/AgentKnowledgeQaCreateSourceRequest"
},
{
"$ref": "#/components/schemas/AgentKnowledgeFolderCreateSourceRequest"
}
]
},
"parent_id": {
"description": "Folder to create the item in. Omit to create it at the top level.",
"type": "string",
"nullable": true
}
},
"required": [
"source"
]
},
"AgentKnowledgeCreateRequestRequestData": {
"type": "object",
"properties": {
"type": {
"$ref": "#/components/schemas/AgentKnowledgeResourceName"
},
"attributes": {
"$ref": "#/components/schemas/AgentKnowledgeCreateRequestRequest"
}
},
"required": [
"type",
"attributes"
]
},
"AgentKnowledgeCreateRequestRequestDataWrapper": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AgentKnowledgeCreateRequestRequestData"
}
},
"required": [
"data"
]
},
"AgentKnowledgeFileResponseSource": {
"type": "object",
"properties": {
"source_type": {
"description": "The knowledge item was created from an uploaded file.",
"allOf": [
{
"$ref": "#/components/schemas/FileEnum"
}
]
},
"title": {
"description": "Human-readable title for the file-backed knowledge item.",
"type": "string",
"nullable": true
}
},
"required": [
"source_type"
]
},
"AgentKnowledgeFolderCreateSourceRequest": {
"type": "object",
"properties": {
"source_type": {
"description": "Create a folder to organize other knowledge items.",
"allOf": [
{
"$ref": "#/components/schemas/FolderEnum"
}
]
},
"title": {
"description": "Human-readable title for the folder.",
"type": "string"
}
},
"required": [
"source_type",
"title"
]
},
"AgentKnowledgeFolderResponseSource": {
"type": "object",
"properties": {
"source_type": {
"description": "The knowledge item is a folder that organizes other knowledge items.",
"allOf": [
{
"$ref": "#/components/schemas/FolderEnum"
}
]
},
"title": {
"description": "Human-readable title for the folder.",
"type": "string",
"nullable": true
},
"child_count": {
"description": "Number of knowledge items nested under this folder at any depth (nested folders don't count themselves, only their contents do). Only populated when listed via GET /agent-knowledge; null when fetched by id via GET /agent-knowledge/{id}.",
"type": "integer",
"nullable": true
}
},
"required": [
"source_type"
]
},
"AgentKnowledgeQaCreateSourceRequest": {
"type": "object",
"properties": {
"source_type": {
"description": "Create a question-and-answer knowledge pair.",
"allOf": [
{
"$ref": "#/components/schemas/QaEnum"
}
]
},
"question": {
"description": "Question text for the Q&A pair.",
"type": "string"
},
"answer": {
"description": "Answer text for the Q&A pair.",
"type": "string"
}
},
"required": [
"source_type",
"question",
"answer"
]
},
"AgentKnowledgeQaResponseSource": {
"type": "object",
"properties": {
"source_type": {
"description": "The knowledge item is a question-and-answer pair.",
"allOf": [
{
"$ref": "#/components/schemas/QaEnum"
}
]
},
"question": {
"description": "Question text for the Q&A pair.",
"type": "string",
"nullable": true
},
"answer": {
"description": "Answer text for the Q&A pair.",
"type": "string",
"nullable": true
}
},
"required": [
"source_type"
]
},
"AgentKnowledgeResourceName": {
"type": "string",
"enum": [
"agent-knowledge"
]
},
"AgentKnowledgeResponse": {
"type": "object",
"properties": {
"source": {
"description": "Source payload for the knowledge item.",
"oneOf": [
{
"$ref": "#/components/schemas/AgentKnowledgeSnippetResponseSource"
},
{
"$ref": "#/components/schemas/AgentKnowledgeWebpageResponseSource"
},
{
"$ref": "#/components/schemas/AgentKnowledgeFileResponseSource"
},
{
"$ref": "#/components/schemas/AgentKnowledgeFolderResponseSource"
},
{
"$ref": "#/components/schemas/AgentKnowledgeQaResponseSource"
}
]
},
"status": {
"description": "Indexing lifecycle state for the knowledge item.",
"type": "string",
"enum": [
"pending",
"indexing",
"indexed",
"failed",
"rejected"
]
},
"created_at": {
"description": "Date and time when the knowledge item was created.",
"type": "string",
"format": "date-time",
"example": "2022-11-08T00:00:00+00:00"
},
"updated_at": {
"description": "Date and time when the knowledge item was last updated.",
"type": "string",
"format": "date-time",
"example": "2022-11-08T00:00:00+00:00"
},
"indexed_at": {
"description": "Date and time when indexing completed, if available.",
"type": "string",
"format": "date-time",
"example": "2022-11-08T00:00:00+00:00",
"nullable": true
},
"error": {
"description": "Error message when indexing failed; otherwise null.",
"type": "string",
"nullable": true
},
"countries": {
"description": "ISO 3166-1 alpha-2 codes of the countries the knowledge item is available in. Null means it is available in every country.",
"type": "array",
"items": {
"type": "string"
},
"nullable": true
}
},
"required": [
"source",
"status",
"created_at",
"updated_at"
]
},
"AgentKnowledgeResponseData": {
"type": "object",
"properties": {
"type": {
"$ref": "#/components/schemas/AgentKnowledgeResourceName"
},
"id": {
"description": "Unique Agent Knowledge identifier.",
"type": "string"
},
"attributes": {
"$ref": "#/components/schemas/AgentKnowledgeResponse"
},
"links": {
"$ref": "#/components/schemas/ObjectLinks"
}
},
"required": [
"type",
"id",
"attributes",
"links"
]
},
"AgentKnowledgeResponseDataWrapper": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AgentKnowledgeResponseData"
},
"links": {
"$ref": "#/components/schemas/ObjectLinks"
}
},
"required": [
"data"
]
},
"AgentKnowledgeSnippetCreateSourceRequest": {
"type": "object",
"properties": {
"source_type": {
"description": "Create a text snippet from caller-provided content.",
"allOf": [
{
"$ref": "#/components/schemas/SnippetEnum"
}
]
},
"title": {
"description": "Human-readable title for the snippet.",
"type": "string"
},
"content": {
"description": "Text body for the snippet.",
"type": "string"
}
},
"required": [
"source_type",
"title",
"content"
]
},
"AgentKnowledgeSnippetResponseSource": {
"type": "object",
"properties": {
"source_type": {
"description": "The knowledge item was created from caller-provided content.",
"allOf": [
{
"$ref": "#/components/schemas/SnippetEnum"
}
]
},
"title": {
"description": "Human-readable title for the snippet.",
"type": "string",
"nullable": true
},
"content": {
"description": "Text body for the snippet.",
"nullable": true,
"type": "string"
}
},
"required": [
"source_type"
]
},
"AgentKnowledgeWebpageCreateSourceRequest": {
"type": "object",
"properties": {
"source_type": {
"description": "Create a webpage-backed knowledge source from a URL.",
"allOf": [
{
"$ref": "#/components/schemas/WebpageEnum"
}
]
},
"url": {
"description": "URL to scrape and index.",
"type": "string"
},
"scope": {
"description": "Crawl scope for the webpage. `single-page` indexes only the given URL; `entire-site` crawls URLs listed in the site's root sitemap; `selected-pages` crawls those URLs across every English locale, except those under `exclude_prefixes`.",
"type": "string",
"example": "single-page",
"default": "single-page",
"enum": [
"single-page",
"entire-site",
"selected-pages"
]
},
"auto_reindex": {
"description": "Whether to periodically re-index the webpage.",
"type": "boolean",
"nullable": true
},
"exclude_prefixes": {
"description": "URL paths to skip when crawling, each starting with `/`, such as `/blog/archive`. Up to 500 paths of up to 2048 characters each. Only accepted with `selected-pages` scope.",
"type": "array",
"items": {
"type": "string"
},
"nullable": true
}
},
"required": [
"source_type",
"url"
]
},
"AgentKnowledgeWebpageResponseSource": {
"type": "object",
"properties": {
"source_type": {
"description": "The knowledge item was created from a webpage.",
"allOf": [
{
"$ref": "#/components/schemas/WebpageEnum"
}
]
},
"url": {
"description": "Normalized URL for the webpage-backed knowledge item.",
"type": "string",
"nullable": true
},
"title": {
"description": "Page title from the webpage's HTML, once crawled; otherwise null.",
"type": "string",
"nullable": true
},
"scope": {
"description": "Crawl scope for the webpage-backed knowledge item.",
"type": "string",
"enum": [
"single-page",
"entire-site",
"selected-pages"
],
"nullable": true
},
"auto_reindex": {
"description": "Whether the webpage is periodically re-indexed.",
"type": "boolean",
"nullable": true
},
"exclude_prefixes": {
"description": "URL paths skipped when crawling a `selected-pages` webpage. Values are normalized and may include paths Customer Agent excludes automatically.",
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"child_count": {
"description": "Total number of pages discovered beneath this webpage, at any depth, in every indexing state. Use it with `indexed_child_count` and `pending_child_count` to track the progress of a site crawl, which can take hours. Only populated when listed via GET /agent-knowledge; null when fetched by id via GET /agent-knowledge/{id}, and null for every non-webpage source. `0` is not null: it means a webpage with no pages beneath it yet.",
"type": "integer",
"nullable": true
},
"indexed_child_count": {
"description": "Number of those pages that have finished indexing. Null under the same conditions as `child_count`. This and `pending_child_count` do not necessarily add up to `child_count`, which also counts pages that failed or were rejected.",
"type": "integer",
"nullable": true
},
"pending_child_count": {
"description": "Number of those pages still waiting to be indexed. Null under the same conditions as `child_count`. Pages that failed or were rejected are not counted here, so this is not `child_count` minus `indexed_child_count`.",
"type": "integer",
"nullable": true
}
},
"required": [
"source_type"
]
},
"FileEnum": {
"type": "string",
"enum": [
"file"
]
},
"FolderEnum": {
"type": "string",
"enum": [
"folder"
]
},
"ObjectLinks": {
"type": "object",
"properties": {
"self": {
"type": "string",
"format": "uri"
}
},
"required": [
"self"
]
},
"QaEnum": {
"type": "string",
"enum": [
"qa"
]
},
"SnippetEnum": {
"type": "string",
"enum": [
"snippet"
]
},
"WebpageEnum": {
"type": "string",
"enum": [
"webpage"
]
}
},
"securitySchemes": {
"Klaviyo-API-Key": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "Private key authentication for /api/ endpoints is performed by setting the `Authorization` header to `Klaviyo-API-Key your-private-api-key`
For more information please visit https://developers.klaviyo.com/en/v2026-10-15.pre/reference/api-overview#authentication",
"x-default": "Klaviyo-API-Key your-private-api-key"
}
}
},
"tags": [
{
"name": "Beta APIs",
"description": "beta apis"
}
]
}