Overview
The ICP API backs the ICP Generator. It manages a Postgres-backed library of Ideal Customer Profile dossiers and exposes AI synthesis of new profiles. All endpoints live under/api. Responses are JSON with a success boolean. Errors return success: false and an error message with HTTP 400 (validation), 503 (missing AI key), or 500 (server error).
Profiles are scoped by workspaceId. Records with no workspaceId are global and visible to every workspace.
List ICP profiles
200):
Generate an ICP profile with AI
GOOGLE_GENERATIVE_AI_API_KEY environment variable; if it is not set, the endpoint returns 503.
200 with the profile in profile. If saveToDb is true, the response contains the saved database record with source: "ai_synthesized"; otherwise it contains the raw generated dossier. The endpoint tries gemini-2.5-flash first and falls back to gemini-1.5-flash, then gemini-1.5-pro.
Create an ICP profile
name, industry, targetRole, and valueProposition; missing fields return 400.
201 with the created record in profile and source: "manual".
Delete an ICP profile
200 with a confirmation message.

