> ## 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 (Symbols)

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

These endpoints read and write the shared `generated_components` table (and the
`component_comments` / `component_ratings` tables). Reads of the feed/comments/ratings are
public; everything user-owned needs a bearer token.

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

<ResponseField name="GET" type="auth">
  `?page=1&limit=20` → `{ symbols, total, page, limit, totalPages }`. Proxies
  `GET /api/v3/components/my` (the backend `components` key is renamed to `symbols`).
</ResponseField>

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

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

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

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

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

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

`?page=1&limit=20&q=` → `{ symbols, total, page, limit, totalPages }`. Proxies
`GET /api/v3/components/community` (60 s revalidate); `components` → `symbols`. Public,
generation-shared symbols only.

## Comments — `/api/comments`

<ResponseField name="GET" type="public">
  `?symbolId=<id>` → `{ comments, total }`. Returns an empty list if unavailable.
</ResponseField>

<ResponseField name="POST" type="auth">
  Body `{ component_id (or symbol_id), component_type, content (1–5000), comment_type, parent_id }`.
  The proxy maps `symbol_id → component_id` and defaults `component_type` to `"symbol"`.
</ResponseField>

## Ratings — `/api/rating`

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

<ResponseField name="POST" type="auth">
  Body `{ symbolId, rating }` where `rating ∈ {1, -1}` → updated `{ up, down, total }`.
  Proxies `POST /api/v3/components/generated/{symbolId}/rate`.
</ResponseField>

<Info>
  `type` defaults to `"symbol"` across these endpoints, so the symbols site needs no explicit
  type filter. The footprints site passes `type=footprint` everywhere.
</Info>
