Documentation
Sites
If you manage polls, quizzes, and forms across more than one website or app, group them by site and scope keys to just one at a time.
Create a Site per property from the dashboard's Sites & usage page — like API keys, there's no public REST endpoint for managing sites themselves — and assign your resources and API keys to it.
- A site has a required name and an optional domain (for your own reference — it's never used to verify request origins).
- Every poll/quiz/form has an optional
site_id. Set it at creation, or change it later via update — reassigning a resource's site doesn't affect its existing votes/attempts/submissions, unlike its options/questions/fields. - Every API key has an optional
site_id. A key with no site is a "master" key — it can see and manage every site's resources, exactly like before sites existed. - A site-scoped key is confined to that one site: it can only see, create, or modify that site's polls/quizzes/forms, and any
site_idit sends is ignored in favor of its own — a scoped key can never create or reassign a resource to a different site. GET /polls,GET /quizzes,GET /forms, andGET /profilesall respect this automatically: a site-scoped key's list is pre-filtered to its own site; a master key sees everything, optionally narrowed with?site_id=.- Deleting a site doesn't delete its resources or keys — they become unassigned (
site_idreverts tonull) rather than orphaned.
Assigning a site on create
Pass site_id when creating a poll, quiz, or form — see the site_id row in each resource's request body table (Polls, Quizzes, Forms).
curl -X POST https://qnaapi.com/api/v1/polls \
-H "X-API-Key: qna_..." \
-H "Content-Type: application/json" \
-d '{
"title": "Blog poll",
"site_id": 1,
"options": ["Yes", "No"]
}'
A site-scoped key ignores any
site_id you send — its own site is always used instead, so a scoped key can never create or move a resource onto a different site.