# The product's source records with their insights, newest said first (/api/feedback/list_source_records)

`GET /v1/products/{productId}/source-records`

Operation name: `list_source_records`

Feedback as received, each with its insights, narrowed by the filters given (all combined). Leave `limit` out for a page that fits your answer (fewer records when they are long; page on while `meta.nextCursor` is set). The page's first record, if too long for one answer alone, comes as its first part (`part`; read on with `get_source_record`). `meta.topics` says whether insights are grouped into topics (`idle`), being grouped (`grouping`), or grouping keeps failing (`needs_attention`, retried by `retry_topics`). `meta.rechecking` says whether the insights in New opportunity are checked against features added or changed since (`idle`), waiting for that check (`rechecking`), or rechecking keeps failing (`needs_attention`, retried by `retry_rechecking`). Send `meta.feedbackVersion` as `expectedVersion` with a feedback change planned from this read.

## Authentication

An OAuth access token for the person who allowed your tool: register a client, then the authorization code flow with PKCE (S256). Send it as `Authorization: Bearer <token>` on every route that needs a signed-in person. Calls with a token are limited per person, across all their apps, to 120 calls a minute and 10,000 a UTC day; calls that start AI runs or knowledge base reads (creating an organization, starting a knowledge base read, rebuilding categories, retrying topics or rechecking) also to 10 a minute and 200 a UTC day. Over a limit a call answers 429 `rate_limited` with `Retry-After` and `details.retryAfter` in seconds, and changes nothing.

Or: An API key, sent as `Authorization: Bearer ha_…` (keys made before the rename to Heuristic start `fsa_` and keep working). Keys are created only in the Heuristic web app and shown once. A personal key (Settings → Personal → My API keys) acts as its person in one of their organizations, with exactly their access there, checked on every call; its calls count toward the person's limits on calls through apps and agents, as described for OAuth tokens, and it can't change the person's account (their profile, organizations, invitations or connected apps). An organization key (Settings → Organization → API keys, created by Admins) acts for the organization, not a person: it can see and change every product and its feedback as an Admin can, but not people, product access, CRM connections or the organization's settings, and it can't delete a product; each organization key has its own limits, with the same numbers. Either kind is Full access or Read only (a change with a read-only key answers 403 `read_only_key`), reaches only its own organization (others answer 404), works on /v1 only, not on the MCP server, and can't create keys or manage the organization's API keys. Other refused calls answer 403 `api_key_not_allowed`. A wrong, expired or revoked key, or a disabled member's personal key, answers 401 `unauthorized`. A full-access key sends feedback: a personal key as its person, to the products they own; an organization key to any product of its organization; the record's `sentBy` names the key.

## Path parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `productId` | path | string | yes | A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 `validation_error`. |

## Query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | no | How many items to return, 1 to 100. Leave it out for a page that fits your answer: up to 50, fewer when they are long; page on while `meta.nextCursor` is set. A number you name can go over what fits. |
| `cursor` | query | string | no | Where the next page starts: the `meta.nextCursor` of the previous page. Leave out for the first page. |
| `view` | query | string | no | Only some records: `opportunity` = records with an insight linked to New opportunity, `attention` = records that need attention, `processing` = records still being processed (received). |
| `q` | query | string | no | Only records whose text, company name, contact name or email contains this, ignoring case. |
| `day` | query | string | no | Only records said on this UTC date, as YYYY-MM-DD. |
| `types` | query | string | no | Only records with at least one insight of any of these types, comma-separated: feature_request, bug, praise, complaint, question. |
| `ids` | query | string | no | Only these records, if they match the other filters: 1 to 100 source record ids, comma-separated. Each a uuid, in any case (read in lower case); anything else answers 400 `validation_error`. |

## Responses

### 200

