Skip to main content

List Form Templates (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/forms/templates

Description

List form templates for the workspace. Supports optional filtering by status. Each template may include completionHandoffWhatsAppPhone (E.164 or null) for optional post-submit WhatsApp handoff on the public form page.

Authentication

Required: Workspace or Staff token.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID

Query Parameters

ParameterTypeRequiredDescription
statusstringNoactive or archived
limitnumberNoMax items (default 50)
offsetnumberNoSkip (default 0)

Response 200 OK

{
"templates": [
{
"id": "...",
"workspaceId": "...",
"name": "استمارة رضا",
"description": "وصف اختياري",
"status": "active",
"questions": [
{
"id": "q_1",
"type": "text",
"questionText": "ما تقييمك؟",
"options": [],
"order": 0,
"required": true
}
],
"aiPrompt": "برومت التحليل اختياري",
"backgroundImageUrl": "https://...",
"backgroundColor": "#f5f5f5",
"completionHandoffWhatsAppPhone": "+970591234567",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
],
"total": 1
}

Common Errors

  • 400: Invalid workspace ID
  • 401: Unauthorized
  • 404: Workspace not found
  • 500: Server error