The Squad API allows you to programmatically submit user feedback, support tickets, survey responses, or any text-based insights directly into your Squad workspace. This enables you to capture feedback from custom sources and integrate Squad’s analysis into your existing workflows.
Use cases: Custom feedback forms, internal tools, mobile apps, chatbots, support systems, or any application where users provide feedback.
Real-time feedback ingestion: Push feedback to Squad as it happens, ensuring your product insights are always up-to-date.Source attribution: Tag feedback with custom source identifiers to track which channels generate the most valuable insights.Automated discovery: Squad’s AI automatically analyzes submitted feedback, clusters themes, and surfaces actionable opportunities without manual review.
The fastest way to get started is by pasting this prompt into claude code or your favorite AI coding assistant to automatically generate a plan for integrating feedback capturing into your application:
prompt
Copy
I want you to visit and understand https://docs.meetsquad.ai/guides/squad-apiI then want you to understand where we might integrate this feedback capturing to this application. I want to capture high quality user feedback. Follow the best practices as outlined in the documentation. If you need to create a feedback form respect the components and patterns in the codebase.Create a plan and confirm it with me before you implement anything.
import express from "express";import { submitFeedback } from "@squadai/feedback-client";const app = express();app.use(express.json());app.post("/api/feedback", async (req, res) => { const { feedback, userEmail } = req.body; if (!feedback) { return res.status(400).json({ error: "Feedback is required" }); } // Optionally include user context in the feedback const feedbackText = `${feedback}\n\nSubmitted by: ${userEmail}`; const result = await submitFeedback(feedbackText, { source: "WEB_FORM" }); if (result.success) { res.json({ message: "Thank you for your feedback!" }); } else { res.status(500).json({ error: "Failed to submit feedback" }); }});app.listen(3000);
Copy
import { submitFeedback } from "@squadai/feedback-client";// When user provides feedback in chatasync function handleFeedbackCommand(message: string, userId: string) { const feedbackWithContext = `${message}\n\nUser ID: ${userId}`; const result = await submitFeedback(feedbackWithContext, { source: "SLACK_BOT" }); return result.success ? "Thanks! Your feedback has been recorded." : "Sorry, failed to record feedback. Please try again.";}
Copy
import { submitFeedback } from "@squadai/feedback-client";// API endpoint called from mobile appexport async function submitAppFeedback( feedback: string, metadata: { appVersion: string; platform: string }) { const enrichedFeedback = `${feedback}\n\nApp: ${metadata.appVersion} (${metadata.platform})`; const result = await submitFeedback(enrichedFeedback, { source: "MOBILE_APP" }); return { success: result.success, error: result.success ? null : result.error.message };}
Pro tip: Use descriptive source names that match your analytics. For example, MOBILE_APP vs WEB_APP lets you compare feedback across platforms in Squad Insights.
POST/v1/data-ingressSubmit feedback without source attribution.
cURL
Copy
curl -X POST https://api.meetsquad.ai/v1/data-ingress \ -H "Authorization: your-api-key-here" \ -H "Content-Type: text/plain" \ -d "The mobile app crashes when I try to upload photos"
Python
Copy
import requestsapi_key = "your-api-key-here"feedback = "The mobile app crashes when I try to upload photos"response = requests.post( "https://api.meetsquad.ai/v1/data-ingress", headers={ "Authorization": api_key, "Content-Type": "text/plain" }, data=feedback)if response.status_code == 201: data = response.json() print(f"✓ Feedback submitted to workspace: {data['data']['workspaceId']}")else: print(f"✗ Error: {response.status_code}")
JavaScript (fetch)
Copy
const apiKey = "your-api-key-here";const feedback = "The mobile app crashes when I try to upload photos";const response = await fetch("https://api.meetsquad.ai/v1/data-ingress", { method: "POST", headers: { "Authorization": apiKey, "Content-Type": "text/plain" }, body: feedback});if (response.ok) { const data = await response.json(); console.log(`✓ Feedback submitted to workspace: ${data.data.workspaceId}`);} else { console.error(`✗ Error: ${response.status}`);}
POST/v1/data-ingress/{feedbackSource}Submit feedback with source attribution for better tracking.
cURL
Copy
curl -X POST https://api.meetsquad.ai/v1/data-ingress/MOBILE_APP \ -H "Authorization: your-api-key-here" \ -H "Content-Type: text/plain" \ -d "Love the new dark mode feature!"
Python
Copy
import requestsapi_key = "your-api-key-here"feedback = "Love the new dark mode feature!"source = "MOBILE_APP" # Must be UPPERCASE_WITH_UNDERSCORESresponse = requests.post( f"https://api.meetsquad.ai/v1/data-ingress/{source}", headers={ "Authorization": api_key, "Content-Type": "text/plain" }, data=feedback)if response.status_code == 201: print("✓ Feedback submitted with source:", source)else: print(f"✗ Error: {response.status_code}")
{ "data": { "id": "insight_abc123", "workspaceId": "ws_xyz789", "content": "The mobile app crashes when I try to upload photos", "source": "MOBILE_APP", "createdAt": "2024-01-15T10:30:00Z" }}
"The checkout process is too slow. It takes 5-6 clicks to complete a purchase and I have to re-enter my payment info every time.User: [email protected]Platform: iOSApp Version: 2.3.1"Why this works:✓ Specific problem described✓ Measurable details (5-6 clicks)✓ Context included (payment re-entry)✓ Metadata for segmentation