SWIRLS_
ReferenceSDKClient

Forms

SDK reference for forms — Create and manage forms that can trigger graph executions.

Create and manage forms that can trigger graph executions.

createForm

Create a new form that can trigger graphs. The optional "schema" parameter defines the form's JSON Schema for input fields.

POST

Usage:

const result = await swirls.client.forms.createForm({
  projectId: '...',
  name: '...',
  label: '...',
})

Input:

ParameterTypeRequiredDescription
idstringNo
projectIdstringYes
folderIdstring | nullNo
namestringYes
labelstringYes
descriptionstringNo
schemaobjectNo
enabledbooleanNo

Output:

FieldTypeDescription
idstring

getForm

Get a form by ID

GET

Usage:

const result = await swirls.client.forms.getForm({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
idstring
projectIdstring
folderIdstring | null
namestring
labelstring
descriptionstring | null
schemaobject | null
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

updateForm

Update a form. The "schema" parameter defines the form's JSON Schema for input fields.

PUT

Usage:

const result = await swirls.client.forms.updateForm({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes
namestringNo
descriptionstringNo
schemaobject | nullNo
enabledbooleanNo
folderIdstring | nullNo

Output:

FieldTypeDescription
idstring
projectIdstring
folderIdstring | null
namestring
labelstring
descriptionstring | null
schemaobject | null
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

deleteForm

Delete a form

DELETE

Usage:

const result = await swirls.client.forms.deleteForm({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

listForms

List all forms in a project

GET

Usage:

const result = await swirls.client.forms.listForms({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
folderIdstring | nullNo
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

listTriggersForForm

GET

Usage:

const result = await swirls.client.forms.listTriggersForForm({
  formId: '...',
})

Input:

ParameterTypeRequiredDescription
formIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

listFormSubmissions

GET

Usage:

const result = await swirls.client.forms.listFormSubmissions({
  formId: '...',
})

Input:

ParameterTypeRequiredDescription
formIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

submitForm

Submit data to a form. The form must be enabled. Triggers associated with the form will be executed. Returns execution IDs for any triggered graphs.

POST

Usage:

const result = await swirls.client.forms.submitForm({
  formId: '...',
  data: {},
})

Input:

ParameterTypeRequiredDescription
formIdstringYes
dataobjectYes

Output:

FieldTypeDescription
messagestring
executionIdsstring[]

On this page