Skip to content

HTTP API

Use the public API for customer-facing feedback and surveys. Use the administrative API for organization management. Both require an organization API key.

Make a request

Create an API key in your organization settings. Set the variables below with your real key. Examples assume a POSIX shell and curl; examples using jq say so. The key selects the organization.

export REFLET_API_URL='https://harmless-clam-802.convex.site'
export REFLET_PUBLIC_KEY='fb_pub_replace_with_your_key'

curl "$REFLET_API_URL/api/v1/feedback" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY"

For self-hosting, replace REFLET_API_URL with your backend HTTP origin (the Convex .convex.site URL, not .convex.cloud). Public paths start with /api/v1; administrative paths start with /api/v1/admin. The CLI expects only the origin in REFLET_API_URL and appends those paths. Success bodies are JSON; create-feedback and create-comment return 201, other listed operations return 200. OPTIONS preflight returns 204.

Authentication

Send Authorization: Bearer <key> on every request. Never put a secret key in browser code, URLs, repository files or logs. Restrict access to the server environment that holds it. Dashboard API key management lets administrators disable or delete credentials.

When a public key has allowed domains, requests must supply a matching Origin or Referer host, including its port. A *.example.com entry matches subdomains, not example.com itself. Missing/mismatched origins receive 403. A command-line request with a restricted public key also needs this header, for example -H 'Origin: https://app.example.com'. Origin restrictions are not user authentication: non-browser clients can set these headers. Secret keys bypass the domain check.

Identify an external user

Add X-User-Token with a token produced by signUser on your server. Authenticate the person in your own app before signing their ID. Use the secret paired with the public key, then give only the token to the browser. See server-side user signing.

Authorization: Bearer fb_pub_your_key
X-User-Token: <server-signed token>

Voting, commenting, subscribing and unsubscribing require a valid, unexpired signed token. Invalid tokens are ignored during key authentication, so those actions return 401; creation may instead proceed anonymously. Unsigned tokens only attribute new feedback and survey responses. They never update an existing user's saved name/email and cannot identify an ID already protected by signed requests. A signed token identifies your app's customer, not a Reflet dashboard member.

SDK devtools, team access and recording sessions use separate member-scoped credentials, not a public-key shortcut or a secret key in the browser. See devtools access and session transport.

Public endpoints

Paths below are relative to /api/v1. GET parameters go in the query string; POST parameters go in a JSON object with Content-Type: application/json. Use IDs returned by the API, not names or slugs. Timestamps are epoch milliseconds.

Read feedback, roadmap and releases

For an RSS reader, GET /rss/<organizationSlug> at the backend origin needs no API key. It serves up to 50 published releases as application/rss+xml with a one-hour public cache; private or unknown organizations return 404. This path is outside /api/v1.

Feedback lists default to 50 items, at most 100, with offset=0. Request the next page by adding the number of returned items to offset while hasMore is true. Pinned items come first, then sortBy: votes (default), newest, oldest or comments. Search is a case-insensitive substring of title or description. Filters combine; pagePath matches the normalized reported page path. Unknown status and sortBy values are ignored. Use positive limits and nonnegative offsets.

Lifecycle status values are open, under_review, planned, in_progress, completed and closed. statusId selects a custom board status, not a lifecycle value. With a public key, lists and detail omit unpublished, internal and deleted feedback. Lists also omit merged feedback. Secret-key list/detail reads include unpublished and internal items, private context, assigneeId, claimedBy, GitHub links, publication state and author email. Deleted items still stay out of both reads.

curl --get "$REFLET_API_URL/api/v1/feedback/list" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" \
  --data-urlencode 'status=open' \
  --data-urlencode 'sortBy=newest' \
  --data-urlencode 'limit=20' \
  --data-urlencode 'offset=0'

Create feedback and act as a user

Creating feedback and requesting screenshot uploads work with a public key even for a private organization. Voting, commenting and subscriptions require a signed user token, including when the bearer key is secret. A public key can only perform those interactions on publicly visible feedback in a public organization. A resolved author on new feedback receives an upvote and subscription automatically.

