# The customers behind New opportunity's customers and ARR (/api/feedback/list_new_opportunity_customers)

`GET /v1/products/{productId}/new-opportunity/customers`

Operation name: `list_new_opportunity_customers`

Who is behind the scope's number: each customer it counts once, with status, ARR, `insights`, `topicCount`, up to 5 `topics` and `latestFeedbackAt` (when given). `kind`: `company`; `contact` (no company, such as a free-mail address); or `record` (no company or contact; open it with `get_source_record`). `meta.total` and `meta.arrTotal` are the scope's customers and ARR under `customerStatus`, `period` and `type`, as in `get_feedback_counts`. `arr` null: no ARR, or its `unconvertedCurrency` can't be converted (say so, not zero); `meta.noArr`: report "no ARR yet", not zero revenue. Rankings can move between pages as feedback arrives. Use `query` to check one customer; there is no read of a customer across features. `meta.featureId` is null. 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 |
| --- | --- | --- | --- | --- |
| `customerStatus` | query | string | no | Only customers with this status: `customer` or `prospect`, taken as for `get_feedback_counts`. Left out: everyone, customers with no status too. |
| `period` | query | string | no | Only feedback given in this period counts (`30d`, `90d`, or `12m`: the last 12 calendar months, UTC), as for `get_feedback_counts`; the customers, their insights, topics and latest date and `meta.total` and `meta.arrTotal` all follow it. Left out: all time. |
| `type` | query | string | no | Only customers who gave this insight type here, with only those insights and topics. Left out: every type. |
| `sentiment` | query | string | no | Only customers who gave feedback with this sentiment here, with only those insights and topics. |
| `source` | query | string | no | Only customers whose feedback came through this source (an id from `list_topics`' `meta.sources`), with only those insights and topics. A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 `validation_error`. |
| `from` | query | string | no | With `to`: only feedback given from this UTC day (YYYY-MM-DD, inclusive) counts, as `period` narrows (not with `period`); copy a `series` entry's `from` and `to` to read that period. |
| `to` | query | string | no | With `from`: the last UTC day (YYYY-MM-DD, inclusive) whose feedback counts; later feedback does not. |
| `query` | query | string | no | Only customers whose name (a contact's also its email) contains this text, ignoring case, 1 to 200 characters; `meta.total` is unchanged. |
| `sort` | query | string | no | `insights` (default) or `arr`: most first; without ARR last. |
| `limit` | query | integer | no | How many customers a page holds, 1 to 50 (50 when left out). |
| `cursor` | query | string | no | The previous page's `meta.nextCursor`, with the same other inputs; left out: the first page. |

## Responses

### 200

One page of customers

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "company",
              "contact",
              "record"
            ]
          },
          "id": {
            "type": "string",
            "description": "The company's, contact's or record's id, by `kind`."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "A contact's email."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "customer",
              "prospect",
              null
            ]
          },
          "arr": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exact decimal in `meta.currency`; null without ARR or unconvertible."
          },
          "unconvertedCurrency": {
            "type": [
              "string",
              "null"
            ]
          },
          "insights": {
            "type": "integer"
          },
          "topicCount": {
            "type": "integer"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "At most 5."
          },
          "latestFeedbackAt": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "id",
          "name",
          "email",
          "status",
          "arr",
          "unconvertedCurrency",
          "insights",
          "topicCount",
          "topics",
          "latestFeedbackAt"
        ]
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "counting": {
          "type": "boolean"
        },
        "uncounted": {
          "type": "boolean"
        },
        "hasRecords": {
          "type": "boolean"
        },
        "countingRecords": {
          "type": "integer",
          "minimum": 0
        },
        "uncountedRecords": {
          "type": "integer",
          "minimum": 0
        },
        "featureId": {
          "type": [
            "string",
            "null"
          ]
        },
        "total": {
          "type": "integer"
        },
        "arrTotal": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "ratesAsOf": {
          "type": [
            "string",
            "null"
          ]
        },
        "unconverted": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "noArr": {
          "type": "boolean"
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "feedbackVersion": {
          "type": "string",
          "description": "The feedback's version (see `apply_feedback_changes`)."
        }
      },
      "required": [
        "counting",
        "uncounted",
        "hasRecords",
        "countingRecords",
        "uncountedRecords",
        "featureId",
        "total",
        "arrTotal",
        "currency",
        "ratesAsOf",
        "unconverted",
        "noArr",
        "nextCursor",
        "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}/new-opportunity/customers" \
  -H "Authorization: Bearer <access token>"
```
