API

Submit flow (survey, form, message) responses from your own backend or custom UI.

Last reviewed

For feedback collected in your own UI or backend, start with Collect feedback. You don't need a flow or a flow version for that path.

This reference covers submitting answers to an existing published flow. Use it when your answers need to belong to that specific flow version.

Available endpoints

EndpointPurpose
GET /api/v1/{apiKey}/flows/{flowId}Resolve the latest published flowVersionId for a flow.
GET /api/v1/{apiKey}/flow_versions/{flowVersionId}?payload=4Fetch the current published snapshot for a specific flow version.
POST /api/v1/{apiKey}/trpc/response.submitSubmit answers against a published flow version.

Base path and identity verification

  • Base path: /api/v1/{apiKey}/… where {apiKey} is your app's API key.
  • When identity verification is enabled, send Authorization: Bearer <token> on each request.
  • When identity verification is disabled, requests work without a token.

Submitting a response

Most API integrations follow this sequence:

  1. Resolve the current published flowVersionId.
  2. Fetch that version with ?payload=4 and collect the answers in your own UI.
  3. Submit via response.submit, sending the same payload generation.

Example request

curl -X POST \https://getuserfeedback.com/api/v1/YOUR_API_KEY/trpc/response.submit \-H "Content-Type: application/json" \-d '{"flowVersionId": "flv_123","flowVersionPayloadGeneration": "4","respondentAnalyticsAdmission": "collection_only","answers": {"question_1": "Very satisfied","question_2": ["fast", "clear"]},"identities": [{ "type": "userId", "value": "user_123" },{ "type": "traits.email", "value": "user@example.com" }]}'

flowVersionPayloadGeneration must match the payload generation used to fetch the flow version.

Every submission must include respondentAnalyticsAdmission. Use "collection_only" to collect feedback without connecting it to a respondent profile. Use "admitted" only after an explicit consent decision permits respondent analytics. See Consent scopes.

Optional fields

You can also include metadata, context, and flowAssignmentId:

{"flowVersionId": "flv_123","flowVersionPayloadGeneration": "4","respondentAnalyticsAdmission": "collection_only","answers": { "question_1": "Very satisfied" },"metadata": {"tags": {"journey_stage": "onboarding","task_type": "report-export"}},"context": {"page": {"path": "/settings/billing","referrer": "/settings"},"locale": "en-AU","userAgent": "Mozilla/5.0"}}

metadata.tags supports flat string values and string arrays:

{"metadata": {"tags": {"error_type": "validation","error_surface": "checkout","selected_modules": ["billing", "reporting"]}}}

For hosted flow links and iframe embeds, you can attach the same response metadata with URL parameters instead. See Response metadata.

For practical limits and guardrails around metadata and submission windows, see Limits.

Success response

{"result": {"data": {"success": true,"responseId": "resp_abc123"}}}

Error response

{"result": {"data": {"success": false,"errors": {"formErrors": ["Flow version not found"]}}}}

Common errors

  • Flow version not found — the flowVersionId is unknown or no longer available.
  • This survey version is no longer accepting responses... — a newer version has been published and the grace window has passed, or the survey's live window has closed.
  • This survey is not open yet. — the survey's live window has not started, or it has never been published.

When in doubt, resolve the latest published version again before retrying.