curl "$REFLET_API_URL/api/v1/feedback/create" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"title":"Export invoices","description":"Add CSV export to billing.","context":{"url":"https://example.com/billing"}}'

# FEEDBACK_ID must be an accessible item returned by the API.
curl "$REFLET_API_URL/api/v1/feedback/comment" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" \
  -H "X-User-Token: $USER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d "{\"feedbackId\":\"$FEEDBACK_ID\",\"body\":\"CSV would help our accounting team.\"}"

New feedback starts unapproved and is scheduled for triage. Do not assume immediate publication. A secret key can set publication explicitly through the administrative API. context accepts url, pageTitle, browser, os, device, language, timezone, referrer, userAgent, sdkVersion, screen, viewport, string-valued metadata, consoleEvents and element selections. It is private diagnostic data: send only information you intend to share with the organization. There are at most 30 console events and 10 selections; oversized context values are rejected, not truncated.

Upload and attach a screenshot

# Requires curl, jq and a local screenshot.png.
UPLOAD_URL=$(curl -fsS -X POST \
  "$REFLET_API_URL/api/v1/feedback/screenshot/upload-url" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" | jq -r '.uploadUrl')
STORAGE_ID=$(curl -fsS "$UPLOAD_URL" \
  -H 'Content-Type: image/png' \
  --data-binary @screenshot.png | jq -r '.storageId')
curl "$REFLET_API_URL/api/v1/feedback/screenshot/save" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"feedbackId\":\"$FEEDBACK_ID\",\"storageId\":\"$STORAGE_ID\",\"filename\":\"screenshot.png\"}"

Uploads must be PNG, JPEG, WebP, GIF or AVIF, at most 10 MiB, uploaded within 30 minutes and not already attached elsewhere. The server reads type and size from storage. A public key can attach at most 10 images within 30 minutes of feedback creation, using the same resolved user as the reporter (or no user for an anonymous report). Add the same X-User-Token to the save request for an identified report. A secret key bypasses the reporter, feedback-age and count restrictions, not upload validation.

captureSource is widget (default) or element. annotations accepts up to 50 shapes with type and x/y: rectangle, arrow, text, blur, pen, highlight or spotlight. Optional fields are color, width, height, endX/endY, text (up to 280 characters) and points (up to 500 x/y points). Upload a separate rendered image as annotatedStorageId when needed. Neither annotations nor a blurred rendered image removes the original upload; do not upload sensitive pixels.

Render and answer a survey

Survey endpoints accept public or secret keys for public and private organizations. A user token is optional attribution, not authorization for a response. Keep response IDs private: answer, complete and dismiss are scoped to the organization and response ID, not checked against the current respondent. Reuse a stable respondentId or user token for frequency and sampling; without either, frequency does not block display and sampling admits everyone.

Survey records contain sorted questions, endings, display settings and triggerConfig. Your client decides when to show eligible surveys. triggerType is manual, page_visit, time_delay, exit_intent, feedback_submitted or event. See the survey integration guide for trigger matching and question flow.

# Inspect eligible surveys and use their returned survey/question IDs.
curl "$REFLET_API_URL/api/v1/surveys/eligible?respondentId=visitor_123" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY"

curl "$REFLET_API_URL/api/v1/surveys/respond/start" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"surveyId\":\"$SURVEY_ID\",\"respondentId\":\"visitor_123\"}"

# For an NPS question, after setting RESPONSE_ID and QUESTION_ID:
curl "$REFLET_API_URL/api/v1/surveys/respond/answer" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"responseId\":\"$RESPONSE_ID\",\"questionId\":\"$QUESTION_ID\",\"value\":9}"

curl "$REFLET_API_URL/api/v1/surveys/respond/complete" \
  -H "Authorization: Bearer $REFLET_PUBLIC_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"responseId\":\"$RESPONSE_ID\"}"

Answers must match the question: an integer in range for NPS/rating, a boolean for yes/no, text, one listed choice, or distinct listed choices for multiple choice. An enabled Other option accepts one unlisted choice. Statement questions take no answer. Invalid answers, ineligible starts and missing required answers return 400. Completed or abandoned responses cannot accept answers. Unfinished responses older than 24 hours are abandoned by a scheduled job.

Administrative endpoints

Every path in this section starts with /api/v1/admin and requires a secret fb_sec_ key. The key grants organization administration, not the permissions of an end user. No organization ID is accepted. Keep it on your server, in a secret store or in the CLI. Public keys receive 403. Set REFLET_API_KEY to your secret key before running these examples. Set FEEDBACK_ID to an item returned by a feedback read.

curl "$REFLET_API_URL/api/v1/admin/feedback/set-status" \
  -H "Authorization: Bearer $REFLET_API_KEY" \
  -H 'Content-Type: application/json' \
  -d "{\"feedbackId\":\"$FEEDBACK_ID\",\"status\":\"planned\"}"

Feedback and comments

Tags and board statuses

Releases

Milestones

Surveys

Organization and other resources

Values and side effects

POST bodies use JSON booleans and arrays, not string versions. Dates are epoch milliseconds. Tag, status and milestone colors are default, gray, brown, orange, yellow, green, blue, purple, pink or red. Milestone timeHorizon values are now, next_month, next_quarter, half_year, next_year and future.

The queue defaults to open, under_review and planned, selects approved or internal items, excludes deleted, merged, session-proposal items and live claims, and matches any supplied tag. Claims last two hours and move feedback to in_progress. A claim is not a permanent lock: expiry alone does not reset the status. Claiming a specific ID does not apply the next-item status or approval filters.

Changing lifecycle or custom status emits a status webhook; lifecycle changes can create or close a linked GitHub issue according to the integration settings. Publishing a release can notify subscribers; scheduling can also change the status of linked feedback. These are writes, not previews. Feedback/comment updates usually return { success: true }. Duplicate resolve/merge, screenshot deletion and survey deletion return null; survey creation/duplication return a JSON ID string.

Create a survey

curl "$REFLET_API_URL/api/v1/admin/survey/create" \
  -H "Authorization: Bearer $REFLET_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Checkout feedback",
    "triggerType": "event",
    "triggerConfig": { "eventName": "checkout_completed", "sampleRate": 50 },
    "display": { "frequency": "until_completed", "position": "bottom_right" },
    "questions": [
      { "type": "nps", "title": "Would you recommend us?", "required": true },
      { "type": "text", "title": "What should change?", "required": false }
    ],
    "endings": [{ "id": "thanks", "title": "Thanks for your feedback" }]
  }'

