# Surveyr API > Surveyr runs surveys over WhatsApp and the web. Its REST API lets your systems read surveys and every response (keyed by stable question ids, with every version, unfinished forms and deletion notices, and GPS integrity flags), get webhooks as responses arrive, and track usage. Auth: send your key in the `x-api-key` header. Test keys (`svk_test_…`) return made-up data and never send a WhatsApp message. ## Docs - [Quickstart and recipes](https://www.surveyr.africa/help/developers): first call in minutes; push responses to a CRM, trigger a survey send, nightly export to BI - [OpenAPI v2](https://www.surveyr.africa/api/external/v2/openapi.json): the current API - [OpenAPI v1](https://www.surveyr.africa/api/external/v2/openapi/v1.json): the original read-only feed, frozen ## Conventions (v2) - Base URL `https://www.surveyr.africa/api/external/v2`. Every answer is `{ "data": …, "meta": …, "error": null }`; an error is `{ "data": null, "meta": …, "error": { "code", "message", "details" } }` with a stable `code`. - Lists use cursor pagination: pass `meta.nextCursor` back as `cursor`. `updatedSince` gives incremental sync. - 429 `rate_limited` means slow down (see `Retry-After`); 402 `quota_exceeded`, `payment_required` or `account_suspended` are about your plan, not your request rate. - Send an `Idempotency-Key` header on every POST that creates or sends; a retry with the same key returns the first answer. - Webhooks follow the Standard Webhooks spec: verify `webhook-signature` (`v1,` over `{webhook-id}.{webhook-timestamp}.{raw body}` with your `whsec_` secret) against the raw body and reject timestamps more than 5 minutes old. ## Endpoints v1 - `GET /v1/me`: Who the key belongs to and the limits that apply - `GET /v1/surveys`: The organisation's surveys (headers, no questions) - `GET /v1/surveys/{surveyId}`: One survey with its questions - `GET /v1/surveys/{surveyId}/responses`: Responses to one survey: every version, unfinished forms and deletion notices - `GET /v1/surveys/{surveyId}/responses/sample`: Made-up responses in exactly the same shape (dummy run). Nothing is stored. - `GET /v1/responses`: Responses to every survey of the organisation, one feed (JSON only) ## Endpoints v2 - `GET /v2/health`: Whether the API is up (no key needed) - `GET /v2/me`: The key, its organisation, scopes, plan and limits (any key: no survey or response data) - `GET /v2/usage`: This month's usage, quota and plan (any key: request counts only) - `GET /v2/surveys`: Your surveys (without questions) - `GET /v2/surveys/{surveyId}`: One survey with its questions - `GET /v2/surveys/{surveyId}/links`: The WhatsApp start link and web link to share the survey from your own system - `GET /v2/surveys/{surveyId}/responses`: Responses to one survey, cursor-paginated - `GET /v2/responses`: Responses to every survey, one feed - `GET /v2/responses/{responseId}`: One record: any version of a report, an unfinished form or a deletion notice - `GET /v2/webhooks/events`: The events a webhook can subscribe to - `GET /v2/webhooks`: Your webhooks (a test key lists none) - `POST /v2/webhooks`: Create a webhook; the answer carries its signing secret, once (live keys only: a test key gets 403 `forbidden`) - `GET /v2/webhooks/{webhookId}`: One webhook - `PATCH /v2/webhooks/{webhookId}`: Change a webhook, or switch it off and on - `DELETE /v2/webhooks/{webhookId}`: Delete a webhook; queued events are cancelled - `POST /v2/webhooks/{webhookId}/rotate-secret`: New signing secret; the old one also signs for graceHours (24 by default) - `POST /v2/webhooks/{webhookId}/test`: Send a signed webhook.test event with a sample record now, and see what your endpoint answered - `GET /v2/webhooks/{webhookId}/deliveries`: Delivery log, newest first (kept 30 days) - `POST /v2/webhooks/{webhookId}/deliveries/{deliveryId}/replay`: Send a delivery again, with the same webhook-id