How to create a survey with an API
Four steps from nothing to a live survey collecting answers.
1. Get a key
Sign in to SpaceForms and create a key at spaceforms.io/settings/api-keys.
2. Create and publish
curl -X POST https://spaceforms.io/api/v1/forms \
-H "Authorization: Bearer $SPACEFORMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Customer feedback",
"published": true,
"fields": [
{ "id": "q1", "type": "rating", "label": "How satisfied are you?", "required": true },
{ "id": "q2", "type": "long_text", "label": "What could we do better?" }
]
}'
3. Share the url
The response includes url — the public survey link.
4. Read answers
curl https://spaceforms.io/api/v1/forms/FORM_ID/responses -H "Authorization: Bearer $KEY"
Frequently asked questions
- How do I get an API key?
- Sign in, open Settings → API keys (spaceforms.io/settings/api-keys), name the key and press Create. The key starts with sf_live_ and is shown once. You can revoke it at any time.
- What does it cost?
- API access is included on every account, including free. Free accounts can create unlimited forms and collect unlimited responses, and see the 10 most recent answers per form. Pro (from $14/month) shows every answer on every form.