> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createKnowledgeArticle

> Create a Commerce Agent knowledge article. Defaults to DRAFT so it is not retrievable until you set status to ACTIVE.

**Required scopes:** [`commerce_agent_knowledge_write`](/docs/api-reference/v3/reference/scopes#scope-commerce_agent_knowledge_write)

## Arguments

<ResponseField name="input" type={<a href="/docs/api-reference/v3/reference/commerce-agent/create-knowledge-article-input">CreateKnowledgeArticleInput!</a>} required>
  The details of the article to create.

  <Expandable title="fields" lazyRender>
    <ResponseField name="content" type="String!" required>
      The article body as authored. May be empty.
    </ResponseField>

    <ResponseField name="effectiveEndAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
      When the article stops being retrievable. Omit or null for no end.
    </ResponseField>

    <ResponseField name="effectiveStartAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
      When the article becomes retrievable if status is ACTIVE. Omit or null for immediately.
    </ResponseField>

    <ResponseField name="referencedArticleIds" type="[ID!]">
      Other knowledge articles this article cites.
    </ResponseField>

    <ResponseField name="referencedProductFamilyIds" type="[ID!]">
      Product families this article cites.
    </ResponseField>

    <ResponseField name="status" type={<a href="/docs/api-reference/v3/reference/commerce-agent/knowledge-article-status">KnowledgeArticleStatus</a>}>
      Retrieval status. Defaults to DRAFT.
    </ResponseField>

    <ResponseField name="title" type="String!" required>
      The merchant-facing title of the article.
    </ResponseField>
  </Expandable>
</ResponseField>

## Returns

<ResponseField name="createKnowledgeArticle" type={<a href="/docs/api-reference/v3/reference/commerce-agent/knowledge-article">KnowledgeArticle!</a>} required>
  A Commerce Agent knowledge article the merchant authored or imported. Retrieval eligibility lives on `status` and the effective window, not on the body.

  <Expandable title="fields" lazyRender>
    <ResponseField name="content" type="String!" required>
      The article body as authored.
    </ResponseField>

    <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the article was created.
    </ResponseField>

    <ResponseField name="effectiveEndAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
      When the article stops being retrievable. Null means no end.
    </ResponseField>

    <ResponseField name="effectiveStartAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
      When the article becomes retrievable, if `status` is ACTIVE. Null means immediately.
    </ResponseField>

    <ResponseField name="id" type="ID!" required>
      The id of this knowledge article.
    </ResponseField>

    <ResponseField name="origin" type={<a href="/docs/api-reference/v3/reference/commerce-agent/knowledge-article-origin">KnowledgeArticleOrigin!</a>} required>
      How this article was created. Immutable after create.
    </ResponseField>

    <ResponseField name="productFamilies" type={<a href="/docs/api-reference/v3/pagination">ProductFamilyConnection!</a>} required>
      Product families this article cites.

      **Requires:** [`products_read`](/docs/api-reference/v3/reference/scopes#scope-products_read)

      <Expandable title="fields" lazyRender>
        **Arguments**

        <ResponseField name="after" type="String">
          Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.
        </ResponseField>

        <ResponseField name="before" type="String">
          Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.
        </ResponseField>

        <ResponseField name="first" type="Int">
          Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.
        </ResponseField>

        <ResponseField name="last" type="Int">
          Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.
        </ResponseField>

        **Fields**

        <ResponseField name="edges" type={<a href="/docs/api-reference/v3/pagination">[ProductFamilyEdge!]!</a>} required>
          The list of edges (each a node plus its pagination `cursor`).

          <Expandable title="fields" lazyRender>
            <ResponseField name="cursor" type="String!" required>
              Opaque cursor for this item; pass to `after`/`before` to page from here.
            </ResponseField>

            <ResponseField name="node" type={<a href="/docs/api-reference/v3/reference/catalog/product-family">ProductFamily!</a>} required>
              The item at this edge.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="nodes" type={<a href="/docs/api-reference/v3/reference/catalog/product-family">[ProductFamily!]!</a>} required>
          The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

          <Expandable title="fields" lazyRender>
            <ResponseField name="attribute" type={<a href="/docs/api-reference/v3/reference/catalog/attribute">Attribute</a>}>
              Look up a single attribute on this family by its name, if set.

              **Requires:** [`products_read`](/docs/api-reference/v3/reference/scopes#scope-products_read)

              <Expandable title="fields" lazyRender>
                **Arguments**

                <ResponseField name="name" type="String!" required>
                  The machine name of the attribute to look up.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="attributes" type={<a href="/docs/api-reference/v3/reference/catalog/attribute">[Attribute!]!</a>} required>
              The merchant-defined attributes set on this family.
            </ResponseField>

            <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
              When the record was created.
            </ResponseField>

            <ResponseField name="description" type="String!" required>
              The product family's long-form description.
            </ResponseField>

            <ResponseField name="id" type="ID!" required>
              The id of this product family.
            </ResponseField>

            <ResponseField name="image" type={<a href="/docs/api-reference/v3/reference/catalog/product-family-image">ProductFamilyImage</a>}>
              The first (default) image for this family, if any.

              **Requires:** [`products_read`](/docs/api-reference/v3/reference/scopes#scope-products_read)
            </ResponseField>

            <ResponseField name="images" type={<a href="/docs/api-reference/v3/pagination">ProductFamilyImageConnection!</a>} required>
              A paginated list of the family's images.

              **Requires:** [`products_read`](/docs/api-reference/v3/reference/scopes#scope-products_read)

              <Expandable title="fields" lazyRender>
                **Arguments**

                <ResponseField name="after" type="String">
                  Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.
                </ResponseField>

                <ResponseField name="before" type="String">
                  Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.
                </ResponseField>

                <ResponseField name="first" type="Int">
                  Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.
                </ResponseField>

                <ResponseField name="last" type="Int">
                  Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="options" type={<a href="/docs/api-reference/v3/reference/catalog/product-family-option">[ProductFamilyOption!]!</a>} required>
              The variant options (e.g. Size, Color) for this family.
            </ResponseField>

            <ResponseField name="products" type={<a href="/docs/api-reference/v3/pagination">ProductConnection!</a>} required>
              A paginated list of the products (variants) in this family.

              **Requires:** [`products_read`](/docs/api-reference/v3/reference/scopes#scope-products_read)

              <Expandable title="fields" lazyRender>
                **Arguments**

                <ResponseField name="after" type="String">
                  Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.
                </ResponseField>

                <ResponseField name="before" type="String">
                  Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.
                </ResponseField>

                <ResponseField name="first" type="Int">
                  Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.
                </ResponseField>

                <ResponseField name="last" type="Int">
                  Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="tags" type="[String!]!" required>
              Free-form tags applied to the product family.
            </ResponseField>

            <ResponseField name="title" type="String!" required>
              The product family's title.
            </ResponseField>

            <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
              When the record was last updated.
            </ResponseField>

            <ResponseField name="vendor" type="String">
              The vendor or manufacturer of the product family.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="pageInfo" type={<a href="/docs/api-reference/v3/pagination">PageInfo!</a>} required>
          Pagination metadata for the current page.

          <Expandable title="fields" lazyRender>
            <ResponseField name="endCursor" type="String">
              Cursor of the last edge in this page; pass to `after` to page forward.
            </ResponseField>

            <ResponseField name="hasNextPage" type="Boolean!" required>
              Whether more items exist after this page (drives forward pagination with `first`/`after`).
            </ResponseField>

            <ResponseField name="hasPreviousPage" type="Boolean!" required>
              Whether more items exist before this page (drives backward pagination with `last`/`before`).
            </ResponseField>

            <ResponseField name="startCursor" type="String">
              Cursor of the first edge in this page; pass to `before` to page backward.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="referencedArticles" type={<a href="/docs/api-reference/v3/pagination">KnowledgeArticleConnection!</a>} required>
      Other knowledge articles this article cites.

      **Requires:** [`commerce_agent_knowledge_read`](/docs/api-reference/v3/reference/scopes#scope-commerce_agent_knowledge_read)

      <Expandable title="fields" lazyRender>
        **Arguments**

        <ResponseField name="after" type="String">
          Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.
        </ResponseField>

        <ResponseField name="before" type="String">
          Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.
        </ResponseField>

        <ResponseField name="first" type="Int">
          Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.
        </ResponseField>

        <ResponseField name="last" type="Int">
          Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.
        </ResponseField>

        **Fields**

        <ResponseField name="edges" type={<a href="/docs/api-reference/v3/pagination">[KnowledgeArticleEdge!]!</a>} required>
          The list of edges (each a node plus its pagination `cursor`).

          <Expandable title="fields" lazyRender>
            <ResponseField name="cursor" type="String!" required>
              Opaque cursor for this item; pass to `after`/`before` to page from here.
            </ResponseField>

            <ResponseField name="node" type={<a href="/docs/api-reference/v3/reference/commerce-agent/knowledge-article">KnowledgeArticle!</a>} required>
              The item at this edge.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="nodes" type={<a href="/docs/api-reference/v3/reference/commerce-agent/knowledge-article">[KnowledgeArticle!]!</a>} required>
          The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.
        </ResponseField>

        <ResponseField name="pageInfo" type={<a href="/docs/api-reference/v3/pagination">PageInfo!</a>} required>
          Pagination metadata for the current page.

          <Expandable title="fields" lazyRender>
            <ResponseField name="endCursor" type="String">
              Cursor of the last edge in this page; pass to `after` to page forward.
            </ResponseField>

            <ResponseField name="hasNextPage" type="Boolean!" required>
              Whether more items exist after this page (drives forward pagination with `first`/`after`).
            </ResponseField>

            <ResponseField name="hasPreviousPage" type="Boolean!" required>
              Whether more items exist before this page (drives backward pagination with `last`/`before`).
            </ResponseField>

            <ResponseField name="startCursor" type="String">
              Cursor of the first edge in this page; pass to `before` to page backward.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="status" type={<a href="/docs/api-reference/v3/reference/commerce-agent/knowledge-article-status">KnowledgeArticleStatus!</a>} required>
      Whether Commerce Agent may retrieve this article. Combine with the effective window.
    </ResponseField>

    <ResponseField name="title" type="String!" required>
      The merchant-facing title of the article.
    </ResponseField>

    <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the article body was last edited.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```graphql theme={null}
mutation {
  createKnowledgeArticle(input: { ... }) {
    content
    createdAt
    effectiveEndAt
    effectiveStartAt
    id
    origin
    productFamilies {
      nodes {
        createdAt
        description
        id
        tags
        title
        updatedAt
        vendor
      }
      pageInfo { hasNextPage endCursor }
    }
    referencedArticles {
      nodes {
        content
        createdAt
        effectiveEndAt
        effectiveStartAt
        id
        origin
        status
        title
        # ...
      }
      pageInfo { hasNextPage endCursor }
    }
    # ...
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.