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

KeyPrefixUse forSend as
Publishablesg_pk_Submitting responses from browsers and webhooksAuthorization: Bearer sg_pk_… or ?key=sg_pk_…
Secretsg_sk_Submitting from your own servers, with full resultsAuthorization: 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

Limits

  • Responses per billing period depend on your plan; over the limit you get 429 with "error": "over_limit". Without an active subscription or trial you get 402.
  • Each key has a per-minute rate limit set by your plan (a project can set a lower one); over it you get 429 with a Retry-After header (seconds) and X-RateLimit-* headers.
  • Replaying the same externalEventId returns 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.