Developers
API overview
Authentication, the main endpoints and limits.
Base URL: https://api.surveyguard.ca. All requests and responses are JSON; successful responses are wrapped as { "success": true, "data": … } and errors as { "success": false, "error": "…" }.
The complete, always-up-to-date reference — every endpoint, parameter and response — is the interactive API reference.
Authentication
| Key | Prefix | Use for | Send as |
|---|---|---|---|
| Publishable | sg_pk_ | Submitting responses from browsers and webhooks | Authorization: Bearer sg_pk_… or ?key=sg_pk_… |
| Secret | sg_sk_ | Submitting from your own servers, with full results | Authorization: Bearer sg_sk_… |
Create and revoke keys under API Keys. Secret keys are shown once; store them in your server's secret store.
Score a response
curl -X POST https://api.surveyguard.ca/v1/responses \
-H "Authorization: Bearer sg_sk_your_secret_key" \
-H "Content-Type: application/json" \
-d '{"email":"respondent@example.com","ipAddress":"203.0.113.7","answers":{"q1":"Yes"}}'
With a secret key the response includes the full breakdown (flags, category scores); with a publishable key only the score, risk level and recommendation. Only secret-key calls may set ipAddress — browser calls always use the real connection address.
Other ingestion
POST /v1/webhooks/ingest?key=…— generic webhookPOST /v1/webhooks/typeform?key=…— TypeformPOST /v1/responses/csv-upload— CSV upload
Limits
- Responses per billing period depend on your plan; over the limit you get
429with"error": "over_limit". Without an active subscription or trial you get402. - Each key has a per-minute rate limit set by your plan (a project can set a lower one); over it you get
429with aRetry-Afterheader (seconds) andX-RateLimit-*headers. - Replaying the same
externalEventIdreturns the original result and isn't billed again.
Reading your data
Dashboard endpoints (respondents, analytics, exports, reports) use your signed-in session rather than API keys. They're documented in the interactive reference for teams building their own reporting.