Get Form Responses
Retrieve all responses submitted to a specific form in JSON format.Endpoint
Authentication
Requires Clerk authentication. You can only access responses for forms you own.Parameters
string
required
The UUID of the form whose responses you want to retrieve
Response
boolean
Always
true for successful requestsstring
The title of the form
number
Total count of responses
array
Array of response objects, ordered by submission date (newest first)
Example Request
Example Response
Error Responses
Source:app/api/forms/[id]/responses/route.ts:5
Export Responses
Export all form responses as a downloadable CSV file (or other formats in the future).Endpoint
Authentication
Requires Clerk authentication. You can only export responses for forms you own.Parameters
string
required
The UUID of the form whose responses you want to export
string
default:"csv"
Export format. Currently only
csv is supported.Response
Returns a file download with appropriate headers:- Content-Type:
text/csv(for CSV format) - Content-Disposition:
attachment; filename="{form-title}.csv"
- A header row with field names plus “Submitted At”
- One row per response
- Timestamp in ISO 8601 format
Example Request
Example CSV Output
Error Responses
Implementation Details
The export process:- Validates user authentication and form ownership
- Retrieves the form title and user ID
- Fetches all responses for the form
- Formats responses with timestamps in ISO 8601 format
- Passes data to the appropriate exporter (CSV by default)
- Returns file with proper MIME type and download headers
app/api/forms/[id]/export/route.ts:6
Export Formats
Currently supported formats:- csv - Comma-separated values (default)
lib/exporter.ts.