Create Form
Create a form for a team from module source (TSX importing “serval/forms”). The form lands as an unpublished draft unless is_published is set, in which case the module is compiled and every workflow it imports must already be published on the team.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The ID of the team.
Display name of the form, shown wherever the form is listed. Names of published items are unique per team across forms, workflows, and skills; a taken name is suffixed ("Order laptop 2") rather than rejected.
The form module source: TSX importing "serval/forms", exporting
main = view({ fn }). Saved as a draft as-is; it is compiled when the
form is published, so a broken draft can be saved and fixed later.
What the form is for, shown under the name.
Whether to publish the form after creation (optional). Publishing compiles the module and resolves every workflow it imports against the team's published workflows.
Copy-invariant identity to create the form under ("form_" + 22 alphanumerics). Leave unset and the server mints one. Set it to the source form's scoped_id when pushing configuration between teams or environments: the copy then answers to the same scoped id as its source, so the next push resolves it and updates in place instead of creating a second form that collides on name. Must not already be in use on the team.
Response
Success
The created form.

