# Reputation

Public B2B reputation profiles, verified reviews, and case studies. Build credibility with a public reputation page at trustpager.com/reputation/<slug>. Includes a companion anonymous image upload endpoint for reviewer logos and avatars.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### POST https://ucqwijexmjctglmrxlej.supabase.co/functions/v1/public-image-upload

Anonymous public image upload endpoint. No API key required. Accepts PNG, WebP, JPEG, or SVG up to 100 KB. Stores in Cloudflare R2 at trustpager.net/uploads/<context>/<sha256>.<ext>. Rate limited to 3 uploads per IP or browser fingerprint per 24 hours. Use context=reputation-reviewer-logo for reviewer company logos and context=form-avatar for reviewer headshots.

**Scopes:** _none_ — [full detail](./reputation/post-https-ucqwijexmjctglmrxlej-supabase-co-functions-v1-public-image-upload.md)

### GET /reputation/profile

Get the company's public Reputation profile (singleton per company). Returns slug, display name, category, branding, overall rating, review/case-study counts, publish state, and settings.

**Scopes:** `reputation:read` — [full detail](./reputation/get-reputation-profile.md)

### POST /reputation/profile

Create or update the company's Reputation profile (upsert). On creation, slug and display_name are required. On update, only the provided fields are changed.

**Scopes:** `reputation:write` — [full detail](./reputation/post-reputation-profile.md)

### GET /reputation/stats

Get aggregate stats for the company's Reputation: profile state, total/published review count, rating distribution (1-5), and case study counts by status.

**Scopes:** `reputation:read` — [full detail](./reputation/get-reputation-stats.md)

### GET /reputation/reviews

List reviews on the company's Reputation profile. Supports cursor pagination. Filter by status, featured, service_category, or rating. Use search for fuzzy match on reviewer name or testimonial.

**Scopes:** `reputation:read` — [full detail](./reputation/get-reputation-reviews.md)

### POST /reputation/reviews

Create a new reputation review (starts in "draft" status). Required fields: profile_id, reviewer_name, rating (1-5), testimonial_text. Supply reviewer_company_logo and reviewer_avatar as URLs from the public-image-upload endpoint for richer display.

**Scopes:** `reputation:write` — [full detail](./reputation/post-reputation-reviews.md)

### PATCH /reputation/reviews/:id

Update a reputation review. Accepts all writable fields. Setting vendor_response auto-stamps vendor_response_by and vendor_response_at. Use reviewer_company_logo and reviewer_avatar to attach images uploaded via public-image-upload.

**Scopes:** `reputation:write` — [full detail](./reputation/patch-reputation-reviews-id.md)

### POST /reputation/reviews/:id/approve

Transition a review from draft to approved. Stamps approved_by and approved_at.

**Scopes:** `reputation:write` — [full detail](./reputation/post-reputation-reviews-id-approve.md)

### POST /reputation/reviews/:id/publish

Transition a review from approved to published. Stamps published_at and recalculates the profile overall_rating and total_reviews.

**Scopes:** `reputation:write` — [full detail](./reputation/post-reputation-reviews-id-publish.md)

### DELETE /reputation/reviews/:id

Permanently delete a review. If the review was published, the profile overall_rating and total_reviews are recalculated.

**Scopes:** `reputation:delete` — [full detail](./reputation/delete-reputation-reviews-id.md)
