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

# productKnowledgeEntryCreate

> Add product knowledge, as the Products tab does. There is no staging for product knowledge. It goes live at once, so it needs `commerce_agent_knowledge_publish`; `commerce_agent_knowledge_write` alone is refused with INSUFFICIENT_SCOPE.

**Required scopes:** [`commerce_agent_knowledge_publish`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-commerce_agent_knowledge_publish)

## Arguments

**input** `[ProductKnowledgeEntryInput!](/docs/api-reference/v3/reference/commerce-agent/product-knowledge-entry-input)` *required*

**fields**

**content** `String!` *required*

What Commerce Agent should know about the products: not blank, at most 10,000 characters, else BAD\_USER\_INPUT. An update of an entry saved longer before this cap may keep its length but not grow it. Commerce Agent reads it whenever it looks up a linked product.

**productFamilyIds** `[ID!]!` *required*

The products it's about, 1 to 100 distinct ones; a repeated id counts once. An update of an entry saved with more before this cap may keep that many but not add more. A malformed id fails with INVALID\_PRODUCT\_FAMILY\_ID. Another store's or a deleted product is dropped; when none is left, the call fails with BAD\_USER\_INPUT.

**status** `[KnowledgeArticleStatus](/docs/api-reference/v3/reference/commerce-agent/knowledge-article-status)`

Whether Commerce Agent uses it. A new entry defaults to DRAFT; an update keeps its status when omitted.

## Returns

**productKnowledgeEntryCreate** `[ProductKnowledgeEntry!](/docs/api-reference/v3/reference/commerce-agent/product-knowledge-entry)` *required*

Knowledge the merchant wrote for one or more products, from the Knowledge page's Products tab. Commerce Agent reads it when it looks up a linked product and never searches it on its own; merchants can search it by product title (`productKnowledgeEntriesSearch`).

**fields**

**content** `String!` *required*

The entry's text as authored.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the entry was created.

**id** `ID!` *required*

The id of this product knowledge entry.

**productFamilies** `[ProductFamilyConnection!](/docs/api-reference/v3/pagination)` *required*

The products this entry is linked to, by title, as the Products tab lists them. Deleted products are left out.

**Requires:** [`products_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-products_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns products after it.

**before** `String`

Backward pagination cursor — returns products before it.

**first** `Int`

Forward pagination: returns the first N products (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N products (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**Fields**

**edges** `[\[ProductFamilyEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**fields**

**cursor** `String!` *required*

Opaque cursor for this item; pass to `after`/`before` to page from here.

**node** `[ProductFamily!](/docs/api-reference/v3/reference/catalog/product-family)` *required*

The item at this edge.

**nodes** `[\[ProductFamily!\]!](/docs/api-reference/v3/reference/catalog/product-family)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**fields**

**attribute** `[Attribute](/docs/api-reference/v3/reference/catalog/attribute)`

Look up a single attribute on this family by its name, if set.

**Requires:** [`products_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-products_read)

**fields**

**Arguments**

**name** `String!` *required*

The machine name of the attribute to look up.

**attributes** `[\[Attribute!\]!](/docs/api-reference/v3/reference/catalog/attribute)` *required*

The merchant-defined attributes set on this family.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the record was created.

**description** `String!` *required*

The product family's long-form description.

**id** `ID!` *required*

The id of this product family.

**image** `[ProductFamilyImage](/docs/api-reference/v3/reference/catalog/product-family-image)`

The first (default) image for this family, if any.

**Requires:** [`products_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-products_read)

**images** `[ProductFamilyImageConnection!](/docs/api-reference/v3/pagination)` *required*

A paginated list of the family's images.

**Requires:** [`products_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-products_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.

**before** `String`

Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.

**first** `Int`

Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**options** `[\[ProductFamilyOption!\]!](/docs/api-reference/v3/reference/catalog/product-family-option)` *required*

The variant options (e.g. Size, Color) for this family.

**products** `[ProductConnection!](/docs/api-reference/v3/pagination)` *required*

A paginated list of the products (variants) in this family.

**Requires:** [`products_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-products_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.

**before** `String`

Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.

**first** `Int`

Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**tags** `[String!]!` *required*

Free-form tags applied to the product family.

**title** `String!` *required*

The product family's title.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the record was last updated.

**vendor** `String`

The vendor or manufacturer of the product family.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**fields**

**endCursor** `String`

Cursor of the last edge in this page; pass to `after` to page forward.

**hasNextPage** `Boolean!` *required*

Whether more items exist after this page (drives forward pagination with `first`/`after`).

**hasPreviousPage** `Boolean!` *required*

Whether more items exist before this page (drives backward pagination with `last`/`before`).

**startCursor** `String`

Cursor of the first edge in this page; pass to `before` to page backward.

**status** `[KnowledgeArticleStatus!](/docs/api-reference/v3/reference/commerce-agent/knowledge-article-status)` *required*

Whether Commerce Agent uses this entry. It answers shoppers with ACTIVE entries only; its knowledge preview also reads DRAFT ones.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the entry was last changed.

## Errors

Besides the [errors any request can return](https://developers.redo.com/docs/api-reference/v3/errors.md), this operation fails with these codes in `extensions.code`.

| Code | HTTP status | Meaning | Retry |
| - | - | - | - |
| `BAD_USER_INPUT` | `400` | An argument is invalid, or names something the store doesn't have. The message says which. Nothing was written. | Fix the input the message names, then send it again. |
| `INVALID_PRODUCT_FAMILY_ID` | `400` | A product family id is malformed. The message names it. Nothing was written. | Pass a product family's `id`. |
| `INTERNAL_SERVER_ERROR` | `500` | Something failed on Redo's side. The change may or may not have been made. | Read the record to see whether the change was made before sending it again. A send with an idempotencyKey is safe to retry with the same key. |

## Example

```graphql theme={null}
mutation {
  productKnowledgeEntryCreate(input: { ... }) {
    content
    createdAt
    id
    productFamilies {
      nodes {
        createdAt
        description
        id
        tags
        title
        updatedAt
        vendor
      }
      pageInfo { hasNextPage endCursor }
    }
    status
    updatedAt
  }
}
```


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