# Change a product's name, description, knowledge base address or Report by (product Owners) (/api/products/update_product)

`PATCH /v1/products/{productId}`

Operation name: `update_product`

Send the fields to change; the others stay as they are. It answers the product with `reporting`, as the one-product read does. A new knowledge base address is read the next time the knowledge base is read (`start_knowledge_base_read`). Setting the same values again changes nothing, so a retry is safe.

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

## Request body

Content type: `application/json` (required)

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029]*$",
      "description": "The product's name, 1 to 100 characters, on one line."
    },
    "description": {
      "type": "string",
      "maxLength": 500,
      "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f-\\u009f\\u2028\\u2029]*$",
      "description": "What the product is, up to 500 characters."
    },
    "knowledgeBaseUrl": {
      "type": "string",
      "maxLength": 2048,
      "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$",
      "description": "The product's public documentation site, an http or https address such as https://docs.example.com; never a local or private address. Heuristic reads it to find the product's features."
    },
    "reportBy": {
      "type": "string",
      "enum": [
        "auto",
        "week",
        "month",
        "quarter"
      ],
      "description": "What every trend and change of the product's feedback reports by: `week`, `month`, `quarter`, or `auto` (the default), which picks the unit from the product's feedback volume."
    }
  },
  "description": "The details to change; send at least one. Fields left out stay as they are."
}
```

## Responses

### 200

The changed product

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "organizationId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "knowledgeBaseUrl": {
          "type": "string"
        },
        "access": {
          "type": "string",
          "enum": [
            "owner",
            "viewer"
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "archivedAt": {
          "type": [
            "string",
            "null"
          ],
          "deprecated": true,
          "description": "Deprecated: use `deletedAt` and `restorableUntil` instead. It may be removed from 2026-12-10."
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "When it was deleted; null while active."
        },
        "restorableUntil": {
          "type": [
            "string",
            "null"
          ],
          "description": "Until when it can be restored, 30 days after `deletedAt`; then removed for good. Null while active."
        },
        "reporting": {
          "type": "object",
          "properties": {
            "reportBy": {
              "type": "string",
              "enum": [
                "auto",
                "week",
                "month",
                "quarter"
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "week",
                "month",
                "quarter"
              ]
            },
            "reason": {
              "type": [
                "string",
                "null"
              ],
              "description": "On `auto`, why it picked `unit` (e.g. about 3 customers a week over the last 26 weeks); else null."
            }
          },
          "required": [
            "reportBy",
            "unit",
            "reason"
          ],
          "description": "What the product's trends and changes report by: the setting, and the unit in effect."
        }
      },
      "required": [
        "id",
        "organizationId",
        "name",
        "description",
        "knowledgeBaseUrl",
        "access",
        "createdAt",
        "archivedAt",
        "deletedAt",
        "restorableUntil",
        "reporting"
      ]
    },
    "meta": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "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"
  ]
}
```

### 403

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"
  ]
}
```

### 413

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 -X PATCH "https://staging.heuristic.app/v1/products/{productId}" \
  -H "Authorization: Bearer <access token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","knowledgeBaseUrl":"string","reportBy":"auto"}'
```