Each question has type, title, optional description, required (default true), config, logic and next. Types are nps, rating, text, single_choice, multiple_choice, boolean and statement. config accepts choices, allowOther, minValue, maxValue, minLabel, maxLabel, ratingStyle, maxLength, placeholder, buttonLabel and buttonUrl. Draft question jumps use { kind: "question", questionIndex: 1 }; ending jumps use { kind: "ending", endingId: "thanks" }. A logic rule has id, operator, optional value and target. Operators are equals, not_equals, greater_than, less_than, includes, answered and skipped. Use the dashboard editor for question editing after creation.

triggerConfig accepts pageUrl, delayMs, eventName and sampleRate (0–100). display requires frequency (once, until_completed or recurring), with optional position (bottom_right, bottom_left or center) and recontactDays. Endings have id, title and optional description, buttonLabel and buttonUrl. Button URLs must be safe links. See survey rendering and flow before writing a custom renderer.

Member and recording transports

Use the SDK for these member-scoped flows. They do not accept organization public/secret keys. Devtools exchanges a single-use connect code, codeVerifier and redirectUri at POST /api/v1/devtools/token for an fb_dev_ token; POST /api/v1/devtools/revoke revokes it. Team access exchanges code and codeVerifier at POST /api/v1/team/token with the approved Origin for an fb_team_ token; POST /api/v1/team/revoke revokes it. Session requests use these bearer tokens; team tokens also require their bound Origin.

The /api/v1/sessions routes below are used by recording, review and handoff. Their request schemas, per-session limits and access rules belong to the session integration. Devtools tokens can also create internal feedback, read feedback list/detail and upload/save screenshots, but cannot reach the admin API or other public-key routes.

