Skip to Content
Heuristic documentation

Add a product to an existing organization (Admins only)

POST
/v1/products

Choose a new uuid as id so that a retry is safe: a repeat with the same id answers the product the first call made, and a different organization or another product's id is refused (conflict). This does not read the knowledge base yet: call start_knowledge_base_read next to find the product's features. For a new company with no organization, use create_organization.

Authorization

headerAuthorizationBearer <token>

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.

Request Body

application/json
  1. body

The product. organizationId is the organization's id, from list_my_organizations. id is a new uuid you choose so that a retry is safe: a repeat with the same id answers the product the first call made.

organizationId*string

A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 validation_error.

Formatuuid
id?string

A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 validation_error.

Formatuuid
name*string

The product's name, 1 to 100 characters, on one line.

Match^[^\u0000-\u001f\u007f-\u009f\u2028\u2029]*$
Length1 <= length <= 100
knowledgeBaseUrl*string

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.

Match^[^\s\u0000-\u001f\u007f-\u009f]+$
Lengthlength <= 2048
description?string

What the product is, up to 500 characters. Empty when left out.

Match^[^\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u2028\u2029]*$
Lengthlength <= 500
Default""

Response Body

The product an earlier request with this id created

application/json
  1. response
data*
meta*
Example Request
curl -X POST 'https://staging.heuristic.app/v1/products' \  -H 'Authorization: Bearer <access token>' \  -H 'Content-Type: application/json' \  -d '{  "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",  "name": "string",  "knowledgeBaseUrl": "string"}'
Example Response
{  "data": {    "id": "string",    "organizationId": "string",    "name": "string",    "description": "string",    "knowledgeBaseUrl": "string",    "access": "owner",    "createdAt": "string",    "archivedAt": "string",    "deletedAt": "string",    "restorableUntil": "string"  },  "meta": {    "property1": null,    "property2": null  }}