---
title: "Flag a variant with a comment"
method: POST
path: "/sessions/{session_id}/variants/{variant_idx}/flag"
tags: ["flagging"]
---

# Flag a variant with a comment

`POST /sessions/{session_id}/variants/{variant_idx}/flag`

## Request

- Base URL: `https://api.helena.bio` (the document declares no server; this is the origin it was published from)
- URL: `https://api.helena.bio/sessions/{session_id}/variants/{variant_idx}/flag`
- Auth: HTTP bearer

Flag a variant for review by the platform operator.

Persists flag in PostgreSQL variant_annotations table (upsert).
Emits variant.flagged audit event. Sends detailed email to operator.

## Path parameters

- `session_id` string, uuid, required
- `variant_idx` integer, required

## Request body

- FlagVariantRequest: Request to flag a variant with a comment.
  - `comment` string, required: Description of the issue with this variant

## Response `200`

Successful Response

- FlagVariantResponse: Response after flagging or unflagging a variant.
  - `variant_idx` integer, required
  - `gene_symbol` string, nullable
  - `is_user_flagged` boolean, required
  - `email_sent` boolean, required
  - `message` string, required
  - `flagged_by` UserAttribution: Identifies a user who performed an action, with optional timestamp. Used in flag/override responses and annotation records. Both user_id and user_name are required — user_id for system references, user_name for display. timestamp optional because some historical records (migrated from DuckDB) lack precise timestamps.
    - `user_id` string, uuid, nullable: User UUID. May be None for historical records migrated from DuckDB where original user was not tracked.
    - `user_name` string, required: Display name of the user. For historical records, may be 'system:historical-migration' or 'unknown-historical'.
    - `timestamp` string, date-time, nullable: When the action occurred. None for historical records without precise timestamp.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/helena/apis/helix-insight-variant-analysis-service.md) · [All operations](https://skmtc.dev/helena/apis/helix-insight-variant-analysis-service/llms.txt) · [OpenAPI document](https://skmtc.dev/helena/apis/helix-insight-variant-analysis-service/revisions/fe51fd20cdf1?raw)
