Update a form
PATCH /v1/forms/{form}
- Scope
forms:edit- Roles
- admin, scheduler
Update an existing form. Groups and Fields are fully replaced. On a Contact form a recipient list (form.notifyTo, notifyCc, notifyBcc) that is not sent is left as stored, and one sent empty is cleared; the module type cannot change once the form has submissions.
Parameters
Path parameters
| Name | Type | Description |
|---|---|---|
form required | integer | Form ID |
Every call also sends Authorization and X-Tenant-ID; see Getting started.
Request body required
3 top-level fields; 2 hold nested fields, listed below.
| Field | Type | Description |
|---|---|---|
scope | string or null | external requires form.submissionStatus and form.externalVisibility. One of: |
form required | object (42 nested) | |
groups required | array of object (14 nested) |
Nested fields
form 42 fields
| Field | Type | Description |
|---|---|---|
form.id | string or null | Form code of an existing form. |
form.name required | string | max length 255. Example |
form.description | string or null | |
form.isPublished | boolean or null | Publishing turns on the stricter field rules. Example |
form.status required | object | |
form.status.id | integer or string | Example |
form.status.label | string or null | Example |
form.moduleType required | object | The module the form collects, such as assignment, shift, client or consumer. |
form.moduleType.id | integer or string | Example |
form.moduleType.label | string or null | Example |
form.submissionStatus | object | Status a submission lands in. Required when scope is external. |
form.submissionStatus.id | integer or string | Example |
form.submissionStatus.label | string or null | Example |
form.externalVisibility | object or null | Required for an external form. |
form.externalVisibility.id | string | One of: |
form.externalVisibility.label | string | |
form.assignTo | object or null | |
form.assignTo.id | string | |
form.assignTo.label | string | |
form.assignTo.isCustom | boolean or null | |
form.clientId | array of object or null | |
form.clientId[].id | integer or string | Example |
form.clientId[].label | string or null | Example |
form.consumerId | array of object or null | |
form.consumerId[].id | integer or string | Example |
form.consumerId[].label | string or null | Example |
form.serviceProviderId | array of object or null | |
form.serviceProviderId[].id | integer or string | Example |
form.serviceProviderId[].label | string or null | Example |
form.applicableLocationId | array of object or null | |
form.applicableLocationId[].id | integer or string | Example |
form.applicableLocationId[].label | string or null | Example |
form.financeReferenceId | array of object or null | |
form.financeReferenceId[].id | integer or string | Example |
form.financeReferenceId[].label | string or null | Example |
form.multiStep | boolean or null | Show groups that start a step as separate pages. |
form.reviewStep | boolean or null | Add a review page before submit. |
form.settings | object or null | |
form.settings.thankYouMessage | string or null | max length 500. |
form.notifyTo | array of string or null | Submission notice recipients: email addresses. |
form.notifyCc | array of string or null | |
form.notifyBcc | array of string or null |
groups 14 fields
| Field | Type | Description |
|---|---|---|
groups[].id | integer or null | Existing group to keep. |
groups[].name required | string | Example |
groups[].order required | integer | Example |
groups[].startsStep | boolean or null | |
groups[].stepTitle | string or null | max length 255. |
groups[].fields required | array of object | min items 1. |
groups[].fields[].id | integer or null | Existing field to keep. |
groups[].fields[].label | string | Example |
groups[].fields[].type | string | One of: |
groups[].fields[].isRequired | boolean or null | |
groups[].fields[].isVisible | boolean or null | |
groups[].fields[].isArchived | boolean or null | |
groups[].fields[].order | integer | Example |
groups[].fields[].settings | object or null | Per-type settings: ui (placeholder, style), validation, options [{label, value}], default, selectType / checkboxType / fileType (single or multiple), maxFileSize, toggleOnLabel / toggleOffLabel, and subFields for a group field. |
Example
{
"scope": "internal",
"form": {
"id": "string",
"name": "Intake form",
"description": "string",
"isPublished": false,
"status": {
"id": 1,
"label": "Example"
},
"moduleType": {
"id": 1,
"label": "Example"
},
"submissionStatus": {
"id": 1,
"label": "Example"
},
"externalVisibility": {
"id": "public",
"label": "string"
},
"assignTo": {
"id": "string",
"label": "string",
"isCustom": true
},
"clientId": [
{
"id": 1,
"label": "Example"
}
],
"consumerId": [
{
"id": 1,
"label": "Example"
}
],
"serviceProviderId": [
{
"id": 1,
"label": "Example"
}
],
"applicableLocationId": [
{
"id": 1,
"label": "Example"
}
],
"financeReferenceId": [
{
"id": 1,
"label": "Example"
}
],
"multiStep": true,
"reviewStep": true,
"settings": {
"thankYouMessage": "string"
},
"notifyTo": [
"string"
],
"notifyCc": [
"string"
],
"notifyBcc": [
"string"
]
},
"groups": [
{
"id": 0,
"name": "Contact details",
"order": 1,
"startsStep": true,
"stepTitle": "string",
"fields": [
{
"id": 0,
"label": "Preferred contact time",
"type": "text",
"isRequired": true,
"isVisible": true,
"isArchived": true,
"order": 1,
"settings": {}
}
]
}
]
}Example request
curl -X PATCH "https://api.fetchfido.ai/v1/forms/{form}" \
-H "Authorization: Bearer $FIDO_API_KEY" \
-H "X-Tenant-ID: $FIDO_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{"scope":"internal","form":{"id":"string","name":"Intake form","description":"string","isPublished":false,"status":{"id":1,"label":"Example"},"moduleType":{"id":1,"label":"Example"},"submissionStatus":{"id":1,"label":"Example"},"externalVisibility":{"id":"public","label":"string"},"assignTo":{"id":"string","label":"string","isCustom":true},"clientId":[{"id":1,"label":"Example"}],"consumerId":[{"id":1,"label":"Example"}],"serviceProviderId":[{"id":1,"label":"Example"}],"applicableLocationId":[{"id":1,"label":"Example"}],"financeReferenceId":[{"id":1,"label":"Example"}],"multiStep":true,"reviewStep":true,"settings":{"thankYouMessage":"string"},"notifyTo":["string"],"notifyCc":["string"],"notifyBcc":["string"]},"groups":[{"id":0,"name":"Contact details","order":1,"startsStep":true,"stepTitle":"string","fields":[{"id":0,"label":"Preferred contact time","type":"text","isRequired":true,"isVisible":true,"isArchived":true,"order":1,"settings":{}}]}]}'Try it
Responses
200 Form updated successfully
Form updated successfully
{
"success": true,
"data": {
"id": 1,
"version": 2
}
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
data | object | |
data.id | integer | Example |
data.version | integer | Example |
401 Not signed in
Missing, invalid or expired API key.
{
"success": false,
"message": "Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for.",
"errors": null,
"code": "API_KEY_MISSING"
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Machine-readable reason, for branching on in client code. One of: |
403 Not allowed
Scope, tenant, IP allow-list or RBAC check failed.
{
"success": false,
"message": "You don't have permission to access this endpoint. This API key is missing the 'forms:edit' scope.",
"errors": null,
"code": ""
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Always empty on this status. Example |
429 Too many requests
Rate limit exceeded. See Retry-After.
{
"success": false,
"message": "You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds.",
"errors": null,
"code": "RATE_LIMITED"
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Machine-readable reason, for branching on in client code. One of: |