One page of records, narrowed by the filters given (all combined). `meta.topics` says whether the product's insights are grouped into topics (`idle`), being grouped (`grouping`), or grouping keeps failing (`needs_attention`). `meta.rechecking` says whether the insights the AI put in New opportunity are checked against the features added or changed since (`idle`), waiting for that check (`rechecking`), or rechecking keeps failing (`needs_attention`).

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "saidAt": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "received",
              "processed",
              "needs_attention"
            ]
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string"
          },
          "sentBy": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "app": {
                "type": "object",
                "properties": {
                  "clientId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "clientId",
                  "name"
                ]
              },
              "person": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              }
            },
            "required": [
              "app",
              "person"
            ],
            "description": "Who sent it, when an app or agent sent it with a person's sign-in: the app and the person, named as they were when it was sent (the person null once they left the organization). Null for feedback from a feedback endpoint or a CRM."
          },
          "company": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "domain": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "customerStatus": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "customer",
                  "prospect",
                  null
                ]
              },
              "arr": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "amount": {
                    "type": "number"
                  },
                  "currency": {
                    "type": "string"
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "domain",
              "customerStatus",
              "arr"
            ]
          },
          "contact": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "email"
            ]
          },
          "customerStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "customer",
              "prospect",
              null
            ]
          },
          "arr": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "amount": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              }
            },
            "required": [
              "amount",
              "currency"
            ]
          },
          "customFields": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "insightsCapped": {
            "type": "boolean"
          },
          "waitingFor": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "knowledge_base",
              null
            ]
          },
          "failedStage": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "split",
              "link",
              null
            ]
          },
          "failureReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "too_long",
              null
            ]
          },
          "insights": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "statement": {
                  "type": "string"
                },
                "quote": {
                  "type": "string"
                },
                "quoteStart": {
                  "type": "integer"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "feature_request",
                    "bug",
                    "praise",
                    "complaint",
                    "question"
                  ]
                },
                "sentiment": {
                  "type": "string",
                  "enum": [
                    "positive",
                    "neutral",
                    "negative"
                  ]
                },
                "linked": {
                  "type": "boolean"
                },
                "feature": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "title"
                  ]
                },
                "topic": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                },
                "edited": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "statement",
                "quote",
                "quoteStart",
                "type",
                "sentiment",
                "linked",
                "feature",
                "topic",
                "edited"
              ]
            }
          },
          "part": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "textFrom": {
                "type": "integer"
              },
              "textTo": {
                "type": "integer"
              },
              "textLength": {
                "type": "integer"
              },
              "insightsFrom": {
                "type": "integer"
              },
              "insightsTo": {
                "type": "integer"
              },
              "insightsTotal": {
                "type": "integer"
              },
              "next": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "textFrom": {
                    "type": "integer"
                  },
                  "insightsFrom": {
                    "type": "integer"
                  }
                },
                "required": [
                  "textFrom",
                  "insightsFrom"
                ]
              }
            },
            "required": [
              "textFrom",
              "textTo",
              "textLength",
              "insightsFrom",
              "insightsTo",
              "insightsTotal",
              "next"
            ]
          }
        },
        "required": [
          "id",
          "text",
          "sourceUrl",
          "saidAt",
          "receivedAt",
          "status",
          "externalId",
          "source",
          "sentBy",
          "company",
          "contact",
          "customerStatus",
          "arr",
          "customFields",
          "insightsCapped",
          "waitingFor",
          "failedStage",
          "failureReason",
          "insights",
          "part"
        ]
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "topics": {
          "type": "string",
          "enum": [
            "idle",
            "grouping",
            "needs_attention"
          ]
        },
        "rechecking": {
          "type": "string",
          "enum": [
            "idle",
            "rechecking",
            "needs_attention"
          ]
        },
        "feedbackVersion": {
          "type": "string",
          "description": "The feedback's version (see `apply_feedback_changes`)."
        }
      },
      "required": [
        "nextCursor",
        "topics",
        "rechecking",
        "feedbackVersion"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ]
}
```

### 400

Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 401

Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 404

Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

## Example request

```bash
curl "https://staging.heuristic.app/v1/products/{productId}/source-records" \
  -H "Authorization: Bearer <access token>"
```
