v1
latestOpenAPI 3.1.02026-07-13632897.9 KBclarity
Create Cluster
Upsert the user's cluster snapshot.
Called by Clarity MCP server after successful clustering. Single-row model: INSERT if no snapshot exists, UPDATE if one does.
Headers: X-User-ID: User UUID (required) X-Internal-Secret: Internal API secret (required in production)
Body: cluster_data: {"clusters": [...]} thoughts_exhausted: bool correctly_clustered: bool | null
Returns: 201: {"cluster_id": "...", "created_at": "..."} 400: Invalid cluster_data structure 401: Missing or malformed X-User-ID header 404: User not found
Security: Validates X-Internal-Secret header to ensure request comes from trusted MCP server. In dev mode (INTERNAL_API_SECRET empty), this check is skipped.
post/api/clarity/clusters
Headers
X-Internal-Secretstring nullable
X-User-IDstring nullable
Request body
Response
Successful Response