Currently the WebAPI does not write records into the CDM cohort_definition table. Because of this, scripts that run during cohort generation are failing because inserting records into the cohort table with a cohort_definition_id that doesn't exist in the cohort_definition table is violating the referential integrity constraints.