Skip to Content
Heuristic documentation

Create an organization with its first product

POST
/v1/organizations

For a person setting up Heuristic for a new company; to add a product to an existing organization use create_product. The person becomes the organization's Admin. It also starts reading the product's knowledge base (its public documentation site): meta.ingestionRun is that knowledge base read, or null when it could not start (then start it with start_knowledge_base_read). The read takes minutes: check get_knowledge_base_read every 30 seconds; it is done when its status is completed, failed or stopped. Not safe to retry: each call creates another organization.

Authorization

oauth2
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 organization and its first product.

name*string

The organization's name, usually the company's, 1 to 100 characters.

Length1 <= length <= 100
product*

Its first product.

Response Body

The new organization and product

application/json
  1. response
data*
meta*
Example Request
curl -X POST 'https://staging.heuristic.app/v1/organizations' \  -H 'Authorization: Bearer <access token>' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "product": {    "name": "string",    "knowledgeBaseUrl": "string"  }}'
Example Response
{  "data": {    "organization": {      "id": "string",      "name": "string",      "role": "admin",      "reportingCurrency": "string",      "createdAt": "string",      "allowKeysWithoutExpiry": true    },    "product": {      "id": "string",      "organizationId": "string",      "name": "string",      "description": "string",      "knowledgeBaseUrl": "string",      "access": "owner",      "createdAt": "string",      "archivedAt": "string",      "deletedAt": "string",      "restorableUntil": "string"    }  },  "meta": {    "ingestionRun": {      "id": "string",      "productId": "string",      "status": "queued",      "url": "string",      "pagesProcessed": 0,      "featuresExtracted": 0,      "pagesFailed": 0,      "pagesTooLong": 0,      "categoriesUnnamed": 0,      "failure": {        "code": "crawl_unavailable",        "message": "string"      },      "changes": {        "newFeatures": 0,        "updatedFeatures": 0,        "pagesRemoved": 0      },      "startedAutomatically": true,      "startedBy": {        "name": "string",        "email": "string"      },      "stoppedBy": {        "name": "string",        "email": "string"      },      "createdAt": "string",      "finishedAt": "string"    }  }}