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

# createKnowledgeGapSignal

> Record a knowledge gap signal on a thread: a sign that your knowledge base did not have the
answer to what a customer asked. Use it when your own AI agent hands a thread over to your team
or when your team reviews threads. Plain checks whether the signal points at a real gap and
groups it with similar signals. A gap that is hit twice becomes a task.

The signal is tied to the latest message in the thread, so calling this again before a new
message arrives returns the existing signal instead of creating a second one. Optionally pass
what your agent searched for and which help center articles or indexed documents it found.

Knowledge gaps and Plain AI must be enabled for the workspace. Requires the
`knowledgeGapSignal:create` and `knowledgeGapSignal:read` permissions, plus read access to
the thread, its timeline and any referenced documents. Without `knowledgeGapSignal:read`, a
repeat call that would return an existing signal fails.



**mutation** `createKnowledgeGapSignal(input: CreateKnowledgeGapSignalInput!): CreateKnowledgeGapSignalOutput!`

## Arguments

**`input`**: `CreateKnowledgeGapSignalInput!` (required)

## Returns

`CreateKnowledgeGapSignalOutput!`

**`knowledgeGapSignal`**: `ApiKnowledgeGapSignal`

---

**`error`**: `MutationError`

## Examples

```graphql Mutation
mutation CreateKnowledgeGapSignal($input: CreateKnowledgeGapSignalInput!) {
  createKnowledgeGapSignal(input: $input) {
    knowledgeGapSignal {
      id
      type
      threadId
      searchQueries
      referencedDocuments {
        helpCenterArticleId
        indexedDocumentId
      }
      createdAt {
        unixTimestamp
        iso8601
      }
    }
    error {
      message
      type
      code
      fields {
        field
        message
        type
      }
    }
  }
}
```

```json Variables
{
  "input": {
    "threadId": "id"
  }
}
```

```json Response
{
  "data": {
    "createKnowledgeGapSignal": {
      "knowledgeGapSignal": {
        "id": "id",
        "type": "ARI",
        "threadId": "id",
        "searchQueries": [
          "string"
        ],
        "referencedDocuments": [
          {
            "helpCenterArticleId": "id",
            "indexedDocumentId": "id"
          }
        ],
        "createdAt": {
          "unixTimestamp": "string",
          "iso8601": "string"
        }
      },
      "error": {
        "message": "string",
        "type": "VALIDATION",
        "code": "string",
        "fields": [
          {
            "field": "string",
            "message": "string",
            "type": "VALIDATION"
          }
        ]
      }
    }
  }
}
```


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