# FormInsightRead

> Insight facts, answers and reasons mined from form responses, with filters. Read access, forms toolset, MCP tool get_form_insight_read.

**Access:** [Read](https://developer.missin.co.uk/get-started/authentication.md#access-levels)

## Variables

| Variable | Type | Required | Accepts | Description |
|---|---|---|---|---|
| `answers` | `InsightAnswerFilter!` | yes | Input object, below |  |
| `facts` | `InsightFactFilter!` | yes | Input object, below |  |
| `reasons` | `FormResponseAnswerReasonFilter!` | yes | Input object, below |  |

## Input types

A filter lists its fields by the type they take, and none of them is required.

### InsightAnswerFilter

- `[InsightAnswerFilter!]`: `and`, `or`
- [UUIDFilter](https://developer.missin.co.uk/reference/input-types.md#uuidfilter): `answerId`, `customerId`, `formId`, `responseId`, `who`, `workspaceId`
- [DatetimeFilter](https://developer.missin.co.uk/reference/input-types.md#datetimefilter): `createdAt`
- [StringFilter](https://developer.missin.co.uk/reference/input-types.md#stringfilter): `formSlug`, `reasonOutcome`
- [BooleanFilter](https://developer.missin.co.uk/reference/input-types.md#booleanfilter): `mined`, `readable`
- `InsightAnswerFilter`: `not`

### InsightFactFilter

- `[InsightFactFilter!]`: `and`, `or`
- [UUIDFilter](https://developer.missin.co.uk/reference/input-types.md#uuidfilter): `answerId`, `customerId`, `formId`, `responseId`, `who`, `workspaceId`
- [StringFilter](https://developer.missin.co.uk/reference/input-types.md#stringfilter): `attribute`, `attributeClass`, `factId`, `formSlug`, `kind`, `subject`, `subjectClass`, `thing`, `thingClass`
- [FloatFilter](https://developer.missin.co.uk/reference/input-types.md#floatfilter): `confidence`, `polarity`
- [DatetimeFilter](https://developer.missin.co.uk/reference/input-types.md#datetimefilter): `createdAt`
- `InsightFactFilter`: `not`
- [IntFilter](https://developer.missin.co.uk/reference/input-types.md#intfilter): `polarityBand`, `polaritySign`

### FormResponseAnswerReasonFilter

- `[FormResponseAnswerReasonFilter!]`: `and`, `or`
- [UUIDFilter](https://developer.missin.co.uk/reference/input-types.md#uuidfilter): `answerId`, `workspaceId`
- [StringFilter](https://developer.missin.co.uk/reference/input-types.md#stringfilter): `broad`, `family`
- `FormResponseAnswerReasonFilter`: `not`

## Call it

```bash curl
curl https://api.missin.co.uk/graphql/v1 \
  -H "Authorization: Bearer $MISSIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operationName":"FormInsightRead","variables":{"answers":{"and":[]},"facts":{"and":[]},"reasons":{"and":[]}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"8edf34fba82132f3cc1fc4d5794dbda7109a2f77334e74b1df0852c7bada722e"}}}'
```

## Document

```graphql
query FormInsightRead($answers: InsightAnswerFilter!, $facts: InsightFactFilter!, $reasons: FormResponseAnswerReasonFilter!) { __typename reasons: allFormResponseAnswerReasons(filter: $reasons) { __typename aggregates { __typename distinctCount { __typename answerId } } groupedAggregates(groupBy: [BROAD, FAMILY]) { __typename average { __typename confidence } distinctCount { __typename answerId } keys } } answers: allInsightAnswers(filter: $answers) { __typename aggregates { __typename distinctCount { __typename answerId } } byOutcome: groupedAggregates(groupBy: [REASON_OUTCOME]) { __typename distinctCount { __typename answerId } keys } byMark: groupedAggregates(groupBy: [MINED, READABLE]) { __typename distinctCount { __typename answerId } keys } } facts: allInsightFacts(filter: $facts) { __typename aggregates { __typename distinctCount { __typename answerId customerId factId who } } byThing: groupedAggregates(groupBy: [KIND, THING, THING_CLASS, POLARITY_SIGN]) { __typename distinctCount { __typename who } keys } byThingBand: groupedAggregates(groupBy: [KIND, THING, POLARITY_BAND]) { __typename distinctCount { __typename who } keys } byAttribute: groupedAggregates(groupBy: [KIND, ATTRIBUTE_CLASS, ATTRIBUTE]) { __typename distinctCount { __typename who } keys } byAttributeClass: groupedAggregates(groupBy: [KIND, ATTRIBUTE_CLASS]) { __typename distinctCount { __typename who } keys } byKind: groupedAggregates(groupBy: [KIND]) { __typename distinctCount { __typename who } keys } byAttributeBand: groupedAggregates(groupBy: [KIND, ATTRIBUTE, POLARITY_BAND]) { __typename distinctCount { __typename factId } keys } byTopicSubject: groupedAggregates( groupBy: [KIND, ATTRIBUTE, SUBJECT_CLASS, SUBJECT] ) { __typename distinctCount { __typename factId } keys } } }
```

Source: https://developer.missin.co.uk/reference/forms/form-insight-read
