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:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | No | |
projectId | string | Yes | |
folderId | string | null | No | |
name | string | Yes | |
label | string | Yes | |
description | string | No | |
schema | object | No | |
enabled | boolean | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string |
getForm
Get a form by ID
GET
Usage:
const result = await swirls.client.forms.getForm({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
folderId | string | null | |
name | string | |
label | string | |
description | string | null | |
schema | object | null | |
enabled | boolean | |
createdAt | unknown | |
orgId | string | null | |
userId | string |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | No | |
description | string | No | |
schema | object | null | No | |
enabled | boolean | No | |
folderId | string | null | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
folderId | string | null | |
name | string | |
label | string | |
description | string | null | |
schema | object | null | |
enabled | boolean | |
createdAt | unknown | |
orgId | string | null | |
userId | string |
deleteForm
Delete a form
DELETE
Usage:
const result = await swirls.client.forms.deleteForm({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
listForms
List all forms in a project
GET
Usage:
const result = await swirls.client.forms.listForms({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
folderId | string | null | No | |
pagination | object | No |
Output:
| Field | Type | Description |
|---|---|---|
pagination | object | |
results | object[] | |
totalCount | number |
listTriggersForForm
GET
Usage:
const result = await swirls.client.forms.listTriggersForForm({
formId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
formId | string | Yes | |
pagination | object | No |
Output:
| Field | Type | Description |
|---|---|---|
pagination | object | |
results | object[] | |
totalCount | number |
listFormSubmissions
GET
Usage:
const result = await swirls.client.forms.listFormSubmissions({
formId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
formId | string | Yes | |
pagination | object | No |
Output:
| Field | Type | Description |
|---|---|---|
pagination | object | |
results | object[] | |
totalCount | number |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
formId | string | Yes | |
data | object | Yes |
Output:
| Field | Type | Description |
|---|---|---|
message | string | |
executionIds | string[] |