Retrieve all forms belonging to the authenticated user, including response counts.
Endpoint
Authentication
Requires Clerk authentication. Only returns forms owned by the authenticated user.
Response
Always true for successful requests
Array of form objects ordered by creation date (newest first) Show Form Object Properties
ISO 8601 timestamp of form creation
Number of responses submitted to this form
Example Request
curl -X GET https://your-domain.com/api/getAllForms \
-H "Cookie: __session=your-clerk-session"
Example Response
{
"success" : true ,
"forms" : [
{
"id" : "cm3x7y2z1a0b1c2d3e4f5" ,
"title" : "Customer Feedback Form" ,
"createdAt" : "2026-03-01T10:30:00.000Z" ,
"_count" : {
"responses" : 42
}
},
{
"id" : "cm3a1b2c3d4e5f6g7h8i9" ,
"title" : "Event Registration" ,
"createdAt" : "2026-02-28T15:45:00.000Z" ,
"_count" : {
"responses" : 15
}
}
]
}
Source: app/api/getAllForms/route.ts:5
Retrieve a specific form by its ID or slug. This endpoint is public and does not require authentication.
Endpoint
Parameters
Form identifier - can be either the form’s UUID or its URL-friendly slug
Response
Always true for successful requests
Complete form object including all fields Show Form Data Properties
Clerk user ID of the form owner
Array of form field definitions (structure varies based on form)
Whether the form is published and accepting responses
ISO 8601 timestamp of creation
Example Request
# By ID
curl -X GET https://your-domain.com/api/forms/cm3x7y2z1a0b1c2d3e4f5
# By slug
curl -X GET https://your-domain.com/api/forms/customer-feedback-abc123
Example Response
{
"success" : true ,
"data" : {
"id" : "cm3x7y2z1a0b1c2d3e4f5" ,
"slug" : "customer-feedback-abc123" ,
"userId" : "user_2abc123xyz" ,
"title" : "Customer Feedback Form" ,
"fields" : [
{
"id" : "name" ,
"label" : "Your Name" ,
"type" : "text" ,
"required" : true
},
{
"id" : "email" ,
"label" : "Email Address" ,
"type" : "email" ,
"required" : true
},
{
"id" : "rating" ,
"label" : "Rating" ,
"type" : "number" ,
"required" : true
}
],
"isPublished" : true ,
"createdAt" : "2026-03-01T10:30:00.000Z"
}
}
Source: app/api/forms/[id]/route.ts:12
Permanently delete a form and all its associated responses.
Endpoint
Authentication
Requires Clerk authentication. You can only delete forms you own.
Parameters
The UUID of the form to delete
Response
Always true for successful deletions
Example Request
curl -X DELETE https://your-domain.com/api/forms/cm3x7y2z1a0b1c2d3e4f5 \
-H "Cookie: __session=your-clerk-session"
Example Response
{
"success" : true ,
"data" : {
"id" : "cm3x7y2z1a0b1c2d3e4f5" ,
"title" : "Customer Feedback Form" ,
"userId" : "user_2abc123xyz" ,
"slug" : "customer-feedback-abc123" ,
"fields" : [ ... ],
"isPublished" : true ,
"createdAt" : "2026-03-01T10:30:00.000Z"
}
}
Error Responses
{
"error" : "Unauthorized"
}
Returned when:
No authentication session is present
The authenticated user does not own the form
{
"error" : "Form not found"
}
Returned when the form ID does not exist.
Source: app/api/forms/[id]/route.ts:57
Toggle Publish Status
Toggle a form’s isPublished status between true and false.
Endpoint
Authentication
Requires Clerk authentication. You can only update forms you own.
Parameters
The UUID of the form to update
Response
Always true for successful updates
The updated form object with the new isPublished value
Example Request
curl -X PATCH https://your-domain.com/api/forms/cm3x7y2z1a0b1c2d3e4f5 \
-H "Cookie: __session=your-clerk-session"
Example Response
{
"success" : true ,
"data" : {
"id" : "cm3x7y2z1a0b1c2d3e4f5" ,
"title" : "Customer Feedback Form" ,
"userId" : "user_2abc123xyz" ,
"slug" : "customer-feedback-abc123" ,
"fields" : [ ... ],
"isPublished" : false ,
"createdAt" : "2026-03-01T10:30:00.000Z"
}
}
Source: app/api/forms/[id]/route.ts:109