> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buildwithtrace.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Saved & Community (Footprints)

> Manage a user's saved footprints and the public community gallery — my-footprints CRUD, community feed, comments, and ratings.

These endpoints read/write the shared `generated_components` table (and `component_comments`
/ `component_ratings`). The footprints site passes `type=footprint` everywhere so only
footprints surface. Feed/comment/rating reads are public; user-owned actions need a token.

## Saved footprints — `/api/my-footprints`

<ResponseField name="GET" type="auth">
  `?page=1&limit=20` → `{ footprints, total, page, limit, totalPages }`. Proxies
  `GET /api/v3/components/my?…&type=footprint` (`components` → `footprints`).
</ResponseField>

<ResponseField name="PATCH" type="auth">
  Body `{ footprintId, ...updates }` (e.g. `is_public`). Proxies
  `PATCH /api/v3/components/generated/{footprintId}`.
</ResponseField>

<ResponseField name="DELETE" type="auth">
  Body `{ footprintId }` → `{ success: true }`. Proxies
  `DELETE /api/v3/components/generated/{footprintId}`.
</ResponseField>

<CodeGroup>
  ```bash List theme={null}
  curl -H "Authorization: Bearer $TOKEN" \
    "https://footprints.buildwithtrace.com/api/my-footprints?page=1&limit=20"
  ```

  ```bash Toggle public theme={null}
  curl -X PATCH -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
    -d '{"footprintId":"<uuid>","is_public":true}' \
    https://footprints.buildwithtrace.com/api/my-footprints
  ```

  ```bash Delete theme={null}
  curl -X DELETE -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
    -d '{"footprintId":"<uuid>"}' https://footprints.buildwithtrace.com/api/my-footprints
  ```
</CodeGroup>

<Note>
  The saved-items route is `/api/my-footprints` (the body key is `footprintId`). The backend
  target is the shared `/api/v3/components/*` family with `type=footprint`.
</Note>

## Community feed — `GET /api/community`

`?page=1&limit=20&q=` → `{ footprints, total, page, limit, totalPages }`. Proxies
`GET /api/v3/components/community?…&type=footprint`; `components` → `footprints`. The page
also defensively filters to `type === "footprint"` client-side.

## Comments — `/api/comments`

<ResponseField name="GET" type="public">`?symbolId=<id>` → `{ comments, total }`.</ResponseField>

<ResponseField name="POST" type="auth">
  Body `{ component_id (or footprint_id), component_type, content, comment_type, parent_id }`.
  The proxy defaults `component_type` to `"footprint"` on this site.
</ResponseField>

## Ratings — `/api/rating`

<ResponseField name="GET" type="public">`?symbolId=<id>` → `{ up, down, total }`.</ResponseField>
<ResponseField name="POST" type="auth">Body `{ symbolId, rating }`, `rating ∈ {1,-1}`.</ResponseField>

<Info>
  The comments/ratings query param is still named `symbolId` (and the backend route family is
  component-generic) — it accepts any component id, footprint or symbol.
</Info>
