Forms (استمارات) (v1)
Workspace forms allow creating form templates (name, description, dynamic questions) and sending them via a short link. A submission may be tied to a client or created as an open link (no clientId). Each template can optionally set a WhatsApp handoff number (completionHandoffWhatsAppPhone, E.164); after the respondent completes the public form, the UI can open WhatsApp to that number with questions and answers prefilled (wa.me). Customers use the public page without login. Submissions can be listed and analyzed with optional AI.
Endpoints
- List Form Templates - List form templates for the workspace
- Create Form Submission - Send a form to a client (creates submission and short link)
- Upload Form Template Background Image - Set a background image for the public form page
- Remove Form Template Background Image - Remove the template's background image
Additional workspace endpoints: POST /forms/templates, GET/PATCH/DELETE /forms/templates/:templateId, GET /forms/submissions, GET /forms/submissions/:submissionId, POST /forms/submissions/:submissionId/analyze. Create and update template bodies accept optional backgroundImageUrl, backgroundColor, and optional completionHandoffWhatsAppPhone (E.164, e.g. +970591234567) for per-template post-submit WhatsApp handoff.
Public (no auth)
- Get Public Form by Token - Get form + workspace branding by token
- Submit Public Form by Token - Submit answers by token
Authentication
Required: Workspace (Bearer) or Staff token. Persona: Workspace Owner and Staff (with existing forms permissions) manage templates and submissions. Customer fills the public form only (no token).