Skip to main content
POST
Create Form

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
teamId
string
required

The ID of the team.

name
string
required

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.

content
string
required

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.

description
string

What the form is for, shown under the name.

isPublished
boolean | null

Whether to publish the form after creation (optional). Publishing compiles the module and resolves every workflow it imports against the team's published workflows.

scopedId
string | null

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

200 - application/json

Success

data
data · object

The created form.