---
title: "Mark Card Viewed"
method: POST
path: "/api/newspulse/cards/{card_id}/view"
tags: ["newspulse"]
---

# Mark Card Viewed

`POST /api/newspulse/cards/{card_id}/view`

## Request

- Base URL: `https://api.sambodh-ias.in` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sambodh-ias.in/api/newspulse/cards/{card_id}/view`
- Auth: none declared

Upsert a per-user 'viewed' record for a NewsPulse card.

Frontend fires this on a 3-second debounced expand. P3 perf fix
(docs/perf-audit-2026-09-26/perf_db.md D8): a single INSERT ... ON
CONFLICT DO UPDATE replaces the old SELECT-then-UPDATE/INSERT pair, and
the update's WHERE clause makes a re-post of the same card within 10
minutes with no bigger dwell_ms a true no-op — no row rewrite, no index
churn on a table that took 873k unconditional UPDATEs in a week. Returns
the card's fresh state so the caller can patch its cache in place instead
of invalidating + refetching /cards/states.

## Path parameters

- `card_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Request body

- MarkViewedRequest
  - `dwell_ms` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sambodh-ias/apis/sambodhias-v2.md) · [All operations](https://skmtc.dev/sambodh-ias/apis/sambodhias-v2/llms.txt) · [OpenAPI document](https://skmtc.dev/sambodh-ias/apis/sambodhias-v2/revisions/258843d1f806?raw)