# Relative to /api/v1/sessions
GET  /identity, /list, /detail, /live, /segments/context-choices
POST /start, /collection, /update, /delete, /events
POST /upload-url, /segments, /segments/correct, /segments/retry
POST /speakers/token, /speakers, /evidence, /evidence/remove
POST /analyze
POST /proposals/decide, /proposals/edit, /proposals/clarify
POST /proposals/verify, /proposals/merge, /proposals/separate
POST /proposals/delete, /proposals/feedback
POST /handoffs, /handoffs/preview, /handoffs/delivered
POST /intentions/accept, /intentions/change, /intentions/answer
POST /intentions/attach, /intentions/keep-separate, /intentions/detach
POST /segments/context

Receive webhooks

An organization owner or administrator configures outbound webhooks in the dashboard API key settings. Choose events and a publicly reachable HTTP(S) receiver. Copy the signing secret at creation; it is not shown in the webhook list. This secret is separate from organization API keys. Private network targets are rejected and redirects are not followed.

Request and payload

Reflet sends a JSON POST with Content-Type: application/json, User-Agent: Reflet-Webhooks/1.0, X-Reflet-Event, X-Reflet-Delivery and X-Reflet-Signature. The delivery header matches the payload id and is stable across retries. The signature is sha256= followed by the lowercase hexadecimal HMAC-SHA256 of the exact body bytes, keyed with the webhook secret.

Envelope with abbreviated feedback data
{
  "id": "<delivery ID>",
  "event": "feedback.status_changed",
  "createdAt": 1793000000000,
  "organizationId": "<organization ID>",
  "data": { "feedback": { "id": "<feedback ID>", "title": "Export invoices", "status": "planned" } }
}

Feedback events contain data.feedback in the secret-key feedback detail shape, including private context, GitHub fields and author email when present. Survey completion contains data.survey with _id and title, and data.response with _id, channel, startedAt, completedAt, endingId, respondentId, externalUserId, pageUrl and answers. Each answer has questionId, questionTitle, questionType and value. Optional fields may be absent.

Payload data is loaded when each attempt runs, not frozen at event time. A retry can therefore have the same delivery ID but newer data and a different signature. Missing subjects, disabled receivers and feedback no longer approved for publication are skipped. Internal feedback is not delivered. Treat receiver storage and logs as private organization data.

Verify, deduplicate and acknowledge

import { createHmac, timingSafeEqual } from "node:crypto";

// Call with the original request bytes, before JSON parsing.
export function verifyReflet(rawBody: Buffer, signature: string, secret: string) {
  const expected = Buffer.from(
    "sha256=" + createHmac("sha256", secret).update(rawBody).digest("hex"),
    "utf8"
  );
  const received = Buffer.from(signature, "utf8");
  return received.length === expected.length && timingSafeEqual(received, expected);
}

Reject missing or invalid signatures before processing JSON. The signature has no signed timestamp or replay-expiry field: persist processed delivery IDs and ignore duplicates. After signature verification, durably enqueue the event and return a 2xx within 10 seconds. Do longer work outside the request. Do not assume events arrive in order or contain the previous status.

Non-2xx responses, network failures and the 10-second timeout trigger up to two retries: 1 minute after the first failure, then 10 minutes after the second. Any 2xx succeeds. Twenty consecutive failed attempts across a webhook, including retries, disable it; a success resets the count. Review recent delivery results in the dashboard, fix the receiver and re-enable it to reset the failure count. Re-enabling does not replay exhausted deliveries.

Rate limits

Public-key writes use separate token buckets with the following capacities and refill rates, per API key. These are not fixed calendar-minute windows.

Secret keys share a 300-per-minute bucket across these public writes. Public reads and saving screenshot metadata use no bucket. Admin operations have individual limits, such as invitation email delivery. On 429, back off; responses have no Retry-After or rate-limit headers.

Handle errors

Errors return a JSON error string. Check the HTTP status before using the result. After a network interruption, check whether a write took effect before retrying: votes toggle, and creation has no idempotency key.

{ "error": "Feedback ID is required" }