---
title: "Build Product Graph"
method: POST
path: "/knowledge-graph/products/{product_id}/build"
tags: ["knowledge-graph"]
---

# Build Product Graph

`POST /knowledge-graph/products/{product_id}/build`

## Request

- Base URL: `https://api.evidenso.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.evidenso.com/knowledge-graph/products/{product_id}/build`
- Auth: HTTP bearer

Trigger a Product Context Graph build for a product from its connected git repo.

Reuses `build_product_graph_for_user` (the MCP tool's path) so token handling lives in one
place. Returns `{job_id}` on success; poll GET /knowledge-graph/products/jobs/{job_id}.

## Path parameters

- `product_id` string, required

## Request body

- ProductGraphBuildBody
  - `repo_url` string: GitHub/GitLab repo URL to clone + analyze (optional).
  - `website_url` string: Single public product website URL to crawl + web-search (optional).
  - `website_urls` string[]: Multiple public sites to crawl in one build (marketing + docs/help). First is primary (gets web-search discovery); the rest are crawl-only. Takes precedence over website_url.
  - `repo_subdir` string: Analyze only this path within the repo (monorepo).
  - `provider` string: 'github' | 'gitlab'; inferred from repo_url host when blank.
  - `product_name` string: Scope the git token by product name; resolved from id when blank.
  - `include_repo_docs` boolean
  - `run_extraction` boolean
  - `clear_existing` boolean
  - `crawl_max_pages` integer
  - `discover_count` integer
  - `selected_integrations` string[]: Connected integration slugs (slack/googledrive/…) to ingest into the product graph via fetch-for-bronze (Mode-2 parity).
  - `scope_by_integration` object: Per-integration item selection from the Manage-Access picker {slug: {mode, channel_ids?/folder_ids?/file_ids?/…}}.

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/evidenso/apis/persona-rag-api.md) - [All operations](https://skmtc.dev/evidenso/apis/persona-rag-api/llms.txt) - [OpenAPI document](https://skmtc.dev/evidenso/apis/persona-rag-api/revisions/86408c178d4f?raw)
