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

# knowledgeSuggestionAccept

> Add a pending knowledge suggestion as a knowledge article, as the Suggestions tab's Add does: the article is live at once (ACTIVE unless you pass a status) and not staged. The suggestion keeps its own text. Returns null when the store has no pending suggestion with this id, including one already added or dismissed; after a retried call, `knowledgeSuggestion(id).acceptedArticle` is the article the first call added. BAD_USER_INPUT when the suggestion needs an answer and `content` doesn't give one. 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

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

The suggestion's `id`.

**input** `[KnowledgeSuggestionAcceptInput](/docs/api-reference/v3/reference/commerce-agent/knowledge-suggestion-accept-input)`

**fields**

**content** `String`

The article's body. Required when the suggestion's `needsMerchantAnswer` is true: the answer, not the question.

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

When the article stops being retrievable. Omit or null for no end.

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

When the article becomes retrievable if status is ACTIVE. Omit or null for immediately.

**referencedArticleIds** `[ID!]`

Other knowledge articles this article cites.

**referencedProductFamilyIds** `[ID!]`

Product families this article cites.

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

The article's status. Defaults to ACTIVE.

**title** `String`

The article's title.

## Returns

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

A Commerce Agent knowledge article the merchant authored or imported. The top-level fields are the live article that Commerce Agent uses; changes staged through the API wait in `draft` until `knowledgeArticlePublish` makes them live. Retrieval eligibility lives on `status` and the effective window, not on the body.

**fields**

**changes** `[KnowledgeArticleChangeConnection!](/docs/api-reference/v3/pagination)` *required*

Every change to this article and who made it, newest first, including staged drafts and removals.

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

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns changes after it.

**before** `String`

Backward pagination cursor — returns changes before it.

**first** `Int`

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

**last** `Int`

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

**Fields**

**edges** `[\[KnowledgeArticleChangeEdge!\]!](/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** `[KnowledgeArticleChange!](/docs/api-reference/v3/reference/commerce-agent/knowledge-article-change)` *required*

The item at this edge.

**nodes** `[\[KnowledgeArticleChange!\]!](/docs/api-reference/v3/reference/commerce-agent/knowledge-article-change)` *required*

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

**fields**

**action** `[KnowledgeArticleChangeAction!](/docs/api-reference/v3/reference/commerce-agent/knowledge-article-change-action)` *required*

What the change did.

**actor** `[CommerceAgentChangeActor!](/docs/api-reference/v3/reference/commerce-agent/commerce-agent-change-actor)` *required*

Who made the change.

**apiKey** `[ServiceUserApiKey](/docs/api-reference/v3/reference/service-users/service-user-api-key)`

The API key an API caller signed in with. Null for people, for other kinds of credential, and once the key is deleted.

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

**contentAfter** `String`

The content after the change.

**contentBefore** `String`

The content before the change.

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

When the change was made.

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

The schedule end after the change.

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

The schedule end before the change.

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

The schedule start after the change.

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

The schedule start before the change.

**serviceUser** `[ServiceUser](/docs/api-reference/v3/reference/service-users/service-user)`

The service account an API caller signed in as. Null for people, and for changes recorded before it was tracked.

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

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

The status after the change.

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

The status before the change.

**teamMember** `[TeamMember](/docs/api-reference/v3/reference/common/team-member)`

The team member behind the change. Null for Redo staff, for an API key with no user, or when the user no longer exists.

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

**titleAfter** `String`

The title after the change.

**titleBefore** `String`

The title before the change.

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

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

The live article body as authored.

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

When the article was created.

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

Changes staged by the API and not yet published. Null when nothing is staged. Reading it needs a token with `commerce_agent_knowledge_read`.

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

**fields**

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

The body the article gets on publish.

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

When the draft was first staged.

**deletesArticle** `Boolean!` *required*

True when publishing removes the article. The other fields then repeat the article as it was when the removal was staged.

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

When the article stops being retrievable after publish. Null means no end.

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

When the article becomes retrievable after publish, if `status` is ACTIVE. Null means immediately.

**referencedArticleIds** `[ID!]!` *required*

The ids of the knowledge articles the article cites after publish, as accepted by `referencedArticleIds` on the write inputs.

**referencedProductFamilyIds** `[ID!]!` *required*

The ids of the product families the article cites after publish, as accepted by `referencedProductFamilyIds` on the write inputs.

**revision** `String!` *required*

Identifies this draft's content. Pass it as `expectedRevision` to `knowledgeArticlePublish`; it changes whenever the draft does.

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

The status the article gets on publish.

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

The title the article gets on publish.

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

When the draft was last changed.

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

When the live article stops being retrievable. Null means no end.

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

When the live article becomes retrievable, if `status` is ACTIVE. Null means immediately.

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

The id of this knowledge article.

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

How this article was created. Immutable after create.

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

Product families this article cites.

**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`.

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

**referencedArticles** `[KnowledgeArticleConnection!](/docs/api-reference/v3/pagination)` *required*

Other knowledge articles this article cites.

**Requires:** [`commerce_agent_knowledge_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-commerce_agent_knowledge_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`.

**Fields**

**edges** `[\[KnowledgeArticleEdge!\]!](/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** `[KnowledgeArticle!](/docs/api-reference/v3/reference/commerce-agent/knowledge-article)` *required*

The item at this edge.

**nodes** `[\[KnowledgeArticle!\]!](/docs/api-reference/v3/reference/commerce-agent/knowledge-article)` *required*

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

**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 may retrieve this live article. Combine with the effective window.

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

The live merchant-facing title of the article.

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

When the live article body was last edited.

**usageCount** `Int!` *required*

How many messages Commerce Agent used this article in. Unsent draft replies don't count. This is the number the merchant app's Knowledge page shows as Uses.

**whenToUse** `String!` *required*

The text Commerce Agent matches a shopper's question against to pick this article. It is generated from the live title and content, so it is read-only. A new article starts with its title. After an edit, the previous text stays until it is regenerated.

## 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_KNOWLEDGE_ID` | `400` | An id isn't a kind of knowledge entry the argument takes, such as a product knowledge id where an article or help center link id goes. The message names it. Nothing was written. | Pass ids of the kind the argument's description names. |
| `INVALID_PRODUCT_FAMILY_ID` | `400` | A product family id is malformed. The message names it. Nothing was written. | Pass a product family's `id`. |
| `INVALID_TITLE` | `400` | A knowledge article's title is blank. Nothing was written. | Send a title with at least one character that isn't a space. |
| `INVALID_SCHEDULE` | `400` | A knowledge entry's effectiveStartAt isn't before its effectiveEndAt. Nothing was written. | Send a start before the end, or leave one of them open. |
| `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 {
  knowledgeSuggestionAccept(id: "...", input: { ... }) {
    changes {
      nodes {
        action
        actor
        contentAfter
        contentBefore
        createdAt
        effectiveEndAtAfter
        effectiveEndAtBefore
        effectiveStartAtAfter
        # ...
      }
      pageInfo { hasNextPage endCursor }
    }
    content
    createdAt
    effectiveEndAt
    effectiveStartAt
    id
    origin
    productFamilies {
      nodes {
        createdAt
        description
        id
        tags
        title
        updatedAt
        vendor
      }
      pageInfo { hasNextPage endCursor }
    }
    # ...
  }
}
```


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