Record Consent
Record the user’s consent to take part in the HAI-Co² research study.
HAI-Co² is a research study whose purpose is data collection, so agreeing records BOTH the recording consent and the (required) publication consent, each idempotently (the first grant’s timestamp is preserved on repeated calls). The optional request body carries only the e-mail opt-in; it is optional so a body-less POST still records participation consent.
Args:
user: The authenticated user (injected by require_user).
payload: Optional consent-gate selection (the e-mail opt-in).
db: Database session.
Returns:
The updated user profile as a UserResponse.
Authorizations
A personal access token (haico_pat_...), created under Profile → API keys. Send it as Authorization: Bearer <key>. The browser session JWT is also accepted but is an internal mechanism and is not part of the public contract.
Body
Study-participation consent submission.
HAI-Co² is a research study whose purpose is data collection, so agreeing to take part records BOTH the recording consent and the (required) publication consent; the endpoint stamps them regardless of this body. The only optional choice is the e-mail opt-in, so it is the sole field here (defaults to false).
Response
Successful Response
Public user profile returned by auth endpoints.