API Dokumentation
Die Formsly REST API ermöglicht den programmatischen Zugriff auf Formulare und Antworten. Alle Anfragen erfolgen über HTTPS an https://formsly.ch/api.
Authentifizierung
Die API verwendet API-Keys zur Authentifizierung. Du findest und erstellst deine Keys unter Einstellungen → API & Webhooks in deinem Formsly-Dashboard.
Sende den Key als Authorization -Header:
curl https://formsly.ch/api/forms \
-H "Authorization: Bearer fsk_live_YOUR_API_KEY"Alternativ kann der Key als Query-Parameter übergeben werden (nicht empfohlen für Produktion, da Keys in Server-Logs erscheinen können):
curl "https://formsly.ch/api/auth/verify?api_key=fsk_live_YOUR_API_KEY"/api/auth/verifyAPI-Key überprüfenPrüft ob ein API-Key gültig ist und gibt die zugehörigen Nutzer-Infos zurück.
// Response 200 OK
{
"user_id": "95ad5a4a-...",
"username": "name@example.com",
"email": "name@example.com"
}Formulare
/api/formsAlle Formulare abrufenGibt eine Liste aller Formulare des authentifizierten Nutzers zurück.
curl https://formsly.ch/api/forms \
-H "Authorization: Bearer fsk_live_YOUR_API_KEY"// Response 200 OK
[
{
"id": "2627c769-7f64-4839-befb-ac551d30cdea",
"title": "Contact Request",
"description": null,
"status": "published",
"updated_at": "2026-03-14T10:12:05.000+00:00",
"created_at": "2026-03-10T09:02:51.000+00:00"
}
]Antworten
/api/responsesAntworten abrufenGibt die neuesten Antworten eines Formulars zurück. Antwortfelder kommen als Array roher Frage-Antwort-Objekte (Feld answers).
| Parameter | Typ | Beschreibung |
|---|---|---|
| form_id* | string | ID des Formulars |
| since | string (ISO 8601) | Optional. ISO-Timestamp – nur Antworten danach abrufen (für Polling). |
| limit | number | Optional. Anzahl Antworten (Default: 100, Max: 100). |
curl "https://formsly.ch/api/responses?form_id=2627c769-...&since=2026-03-14T00:00:00Z&limit=50" \
-H "Authorization: Bearer fsk_live_YOUR_API_KEY"// Response 200 OK
[
{
"id": "f1b00f39-...",
"form_id": "2627c769-...",
"submitted_at": "2026-03-14T10:44:38.604+00:00",
"consent_given": true,
"answers": [
{ "questionId": "q1", "label": "Name", "value": "Jane Doe" },
{ "questionId": "q2", "label": "Email", "value": "jane@example.com" }
]
}
]E2E-verschlüsselte Antworten werden NICHT entschlüsselt zurückgegeben (answers ist dann leer). Server-seitig verschlüsselte Felder werden transparent entschlüsselt.
Webhooks
Webhooks senden eine HTTP POST-Anfrage an deine URL, sobald eine neue Antwort eingereicht wird. Jede Auslieferung enthält eine HMAC-SHA256-Signatur im Header Formsly-Signature, mit dem geheimen Webhook-Secret berechnet.
/api/webhooksWebhook registrieren| Feld | Typ | Beschreibung |
|---|---|---|
| url* | string | HTTPS-URL, die bei neuen Antworten aufgerufen wird (private/lokale IPs werden blockiert). |
| form_id | string | Optional. ID des Formulars. Ohne form_id wird der Webhook für ALLE Formulare des Accounts ausgelöst. |
curl -X POST https://formsly.ch/api/webhooks \
-H "Authorization: Bearer fsk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://your-app.com/webhook", "form_id": "2627c769-..."}'// Response 201 Created
{
"webhook": {
"id": "abc123-...",
"url": "https://your-app.com/webhook",
"secret": "whsec_...",
"active": true,
"created_at": "2026-03-18T09:15:23.000+00:00",
"updated_at": "2026-03-18T09:15:23.000+00:00"
}
}/api/webhooksWebhooks auflistencurl "https://formsly.ch/api/webhooks?form_id=2627c769-..." \
-H "Authorization: Bearer fsk_live_YOUR_API_KEY"/api/webhooks/:idWebhook entfernencurl -X DELETE https://formsly.ch/api/webhooks/abc123-... \
-H "Authorization: Bearer fsk_live_YOUR_API_KEY"// POST <your webhook url>
// Header: Formsly-Signature: <hex hmac-sha256 of body using your secret>
{
"event": "submission.created",
"timestamp": "2026-03-18T09:15:23.000Z",
"submission": {
"id": "f1b00f39-...",
"formId": "2627c769-...",
"submittedAt": "2026-03-18T09:15:23.000Z",
"consentGiven": true,
"answers": [
{ "questionId": "q1", "label": "Name", "value": "Jane Doe" }
]
}
}// Node.js – verify the Formsly-Signature header
import crypto from "crypto"
const signature = req.headers["formsly-signature"]
const expected = crypto
.createHmac("sha256", process.env.FORMSLY_WEBHOOK_SECRET)
.update(rawBody, "utf8")
.digest("hex")
if (
!signature ||
signature.length !== expected.length ||
!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
) {
return res.status(401).end()
}Zapier-Integration
Formsly ist als Zapier-Integration verfügbar. Verbinde dein Formsly-Konto mit über 7’000 Apps ohne eine einzige Zeile Code.
Zapier nutzt dieselben REST-Endpoints wie deine eigenen Integrationen:
/api/formsFormular-Dropdown (List Forms)/api/zapier/responsesTrigger-Polling (Get Responses)/api/webhooksSubscribe (Webhook anlegen)/api/webhooks/:idUnsubscribe (Webhook löschen)- Klicke auf den Link oben und akzeptiere die Einladung zur Formsly Zapier-Integration
- Erstelle einen API-Key unter Einstellungen → API & Webhooks
- Erstelle einen neuen Zap und wähle Formsly Switzerland als Trigger-App
- Verbinde dein Konto mit dem API-Key
- Wähle das gewünschte Formular aus dem Dropdown
- Konfiguriere deine Action (z.B. Google Sheets, E-Mail, CRM)
Fehlercodes
| Status | Bedeutung |
|---|---|
| 200 | Erfolgreich |
| 201 | Erstellt (z.B. neuer Webhook) |
| 400 | Fehlende oder ungültige Parameter |
| 401 | Ungültiger oder fehlender API-Key |
| 403 | Kein Zugriff auf diese Ressource |
| 404 | Ressource nicht gefunden |
| 500 | Interner Serverfehler |
// Error response
{
"error": "Unauthorized"
}Fragen zur API? Schreib uns an team@formsly.ch