Skip to content

This page is available as Markdown at https://developers.klaviyo.com/en/v2026-07-15/reference/create_agent_knowledge_beta.md. Its OpenAPI document is at https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15.pre/openapi/beta/apis/create_agent_knowledge_beta.json. An index of every page is at https://developers.klaviyo.com/llms.txt.

KlaviyoKlaviyoDevelopers
v2026-07-15

This endpoint is in beta. Call it with the revision header 2026-07-15.pre. Beta endpoints may change before they're generally available. See our versioning and deprecation policy for more information.

You're reading the reference for API revision 2026-07-15. The latest revision is 2026-10-15. See this page in the latest revision.

Create Agent Knowledge

POSThttps://a.klaviyo.com/api/agent-knowledge

Adds 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), or a Q&A pair (source.source_type: qa, requires question and answer).

The URL is normalized before the uniqueness check; duplicate normalized URLs or duplicate Q&A questions return 409 Conflict. The resource is fetchable immediately; clients can poll its status until indexing completes. For files, use POST /agent-knowledge-files.

Revision header
revision: 2026-07-15.prerequired
Scopes
agents:write
Rate limits
Burst: 10/sSteady: 150/m

Query parameters

  • fields[agent-knowledge]#string[]

    For more information please visit API overview

    Show 16 allowed values
    • created_at
    • error
    • id
    • indexed_at
    • source
    • source.answer
    • source.auto_reindex
    • source.child_count
    • source.content
    • source.question
    • source.scope
    • source.source_type
    • source.title
    • source.url
    • status
    • updated_at

Headers

  • revision#stringrequired

    API endpoint revision (format: YYYY-MM-DD[.suffix])

    2026-07-15.pre

Request body

Content type: application/vnd.api+jsonrequired

  • data#objectrequired
    Show 2 fields
    • type#stringrequired
      Allowed values:
      • agent-knowledge
    • attributes#objectrequired
      Show 1 field
      • source#oneOfrequired

        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. To upload a file, use POST /agent-knowledge-files.

        One of:

        1. Option 1: AgentKnowledgeSnippetCreateSourceRequest
          • source_type#stringrequired

            Create a text snippet from caller-provided content.

            Allowed values:
            • snippet
          • title#stringrequired

            Human-readable title for the snippet.

          • content#stringrequired

            Text body for the snippet.

        2. Option 2: AgentKnowledgeWebpageCreateSourceRequest
          • source_type#stringrequired

            Create a webpage-backed knowledge source from a URL.

            Allowed values:
            • webpage
          • url#stringrequired

            URL to scrape and index.

          • scope#string

            Crawl scope for the webpage. single-page indexes only the given URL; entire-site crawls URLs listed in the site's root sitemap.

            Allowed values:
            • single-page
            • entire-site

            Default: single-page

            Example: single-page

          • auto_reindex#booleannullable

            Whether to periodically re-index the webpage.

        3. Option 3: AgentKnowledgeQaCreateSourceRequest
          • source_type#stringrequired

            Create a question-and-answer knowledge pair.

            Allowed values:
            • qa
          • question#stringrequired

            Question text for the Q&A pair.

          • answer#stringrequired

            Answer text for the Q&A pair.

Responses

201Success

Content type: application/vnd.api+json

  • data#objectrequired
    Show 4 fields
    • type#stringrequired
      Allowed values:
      • agent-knowledge
    • id#stringrequired

      Unique Agent Knowledge identifier.

    • attributes#objectrequired
      Show 6 fields
      • source#oneOfrequired

        Source payload for the knowledge item.

        One of:

        1. Option 1: AgentKnowledgeSnippetResponseSource
          • source_type#stringrequired

            The knowledge item was created from caller-provided content.

            Allowed values:
            • snippet
          • title#stringnullable

            Human-readable title for the snippet.

          • content#stringnullable

            Text body for the snippet.

        2. Option 2: AgentKnowledgeWebpageResponseSource
          • source_type#stringrequired

            The knowledge item was created from a webpage.

            Allowed values:
            • webpage
          • url#stringnullable

            Normalized URL for the webpage-backed knowledge item.

          • scope#stringnullable

            Crawl scope for the webpage-backed knowledge item.

            Allowed values:
            • single-page
            • entire-site
          • auto_reindex#booleannullable

            Whether the webpage is periodically re-indexed.

        3. Option 3: AgentKnowledgeFileResponseSource
          • source_type#stringrequired

            The knowledge item was created from an uploaded file.

            Allowed values:
            • file
          • title#stringnullable

            Human-readable title for the file-backed knowledge item.

        4. Option 4: AgentKnowledgeFolderResponseSource
          • source_type#stringrequired

            The knowledge item is a folder that organizes other knowledge items.

            Allowed values:
            • folder
          • title#stringnullable

            Human-readable title for the folder.

          • child_count#integernullable

            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}.

        5. Option 5: AgentKnowledgeQaResponseSource
          • source_type#stringrequired

            The knowledge item is a question-and-answer pair.

            Allowed values:
            • qa
          • question#stringnullable

            Question text for the Q&A pair.

          • answer#stringnullable

            Answer text for the Q&A pair.

      • status#stringrequired

        Indexing lifecycle state for the knowledge item.

        Allowed values:
        • pending
        • indexing
        • indexed
        • failed
        • rejected
      • created_at#string<date-time>required

        Date and time when the knowledge item was created.

        Example: 2022-11-08T00:00:00+00:00

      • updated_at#string<date-time>required

        Date and time when the knowledge item was last updated.

        Example: 2022-11-08T00:00:00+00:00

      • indexed_at#string<date-time>nullable

        Date and time when indexing completed, if available.

        Example: 2022-11-08T00:00:00+00:00

      • error#stringnullable

        Error message when indexing failed; otherwise null.

4XXClient Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string

5XXServer Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string