{"openapi":"3.1.0","info":{"title":"WorkFINITY® Form AI API","summary":"Form definition management, AI-assisted generation, schema discovery, themes, and rules","description":"\n## WorkFINITY® Solution Configuration Management System — Form AI API\n\nAn enterprise-grade FastAPI microservice for AI-assisted form design, dynamic schema authoring, versioned form definitions, theme management, and rule evaluation over BPRM.\n\n---\n\n### 🔑 Authentication\nMost endpoints in this microservice require internal service authentication.\nClick the green **Authorize 🔓** button in Swagger UI and provide your internal service secret:\n- **Header:** `X-Internal-Auth`\n- **Value:** `<INTERNAL_SERVICE_SECRET>` (e.g. `wf_internal_...`)\n\nPublic diagnostic endpoints (`/health` and `/api/stats`) do not require authentication.\n\n---\n\n### 📋 Form Definitions & Lifecycle\n- **`FormDefinition`**: Application-scoped form entity capturing business intent, layout type, and lifecycle state.\n- **`FormDefinitionVersion`**: Immutable version snapshots containing the full JSON UI schema with rollback support.\n- **Publishing & Rollback**: Safe activation of versioned definitions with transaction isolation.\n\n---\n\n### 🤖 AI Form Generator & Agent\n- **Natural Language Form Generation**: Generate complete, production-ready form UI schemas directly from natural language prompts.\n- **Conversational Form Agent**: Multi-turn agent that inspects uploaded documents (PDF, Word, image) and iteratively refines form schemas.\n- **Token Tracking**: Automatic auditing of prompt and completion token consumption in `AiTokenUsage`.\n\n---\n\n### ⚡ Dynamic Rules & Themes\n- **Visibility & State Rules**: Evaluate complex conditional expressions against form payloads using safe expression runners.\n- **Theming**: Layout customization, visual design tokens, and CSS properties stored in versioned JSON definitions.\n- **Templates**: Versioned document, alert, email, SMS, report and page templates, optionally pinned to a published theme version.\n","termsOfService":"https://workfinity.net/terms","contact":{"name":"WorkFINITY Support","url":"https://workfinity.net/","email":"support@workfinity.net"},"license":{"name":"Proprietary","url":"https://workfinity.net/"},"version":"2.0.0"},"servers":[{"url":"/","description":"Current Server (Auto-detected)"},{"url":"http://localhost:8000","description":"Local Development (Port 8000)"},{"url":"http://localhost:8090","description":"Docker Compose Host Port (Port 8090)"},{"url":"https://form-ai-portal.workfinity.com","description":"Production Portal"}],"paths":{"/api/audit":{"get":{"tags":["Audit"],"summary":"Get Audit Logs","description":"Retrieve audit logs with filtering and pagination.\n\nReturns an object with 'logs' array and metadata including total count, filters, pagination, and debug info.","operationId":"get_audit_logs_endpoint_api_audit_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Date in YYYY-MM-DD format (defaults to today). Ignored if date_from and date_to are provided.","title":"Date"},"description":"Date in YYYY-MM-DD format (defaults to today). Ignored if date_from and date_to are provided."},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date in YYYY-MM-DD format (inclusive)","title":"Date From"},"description":"Start date in YYYY-MM-DD format (inclusive)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date in YYYY-MM-DD format (inclusive)","title":"Date To"},"description":"End date in YYYY-MM-DD format (inclusive)"},{"name":"error_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by error type","title":"Error Type"},"description":"Filter by error type"},{"name":"status_code","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by HTTP status code","title":"Status Code"},"description":"Filter by HTTP status code"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date/time in ISO format","title":"Start Date"},"description":"Start date/time in ISO format"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date/time in ISO format","title":"End Date"},"description":"End date/time in ISO format"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of entries to return. Default value: 100","default":100,"title":"Limit"},"description":"Maximum number of entries to return. Default value: 100"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page index (1-based). For example, offset=3 with limit=10 returns page 3 (entries 20-29). Default value: 1","default":1,"title":"Offset"},"description":"Page index (1-based). For example, offset=3 with limit=10 returns page 3 (entries 20-29). Default value: 1"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Audit Logs Endpoint Api Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/forms":{"post":{"tags":["AI Forms"],"summary":"Generate and save a form from a prompt","description":"Matches the prompt to a data dictionary (or uses the fields it lists, or a generated field list), asks OpenAI for the UI schema, validates it and saves a new form as Version 1 Draft. Location points at the new form (/api/forms/{id}).","operationId":"ai_create_form_endpoint_api_ai_forms_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiCreateFormIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiCreateFormOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/forms/autofill":{"post":{"tags":["AI Form Agent"],"summary":"Fill a form schema from a document","description":"Suggests field values for the form schema in the body from document_text or a base64 document. PII is pseudonymized before the OpenAI call and restored in the response.","operationId":"generate_form_autofill_api_ai_forms_autofill_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormAgentGenerateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutofillResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/forms/autofill/summary":{"post":{"tags":["AI Form Agent"],"summary":"Summarize several autofill results","description":"Combines per-document autofill replies into one summary for the user.","operationId":"generate_form_cumulative_summary_api_ai_forms_autofill_summary_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormAgentCumulativeSummaryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormAgentCumulativeSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/forms/autofill/upload":{"post":{"tags":["AI Form Agent"],"summary":"Fill a form schema from an uploaded document","description":"Extracts values from a .docx, text or text-based PDF document and maps them onto the given form schema's field ids.","operationId":"autofill_form_upload_api_ai_forms_autofill_upload_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_autofill_form_upload_api_ai_forms_autofill_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutofillResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/forms/{id}/autofill":{"post":{"tags":["AI Form Agent"],"summary":"Fill a saved form from a document","description":"Loads the form's latest version and suggests field values from the uploaded document. Text documents (.docx, .txt, text PDFs) use the shared autofill engine with PII pseudonymization; images and scanned PDFs are read by the vision model (their text is pseudonymized, page images are not).","operationId":"ai_form_agent_endpoint_api_ai_forms__id__autofill_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ai_form_agent_endpoint_api_ai_forms__id__autofill_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiFormAgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms":{"get":{"tags":["Forms"],"summary":"List forms","description":"Active forms of the application, each with its latest version.","operationId":"list_forms_api_forms_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Page"}},{"name":"pageSize","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":200,"minimum":0},{"type":"null"}],"description":"Use 0 with page=1 to return all rows","title":"Pagesize"},"description":"Use 0 with page=1 to return all rows"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in name, formType, description and partner name","title":"Q"},"description":"Search in name, formType, description and partner name"},{"name":"formType","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"e.g. Entry, Partner (case-insensitive)","title":"Formtype"},"description":"e.g. Entry, Partner (case-insensitive)"},{"name":"lifecycleStatus","in":"query","required":false,"schema":{"anyOf":[{"enum":["Draft","Published","Retired"],"type":"string"},{"type":"null"}],"description":"Status of the latest version","title":"Lifecyclestatus"},"description":"Status of the latest version"},{"name":"partnerId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Only forms of this partner (Partner.Id)","title":"Partnerid"},"description":"Only forms of this partner (Partner.Id)"},{"name":"sortBy","in":"query","required":false,"schema":{"type":"string","description":"name, formType, version, lifecycleStatus, createdAtUtc, updatedAtUtc, publishedAtUtc, partnerName","default":"createdAtUtc","title":"Sortby"},"description":"name, formType, version, lifecycleStatus, createdAtUtc, updatedAtUtc, publishedAtUtc, partnerName"},{"name":"sortDir","in":"query","required":false,"schema":{"type":"string","description":"asc/desc","default":"desc","title":"Sortdir"},"description":"asc/desc"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_FormDefinitionOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Forms"],"summary":"Create a form","description":"Creates the form with Version 1 as Draft.","operationId":"create_form_api_forms_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/search":{"get":{"tags":["Forms"],"summary":"Search forms (typeahead)","operationId":"search_forms_api_forms_search_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Typeahead text; names starting with it rank first. Empty returns the newest.","title":"Q"},"description":"Typeahead text; names starting with it rank first. Empty returns the newest."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}},{"name":"formType","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formtype"}},{"name":"partnerId","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Partnerid"}},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_FormDefinitionOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}":{"get":{"tags":["Forms"],"summary":"Get a form","description":"The form with its latest version. The ETag header is its rowVersion.","operationId":"get_form_api_forms__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Forms"],"summary":"Update a form","description":"Partial update. formSchema and themeId go into the latest version, which must be a Draft checked\nout by the caller (409 FORM_NOT_CHECKED_OUT / FORM_CHECKED_OUT otherwise). Name, type,\ndescription and partner can be changed at any time.","operationId":"update_form_api_forms__id__patch","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since.","title":"If-Match"},"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Forms"],"summary":"Delete a form","description":"Soft delete: FormDefinition.IsActive = false.","operationId":"delete_form_api_forms__id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since.","title":"If-Match"},"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/versions":{"get":{"tags":["Forms"],"summary":"List a form's versions","operationId":"list_versions_api_forms__id__versions_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Pagesize"}},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_FormDefinitionOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/checkout":{"post":{"tags":["Forms"],"summary":"Check out a form to edit it","description":"Locks the form for the caller. If the latest version is Published (or Retired), creates the next\nDraft version with the same schema and theme; a Draft nobody holds is claimed (renewing the\nexpiry). 409 FORM_CHECKED_OUT when someone else holds it. The lock lapses after FORM_CHECKOUT_HOURS.","operationId":"check_out_form_api_forms__id__checkout_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FormCheckRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/checkin":{"post":{"tags":["Forms"],"summary":"Check in and publish the draft","description":"Publishes the caller's checked-out Draft (the previously Published version becomes Retired),\nrecords the check-in notes and releases the lock. Already checked in -> the form, unchanged.\n409 when the Draft is not checked out by the caller; 400 FORM_SCHEMA_EMPTY for an empty schema.","operationId":"check_in_form_api_forms__id__checkin_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FormCheckRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/draft":{"delete":{"tags":["Forms"],"summary":"Discard the draft version","description":"Deletes the Draft (version 2 or later) and returns to the previous version. 400 FIRST_VERSION for\nversion 1 (delete the form instead); 409 when someone else has it checked out.","operationId":"discard_draft_api_forms__id__draft_delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/versions/{version}/publish":{"post":{"tags":["Forms"],"summary":"Publish a form version","description":"Draft -> Published. The form's previously Published version becomes Retired. 409 VERSION_NOT_DRAFT otherwise.","operationId":"publish_version_api_forms__id__versions__version__publish_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"description":"FormDefinitionVersion.Version (1, 2, 3, ...)","title":"Version"},"description":"FormDefinitionVersion.Version (1, 2, 3, ...)"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/versions/{version}/retire":{"post":{"tags":["Forms"],"summary":"Retire a form version","description":"Published -> Retired. 409 VERSION_NOT_PUBLISHED otherwise.","operationId":"retire_version_api_forms__id__versions__version__retire_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"description":"FormDefinitionVersion.Version (1, 2, 3, ...)","title":"Version"},"description":"FormDefinitionVersion.Version (1, 2, 3, ...)"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/schema":{"get":{"tags":["Forms"],"summary":"Get a form's schema","description":"The schema of one version, with the theme it renders with.","operationId":"get_form_schema_api_forms__id__schema_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Specific version; default is the latest","title":"Version"},"description":"Specific version; default is the latest"},{"name":"publishedOnly","in":"query","required":false,"schema":{"type":"boolean","description":"Return the latest Published version","default":false,"title":"Publishedonly"},"description":"Return the latest Published version"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSchemaOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Forms"],"summary":"Replace a form's schema","description":"Saves the schema to the latest version, a Draft the caller has checked out (409 otherwise).","operationId":"replace_form_schema_api_forms__id__schema_put","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"FormDefinition.Id","title":"Id"},"description":"FormDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSchemaReplace"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormDefinitionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/rules":{"get":{"tags":["Forms"],"summary":"List rules for a form","description":"Returns visibility/condition rules for the form or application.","operationId":"get_form_rules_api_forms__id__rules_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"FormDefinition.Id or 0","title":"Id"},"description":"FormDefinition.Id or 0"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/rules/{rule_key}":{"get":{"tags":["Forms"],"summary":"Get rule details for a form","operationId":"get_form_rule_details_api_forms__id__rules__rule_key__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"rule_key","in":"path","required":true,"schema":{"type":"string","title":"Rule Key"}},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{id}/rules/{rule_id}/evaluate":{"post":{"tags":["Forms"],"summary":"Evaluate a visibility rule for a form","operationId":"evaluate_form_visibility_rule_api_forms__id__rules__rule_id__evaluate_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleEvaluationRequestDto"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleEvaluationResponseDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/themes":{"post":{"tags":["Themes"],"summary":"Create a theme","description":"Creates the theme with Version 1 as Draft. ThemeKey is derived from the name.","operationId":"create_theme_api_themes_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateThemeDto"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeDetailDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Themes"],"summary":"List themes","operationId":"get_themes_api_themes_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_ThemeListDto_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/themes/active":{"get":{"tags":["Themes"],"summary":"Get active theme","operationId":"get_active_theme_api_themes_active_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ThemeDetailDto"},{"type":"null"}],"title":"Response Get Active Theme Api Themes Active Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/themes/{id}":{"get":{"tags":["Themes"],"summary":"Get a theme","operationId":"get_theme_api_themes__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Theme.Id","title":"Id"},"description":"Theme.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeDetailDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Themes"],"summary":"Update a theme","description":"The layout is saved to the latest Draft version, or to a new Draft when the latest is published.","operationId":"update_theme_api_themes__id__patch","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Theme.Id","title":"Id"},"description":"Theme.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since.","title":"If-Match"},"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThemeDto"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeDetailDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Themes"],"summary":"Delete a theme","description":"Soft delete: Theme.IsActive = false.","operationId":"delete_theme_api_themes__id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Theme.Id","title":"Id"},"description":"Theme.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since.","title":"If-Match"},"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/themes/{id}/clone":{"post":{"tags":["Themes"],"summary":"Clone a theme","description":"Creates '<name> (Copy)' as a new Draft theme with the latest layout.","operationId":"clone_theme_api_themes__id__clone_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Theme.Id","title":"Id"},"description":"Theme.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeDetailDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/themes/{id}/publish":{"post":{"tags":["Themes"],"summary":"Publish a theme","description":"Publishes the latest version and sets it as Theme.CurrentPublishedVersionId.","operationId":"publish_theme_api_themes__id__publish_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Theme.Id","title":"Id"},"description":"Theme.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeDetailDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/themes/{id}/export":{"get":{"tags":["Themes"],"summary":"Export a theme","operationId":"export_theme_api_themes__id__export_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Theme.Id","title":"Id"},"description":"Theme.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeExportDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates":{"get":{"tags":["Templates"],"summary":"List templates","description":"Active templates of the application, each with its latest version.","operationId":"list_templates_api_templates_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"templateType","in":"query","required":false,"schema":{"anyOf":[{"enum":["Document","Alert","Email","Sms","Report","Page"],"type":"string"},{"type":"null"}],"title":"Templatetype"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in name, templateKey and description","title":"Q"},"description":"Search in name, templateKey and description"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_TemplateOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Templates"],"summary":"Create a template","description":"Creates the template with Version 1 as Draft.","operationId":"create_template_api_templates_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/{id}":{"get":{"tags":["Templates"],"summary":"Get a template","operationId":"get_template_api_templates__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template.Id","title":"Id"},"description":"Template.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Templates"],"summary":"Update a template","description":"Partial update. TemplateSchemaJson and ThemeId are written to the latest version while it is Draft;\nonce it is published, a new Draft version is created.","operationId":"update_template_api_templates__id__patch","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template.Id","title":"Id"},"description":"Template.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since.","title":"If-Match"},"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Templates"],"summary":"Delete a template","description":"Soft delete: Template.IsActive = false.","operationId":"delete_template_api_templates__id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template.Id","title":"Id"},"description":"Template.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since.","title":"If-Match"},"description":"RowVersion from a previous read. When sent, the write fails with 412 if the row changed since."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/{id}/versions":{"get":{"tags":["Templates"],"summary":"List a template's versions","operationId":"list_versions_api_templates__id__versions_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template.Id","title":"Id"},"description":"Template.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_TemplateOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/{id}/publish":{"post":{"tags":["Templates"],"summary":"Publish a template","description":"Publishes the latest version, pins its theme's current published version, sets it as\nTemplate.CurrentPublishedVersionId and retires the version it replaces.","operationId":"publish_template_api_templates__id__publish_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template.Id","title":"Id"},"description":"Template.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/{id}/clone":{"post":{"tags":["Templates"],"summary":"Clone a template","description":"Creates '<name> (Copy)' as a new Draft template with the latest content.","operationId":"clone_template_api_templates__id__clone_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template.Id","title":"Id"},"description":"Template.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/{id}/schema":{"get":{"tags":["Templates"],"summary":"Get a template's content","description":"The template content with the theme it renders with (pinned theme version once published).","operationId":"get_template_schema_api_templates__id__schema_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template.Id","title":"Id"},"description":"Template.Id"},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Specific version; default is the latest","title":"Version"},"description":"Specific version; default is the latest"},{"name":"publishedOnly","in":"query","required":false,"schema":{"type":"boolean","description":"Return the current published version","default":false,"title":"Publishedonly"},"description":"Return the current published version"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateSchemaOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/form-designer/messages":{"post":{"tags":["Forms Designer Assistant"],"summary":"Chat with the forms designer copilot","description":"Takes the current form sketch and an edit request; returns the actions the designer applies (add/update/delete field, add section, replace schema, ask questions).","operationId":"forms_designer_assistant_message_api_ai_form_designer_messages_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FormsDesignerAssistantRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormsDesignerAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/form-designer/import-jobs":{"post":{"tags":["Forms Designer Assistant"],"summary":"Start recreating a form from an image or PDF","description":"Queues a background extraction job: 202 Accepted with a Location header to poll (GET /import-jobs/{id}).","operationId":"forms_designer_from_image_api_ai_form_designer_import_jobs_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_forms_designer_from_image_api_ai_form_designer_import_jobs_post"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormsFromImageJobStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/form-designer/import-jobs/{id}":{"get":{"tags":["Forms Designer Assistant"],"summary":"Get a form-from-image job","description":"Progress of an extraction job; formSchema is present once status is completed. Works from any replica.","operationId":"forms_designer_from_image_job_api_ai_form_designer_import_jobs__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormsFromImageJobStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/form-designer/data-dictionary-sync":{"post":{"tags":["Forms Designer Assistant"],"summary":"Bind form fields to a data dictionary","description":"Called on save: creates a DataDictionary with one DataItem per field (or reuses the bound one) and fills in the bindings.","operationId":"forms_designer_sync_datatype_api_ai_form_designer_data_dictionary_sync_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormsSyncDatatypeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormsSyncDatatypeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/form-rules":{"get":{"tags":["Form Rules"],"summary":"List visibility rules","description":"Active, enabled RuleDefinition rows of RuleType 'Condition' (scoped to X-App-Id when sent).","operationId":"get_visibility_rules_api_form_rules_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_RuleDto_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/form-rules/{id}/evaluate":{"post":{"tags":["Form Rules"],"summary":"Evaluate a visibility rule","operationId":"evaluate_visibility_rule_api_form_rules__id__evaluate_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"RuleDefinition.Id","title":"Id"},"description":"RuleDefinition.Id"},{"name":"X-App-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleEvaluationRequestDto"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleEvaluationResponseDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["Health"],"summary":"Service health status","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/stats":{"get":{"tags":["Health"],"summary":"Application operational runtime statistics","description":"Returns service name, current version, process uptime in seconds, and health status.","operationId":"api_stats_api_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AiCreateFormIn":{"properties":{"prompt":{"type":"string","minLength":1,"title":"Prompt","description":"Single sentence describing the form to generate"}},"type":"object","required":["prompt"],"title":"AiCreateFormIn"},"AiCreateFormOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"FormDefinition.Id"},"name":{"type":"string","title":"Name"},"formType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formtype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"applicationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Applicationid"},"isActive":{"type":"boolean","title":"Isactive"},"createdAtUtc":{"type":"string","format":"date-time","title":"Createdatutc"},"createdByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Createdbyuserid"},"partnerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Partnerid","description":"Partner the form belongs to"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partnername"},"formDefinitionVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Formdefinitionversionid","description":"FormDefinitionVersion.Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus"},"isEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isenabled"},"publishedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Publishedatutc"},"versionCreatedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Versioncreatedatutc","description":"When this version was created (CreatedAtUtc is the form's)"},"updatedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedatutc"},"updatedNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatednotes"},"formSchema":{"title":"Formschema","description":"The version's form schema (parsed JSON)"},"themeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeid","description":"Theme the version uses"},"themeVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeversionid","description":"Theme version pinned when the version was published"},"isCheckedOut":{"type":"boolean","title":"Ischeckedout","description":"The latest version is a Draft checked out (and not expired)","default":false},"checkedOutByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Checkedoutbyuserid","description":"UserAccount.Id holding the check-out"},"checkedOutByName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkedoutbyname"},"checkedOutAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Checkedoutatutc"},"checkoutExpiresAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Checkoutexpiresatutc","description":"The check-out lapses after this time"},"checkoutNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkoutnotes"},"checkedInAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Checkedinatutc"},"checkinNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkinnotes"},"rowVersion":{"type":"string","title":"Rowversion","description":"FormDefinition concurrency token (also the ETag). Send it back in If-Match to reject stale writes."},"matchedDataType":{"anyOf":[{"$ref":"#/components/schemas/DataDictionaryRef"},{"type":"null"}],"description":"DataDictionary the fields came from (null for explicit or template fields)."},"extracted":{"type":"object","title":"Extracted","description":"Intent extracted from the prompt."},"message":{"type":"string","title":"Message"},"executionTimeSec":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Executiontimesec"}},"type":"object","required":["id","name","isActive","createdAtUtc","rowVersion","message"],"title":"AiCreateFormOut","description":"The created form (Version 1, Draft) plus how it was generated."},"AiFormAgentOut":{"properties":{"fieldValues":{"type":"object","title":"Fieldvalues","description":"Suggested value per field id"},"assistantReply":{"type":"string","title":"Assistantreply","default":""},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"},"unfilledFieldIds":{"items":{"type":"string"},"type":"array","title":"Unfilledfieldids","description":"Fields the document had no value for"},"formId":{"type":"string","format":"uuid","title":"Formid","description":"FormDefinition.Id"},"formDefinitionVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Formdefinitionversionid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"formType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formtype"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"model":{"type":"string","title":"Model"},"temperature":{"type":"number","title":"Temperature"},"prompt":{"type":"string","title":"Prompt"},"fillMode":{"type":"string","enum":["standard","guided","hybrid"],"title":"Fillmode","default":"standard"},"extractedEntities":{"items":{"type":"object"},"type":"array","title":"Extractedentities"},"filledSchema":{"items":{"type":"object"},"type":"array","title":"Filledschema"}},"type":"object","required":["formId","model","temperature","prompt","filledSchema"],"title":"AiFormAgentOut","description":"Autofill of a saved form: the shared result plus the form, the model used and the filled schema."},"AutofillResult":{"properties":{"fieldValues":{"type":"object","title":"Fieldvalues","description":"Suggested value per field id"},"assistantReply":{"type":"string","title":"Assistantreply","default":""},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"},"unfilledFieldIds":{"items":{"type":"string"},"type":"array","title":"Unfilledfieldids","description":"Fields the document had no value for"}},"type":"object","title":"AutofillResult","description":"Result of every autofill route."},"Body_ai_form_agent_endpoint_api_ai_forms__id__autofill_post":{"properties":{"document":{"type":"string","contentMediaType":"application/octet-stream","title":"Document","description":"Upload a document from your PC (PDF, Word, or text file)"},"prompt":{"type":"string","title":"Prompt","description":"Instructions for how the AI should fill the form","default":"Help the user complete task forms by autofilling fields from available documents, suggesting field values, and identifying missing inputs."},"model":{"anyOf":[{"type":"string","enum":["gpt-4.1-mini","gpt-4.1","gpt-4o"]},{"type":"null"}],"title":"Model","description":"gpt-4.1-mini, gpt-4.1 or gpt-4o; omit for the server default"},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature","description":"Sampling temperature (0-2); default 0.2"}},"type":"object","required":["document"],"title":"Body_ai_form_agent_endpoint_api_ai_forms__id__autofill_post"},"Body_autofill_form_upload_api_ai_forms_autofill_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Applicant/data document (.docx, .txt, PDF)"},"formSchema":{"type":"string","title":"Formschema","description":"JSON array of form columns/components"},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["file","formSchema"],"title":"Body_autofill_form_upload_api_ai_forms_autofill_upload_post"},"Body_forms_designer_from_image_api_ai_form_designer_import_jobs_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Form image or PDF to recreate"},"message":{"type":"string","title":"Message","default":""},"formId":{"type":"string","title":"Formid","default":""},"createDataItems":{"type":"boolean","title":"Createdataitems","description":"false: return the fields unbound and create no data dictionary (the caller binds them)","default":true}},"type":"object","required":["file"],"title":"Body_forms_designer_from_image_api_ai_form_designer_import_jobs_post"},"CreateThemeDto":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"layout":{"title":"Layout"}},"type":"object","required":["name","layout"],"title":"CreateThemeDto"},"DataDictionaryRef":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"DataDictionary.Id; null when the fields were not from a dictionary"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","title":"DataDictionaryRef"},"FormAgentCumulativeSummaryRequest":{"properties":{"documentSummaries":{"items":{"$ref":"#/components/schemas/FormAgentDocumentSummary"},"type":"array","minItems":1,"title":"Documentsummaries"},"currentFieldValues":{"additionalProperties":{"type":"string"},"type":"object","title":"Currentfieldvalues"},"unfilledFieldIds":{"items":{"type":"string"},"type":"array","title":"Unfilledfieldids"},"formSchema":{"anyOf":[{},{"type":"null"}],"title":"Formschema"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"}},"type":"object","required":["documentSummaries"],"title":"FormAgentCumulativeSummaryRequest"},"FormAgentCumulativeSummaryResponse":{"properties":{"assistantReply":{"type":"string","title":"Assistantreply"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["assistantReply"],"title":"FormAgentCumulativeSummaryResponse"},"FormAgentDocument":{"properties":{"filename":{"type":"string","title":"Filename","default":"document.docx"},"mimeType":{"type":"string","title":"Mimetype","default":""},"contentBase64":{"type":"string","minLength":1,"title":"Contentbase64"}},"type":"object","required":["contentBase64"],"title":"FormAgentDocument"},"FormAgentDocumentSummary":{"properties":{"filename":{"type":"string","title":"Filename","default":"document"},"assistantReply":{"type":"string","minLength":1,"title":"Assistantreply"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["assistantReply"],"title":"FormAgentDocumentSummary"},"FormAgentGenerateRequest":{"properties":{"prompt":{"type":"string","minLength":3,"title":"Prompt"},"formSchema":{"title":"Formschema"},"documentText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Documenttext"},"document":{"anyOf":[{"$ref":"#/components/schemas/FormAgentDocument"},{"type":"null"}]},"model":{"anyOf":[{"type":"string","enum":["gpt-4.1-mini","gpt-4.1","gpt-4o"]},{"type":"null"}],"title":"Model","description":"One of gpt-4.1-mini, gpt-4.1, gpt-4o. Omit to use the server default (OPENAI_FORMS_AUTOFILL_MODEL / OPENAI_FORMS_MODEL)."},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature","description":"Sampling temperature; omit for the model default."},"context":{"type":"object","title":"Context"}},"type":"object","required":["prompt","formSchema"],"title":"FormAgentGenerateRequest"},"FormCheckRequest":{"properties":{"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"FormCheckRequest","description":"Optional notes recorded with a check-out or check-in."},"FormDefinitionCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"formType":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Formtype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"formSchema":{"anyOf":[{"type":"string"},{"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Formschema","description":"JSON array/object (a JSON string is also accepted)."},"themeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeid","description":"Theme of the same application the form renders with."},"partnerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Partnerid","description":"Partner of the same application the form belongs to (usually with FormType 'Partner')."},"copyFromFormDefinitionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Copyfromformdefinitionid"}},"type":"object","required":["name"],"title":"FormDefinitionCreate","example":{"description":"Captured at intake","formSchema":[],"formType":"Entry","name":"Loan Application Form"}},"FormDefinitionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"FormDefinition.Id"},"name":{"type":"string","title":"Name"},"formType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formtype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"applicationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Applicationid"},"isActive":{"type":"boolean","title":"Isactive"},"createdAtUtc":{"type":"string","format":"date-time","title":"Createdatutc"},"createdByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Createdbyuserid"},"partnerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Partnerid","description":"Partner the form belongs to"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partnername"},"formDefinitionVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Formdefinitionversionid","description":"FormDefinitionVersion.Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus"},"isEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isenabled"},"publishedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Publishedatutc"},"versionCreatedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Versioncreatedatutc","description":"When this version was created (CreatedAtUtc is the form's)"},"updatedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedatutc"},"updatedNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatednotes"},"formSchema":{"title":"Formschema","description":"The version's form schema (parsed JSON)"},"themeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeid","description":"Theme the version uses"},"themeVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeversionid","description":"Theme version pinned when the version was published"},"isCheckedOut":{"type":"boolean","title":"Ischeckedout","description":"The latest version is a Draft checked out (and not expired)","default":false},"checkedOutByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Checkedoutbyuserid","description":"UserAccount.Id holding the check-out"},"checkedOutByName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkedoutbyname"},"checkedOutAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Checkedoutatutc"},"checkoutExpiresAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Checkoutexpiresatutc","description":"The check-out lapses after this time"},"checkoutNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkoutnotes"},"checkedInAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Checkedinatutc"},"checkinNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkinnotes"},"rowVersion":{"type":"string","title":"Rowversion","description":"FormDefinition concurrency token (also the ETag). Send it back in If-Match to reject stale writes."}},"type":"object","required":["id","name","isActive","createdAtUtc","rowVersion"],"title":"FormDefinitionOut"},"FormDefinitionUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"formType":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Formtype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"formSchema":{"anyOf":[{"type":"string"},{"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Formschema"},"themeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeid","description":"Theme of the same application; send null to remove the theme."},"partnerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Partnerid","description":"Partner of the same application; send null to remove the partner."},"updatedNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatednotes","description":"Stored on the version that receives formSchema or themeId."}},"type":"object","title":"FormDefinitionUpdate"},"FormSchemaOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"FormDefinition.Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"formType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formtype"},"partnerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Partnerid"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partnername"},"formDefinitionVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Formdefinitionversionid"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus"},"formSchema":{"title":"Formschema"},"theme":{"anyOf":[{"$ref":"#/components/schemas/ResolvedThemeOut"},{"type":"null"}]}},"type":"object","required":["id"],"title":"FormSchemaOut"},"FormSchemaReplace":{"properties":{"formSchema":{"anyOf":[{"type":"string"},{"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Formschema","description":"JSON array/object (a JSON string is also accepted)."}},"type":"object","required":["formSchema"],"title":"FormSchemaReplace"},"FormsAssistantQuestion":{"properties":{"id":{"type":"string","title":"Id"},"text":{"type":"string","title":"Text"},"type":{"type":"string","enum":["text","radio","select"],"title":"Type"},"options":{"anyOf":[{"items":{"$ref":"#/components/schemas/FormsAssistantQuestionOption"},"type":"array"},{"type":"null"}],"title":"Options"},"required":{"type":"boolean","title":"Required","default":true},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Defaultvalue"},"hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint"}},"type":"object","required":["id","text","type"],"title":"FormsAssistantQuestion"},"FormsAssistantQuestionOption":{"properties":{"label":{"type":"string","title":"Label"},"value":{"type":"string","title":"Value"}},"type":"object","required":["label","value"],"title":"FormsAssistantQuestionOption"},"FormsDesignerAssistantAction":{"properties":{"type":{"type":"string","enum":["ask_questions","add_field","update_field","delete_field","add_section","replace_schema","clarify"],"title":"Type"},"questions":{"anyOf":[{"items":{"$ref":"#/components/schemas/FormsAssistantQuestion"},"type":"array"},{"type":"null"}],"title":"Questions"},"pendingAction":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Pendingaction"},"dataType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Datatype"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"columnId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Columnid"},"afterFieldId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Afterfieldid"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"field":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Field"},"fieldId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fieldid"},"updates":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Updates"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"fields":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Fields"},"formSchema":{"anyOf":[{},{"type":"null"}],"title":"Formschema"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["type"],"title":"FormsDesignerAssistantAction"},"FormsDesignerAssistantRequest":{"properties":{"message":{"type":"string","title":"Message","default":""},"formSchema":{"anyOf":[{},{"type":"null"}],"title":"Formschema"},"selectedFieldId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selectedfieldid"},"selectedColumnId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selectedcolumnid"},"formId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formid"},"questionAnswers":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Questionanswers"},"pendingAction":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Pendingaction"}},"type":"object","title":"FormsDesignerAssistantRequest"},"FormsDesignerAssistantResponse":{"properties":{"assistantReply":{"type":"string","title":"Assistantreply","default":""},"actions":{"items":{"$ref":"#/components/schemas/FormsDesignerAssistantAction"},"type":"array","title":"Actions"}},"type":"object","title":"FormsDesignerAssistantResponse"},"FormsFromImageJobStatus":{"properties":{"id":{"type":"string","title":"Id","description":"Import job id"},"status":{"type":"string","enum":["queued","running","completed","failed"],"title":"Status"},"totalPages":{"type":"integer","title":"Totalpages","default":1},"currentPage":{"type":"integer","title":"Currentpage","default":0},"percent":{"type":"integer","title":"Percent","default":0},"message":{"type":"string","title":"Message","default":""},"assistantReply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistantreply"},"formSchema":{"anyOf":[{},{"type":"null"}],"title":"Formschema"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"executionTimeSec":{"type":"number","title":"Executiontimesec","default":0}},"type":"object","required":["id","status"],"title":"FormsFromImageJobStatus"},"FormsSyncDatatypeRequest":{"properties":{"formSchema":{"title":"Formschema"},"formId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formid"}},"type":"object","required":["formSchema"],"title":"FormsSyncDatatypeRequest"},"FormsSyncDatatypeResponse":{"properties":{"formSchema":{"anyOf":[{},{"type":"null"}],"title":"Formschema"},"synced":{"type":"boolean","title":"Synced","default":false},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","title":"FormsSyncDatatypeResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PageMeta":{"properties":{"page":{"type":"integer","title":"Page"},"pageSize":{"type":"integer","title":"Pagesize"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["page","pageSize","total"],"title":"PageMeta"},"Page_FormDefinitionOut_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FormDefinitionOut"},"type":"array","title":"Items"},"meta":{"$ref":"#/components/schemas/PageMeta"}},"type":"object","required":["items","meta"],"title":"Page[FormDefinitionOut]"},"Page_RuleDto_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RuleDto"},"type":"array","title":"Items"},"meta":{"$ref":"#/components/schemas/PageMeta"}},"type":"object","required":["items","meta"],"title":"Page[RuleDto]"},"Page_TemplateOut_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TemplateOut"},"type":"array","title":"Items"},"meta":{"$ref":"#/components/schemas/PageMeta"}},"type":"object","required":["items","meta"],"title":"Page[TemplateOut]"},"Page_ThemeListDto_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ThemeListDto"},"type":"array","title":"Items"},"meta":{"$ref":"#/components/schemas/PageMeta"}},"type":"object","required":["items","meta"],"title":"Page[ThemeListDto]"},"ResolvedThemeOut":{"properties":{"themeId":{"type":"string","format":"uuid","title":"Themeid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"themeKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Themekey"},"themeVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeversionid"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus"},"layout":{"title":"Layout"},"isPinned":{"type":"boolean","title":"Ispinned","description":"True when the version pinned at publish is used"}},"type":"object","required":["themeId","isPinned"],"title":"ResolvedThemeOut","description":"The theme a form or template renders with."},"RuleDto":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","label"],"title":"RuleDto"},"RuleEvaluationRequestDto":{"properties":{"values":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Values"}},"type":"object","title":"RuleEvaluationRequestDto"},"RuleEvaluationResponseDto":{"properties":{"isVisible":{"type":"boolean","title":"Isvisible"}},"type":"object","required":["isVisible"],"title":"RuleEvaluationResponseDto"},"TemplateCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"templateKey":{"anyOf":[{"type":"string","maxLength":100,"pattern":"^[a-z0-9_-]+$"},{"type":"null"}],"title":"Templatekey","description":"Unique per application; lowercase letters, digits, '-' and '_'. Derived from Name when omitted."},"templateType":{"anyOf":[{"type":"string","enum":["Document","Alert","Email","Sms","Report","Page"]},{"type":"null"}],"title":"Templatetype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"templateSchema":{"anyOf":[{"type":"string"},{"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Templateschema","description":"JSON object or array; defaults to {}."},"themeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeid","description":"Theme of the same application."}},"type":"object","required":["name"],"title":"TemplateCreate","example":{"description":"Sent when the loan offer is generated","name":"Offer ready","templateSchema":{"body":"Dear {{applicantName}}, ...","subject":"Your loan offer"},"templateType":"Email"}},"TemplateOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Template.Id"},"name":{"type":"string","title":"Name"},"templateKey":{"type":"string","title":"Templatekey"},"templateType":{"anyOf":[{"type":"string","enum":["Document","Alert","Email","Sms","Report","Page"]},{"type":"null"}],"title":"Templatetype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"applicationId":{"type":"string","format":"uuid","title":"Applicationid"},"isActive":{"type":"boolean","title":"Isactive"},"currentPublishedVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Currentpublishedversionid"},"createdAtUtc":{"type":"string","format":"date-time","title":"Createdatutc"},"createdByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Createdbyuserid"},"updatedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedatutc"},"templateVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Templateversionid","description":"TemplateVersion.Id"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus"},"publishedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Publishedatutc"},"updatedNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatednotes"},"themeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeid"},"themeVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeversionid","description":"Theme version pinned when the version was published"},"templateSchema":{"title":"Templateschema"},"rowVersion":{"type":"string","title":"Rowversion","description":"Template concurrency token (also the ETag). Send it back in If-Match to reject stale writes."}},"type":"object","required":["id","name","templateKey","applicationId","isActive","createdAtUtc","rowVersion"],"title":"TemplateOut"},"TemplateSchemaOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Template.Id"},"name":{"type":"string","title":"Name"},"templateKey":{"type":"string","title":"Templatekey"},"templateType":{"anyOf":[{"type":"string","enum":["Document","Alert","Email","Sms","Report","Page"]},{"type":"null"}],"title":"Templatetype"},"templateVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Templateversionid"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus"},"templateSchema":{"title":"Templateschema"},"theme":{"anyOf":[{"$ref":"#/components/schemas/ResolvedThemeOut"},{"type":"null"}]}},"type":"object","required":["id","name","templateKey"],"title":"TemplateSchemaOut"},"TemplateUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"templateType":{"anyOf":[{"type":"string","enum":["Document","Alert","Email","Sms","Report","Page"]},{"type":"null"}],"title":"Templatetype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"templateSchema":{"anyOf":[{"type":"string"},{"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"Templateschema"},"themeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeid","description":"Theme of the same application; send null to remove the theme."},"updatedNotes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatednotes"}},"type":"object","title":"TemplateUpdate"},"ThemeDetailDto":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"themeKey":{"type":"string","title":"Themekey"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Latest ThemeVersion.Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus","description":"Status of the latest version"},"currentPublishedVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Currentpublishedversionid"},"isPublished":{"type":"boolean","title":"Ispublished","description":"True when the theme has a current published version"},"createdAtUtc":{"type":"string","format":"date-time","title":"Createdatutc"},"updatedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedatutc"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"themeVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Themeversionid"},"publishedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Publishedatutc"},"layout":{"title":"Layout"},"rowVersion":{"type":"string","title":"Rowversion","description":"Concurrency token (also the ETag). Send it back in If-Match to reject stale writes."}},"type":"object","required":["id","themeKey","isPublished","createdAtUtc","rowVersion"],"title":"ThemeDetailDto"},"ThemeExportDto":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"layout":{"title":"Layout"}},"type":"object","required":["layout"],"title":"ThemeExportDto"},"ThemeListDto":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"themeKey":{"type":"string","title":"Themekey"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Latest ThemeVersion.Version"},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["Draft","Published","Retired"]},{"type":"null"}],"title":"Lifecyclestatus","description":"Status of the latest version"},"currentPublishedVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Currentpublishedversionid"},"isPublished":{"type":"boolean","title":"Ispublished","description":"True when the theme has a current published version"},"createdAtUtc":{"type":"string","format":"date-time","title":"Createdatutc"},"updatedAtUtc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedatutc"}},"type":"object","required":["id","themeKey","isPublished","createdAtUtc"],"title":"ThemeListDto"},"UpdateThemeDto":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"layout":{"title":"Layout"}},"type":"object","required":["name","layout"],"title":"UpdateThemeDto"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"Enter internal service auth secret (e.g. wf_internal_...)","in":"header","name":"X-Internal-Auth"}}},"tags":[{"name":"AI Form Agent","description":"Multi-turn, conversational AI agent workflows for dynamic form creation, field refinement, and document-assisted form extraction."},{"name":"AI Forms","description":"Direct AI-powered form generation from natural-language prompts, layout schemas, and document OCR."},{"name":"Forms Designer Assistant","description":"AI-powered design assistant for form structures, field layout, form import from images/PDFs, and data dictionary sync."},{"name":"Forms","description":"Form definitions and their versions in `FormDefinition` / `FormDefinitionVersion`: list, search, create, update, delete, publish/retire a version, and read or replace the schema."},{"name":"Form Rules","description":"Dynamic form field visibility, state validation, and business rule expression evaluation from `Scripts`."},{"name":"Themes","description":"Form visual styling, layout theme JSON definitions, and versioned theme configurations in `Theme` and `ThemeVersion`."},{"name":"Templates","description":"Versioned document, alert, email, SMS, report and page templates in `Template` and `TemplateVersion`, optionally rendered with a pinned theme version."},{"name":"Audit","description":"Operation audit logging, error diagnostics, and AI token consumption accounting in `AiTokenUsage`."},{"name":"Health","description":"Operational health checks, runtime metrics, and availability diagnostics."}]}