Update a form
curl --request PATCH \
--url https://api.onlyform.com/v1/forms/{formId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.onlyform.com/v1/forms/{formId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onlyform.com/v1/forms/{formId}"
payload = {}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onlyform.com/v1/forms/{formId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"public_id": "<string>",
"workspace_id": "<string>",
"name": "<string>",
"is_closed": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"links": {
"self": "<string>",
"submissions": "<string>"
},
"definition": {
"blocks": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": true,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": true,
"maxVal": true,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": [
"2023-11-07T05:31:56Z"
],
"weekStartsOn": 4,
"quotationMarks": true,
"multiSelection": true,
"randomize": true,
"alphaOrder": true,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": true,
"showDatePicker": true,
"showLabels": true,
"superSize": true,
"otherOption": true,
"otherText": "<string>",
"horizontalAlign": true,
"verticalAlign": true,
"perRow": 2,
"altText": true,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": true,
"centerLabel": true,
"rightLabel": true,
"addressOrContact": {
"firstName": {
"hide": true,
"required": true
},
"lastName": {
"hide": true,
"required": true
},
"email": {
"hide": true,
"required": true
},
"phone": {
"hide": true,
"required": true
},
"company": {
"hide": true,
"required": true
},
"address": {
"hide": true,
"required": true
},
"address2": {
"hide": true,
"required": true
},
"city": {
"hide": true,
"required": true
},
"state": {
"hide": true,
"required": true
},
"zip": {
"hide": true,
"required": true
},
"country": {
"hide": true,
"required": true
}
},
"legalText": "<string>",
"legalStopFurther": true,
"showSeconds": true,
"showTimePicker": true,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": [
"<string>"
],
"multipleFiles": true,
"maxFileSize": true,
"hide": true,
"showActions": true,
"colorOption": true,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
}
],
"settings": {
"branding": true,
"navigation": true,
"progressBar": true,
"singlePage": true,
"inlineFields": true,
"borderRadius": 123,
"numberedQuestions": true,
"responseLimit": 0,
"darkMode": true,
"closed": true,
"utm": {
"campaign": true,
"content": true,
"medium": true,
"source": true,
"term": true
},
"showTitle": true,
"closeAt": "2023-11-07T05:31:56Z",
"closedMessage": "<string>",
"duplicateField": "<string>",
"redirectUrl": "<string>",
"submitLabel": "<string>",
"cover": {
"color": "<string>",
"image": {
"id": "<string>",
"url": "<string>",
"width": 1,
"height": 1,
"base64": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
},
"theme": {
"logo": {
"id": "<string>",
"url": "<string>",
"width": 1,
"height": 1,
"base64": "<string>"
},
"background": {
"brightness": 50,
"image": {
"id": "<string>",
"url": "<string>",
"width": 1,
"height": 1,
"base64": "<string>"
}
},
"colors": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"cardForeground": "<string>",
"popover": "<string>",
"popoverForeground": "<string>",
"primary": "<string>",
"primaryForeground": "<string>",
"secondary": "<string>",
"secondaryForeground": "<string>",
"muted": "<string>",
"mutedForeground": "<string>",
"accent": "<string>",
"accentForeground": "<string>",
"destructive": "<string>",
"destructiveForeground": "<string>",
"border": "<string>",
"input": "<string>",
"ring": "<string>",
"text": "<string>",
"chart1": "<string>",
"chart2": "<string>",
"chart3": "<string>",
"chart4": "<string>",
"chart5": "<string>",
"sidebar": "<string>",
"sidebarForeground": "<string>",
"sidebarPrimary": "<string>",
"sidebarPrimaryForeground": "<string>",
"sidebarAccent": "<string>",
"sidebarAccentForeground": "<string>",
"sidebarBorder": "<string>",
"sidebarRing": "<string>",
"dark": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"cardForeground": "<string>",
"popover": "<string>",
"popoverForeground": "<string>",
"primary": "<string>",
"primaryForeground": "<string>",
"secondary": "<string>",
"secondaryForeground": "<string>",
"muted": "<string>",
"mutedForeground": "<string>",
"accent": "<string>",
"accentForeground": "<string>",
"destructive": "<string>",
"destructiveForeground": "<string>",
"border": "<string>",
"input": "<string>",
"ring": "<string>",
"text": "<string>",
"chart1": "<string>",
"chart2": "<string>",
"chart3": "<string>",
"chart4": "<string>",
"chart5": "<string>",
"sidebar": "<string>",
"sidebarForeground": "<string>",
"sidebarPrimary": "<string>",
"sidebarPrimaryForeground": "<string>",
"sidebarAccent": "<string>",
"sidebarAccentForeground": "<string>",
"sidebarBorder": "<string>",
"sidebarRing": "<string>"
}
},
"alignment": {},
"size": {},
"font": "<string>",
"logoPlacement": {},
"layout": {
"pageWidth": "<string>",
"baseFontSize": "<string>"
},
"logoSize": {
"width": 123,
"height": 123,
"radius": 123
},
"coverHeight": "<string>",
"inputs": {
"width": "<string>",
"height": "<string>",
"background": "<string>",
"placeholder": "<string>",
"border": "<string>",
"borderWidth": 123,
"radius": 123,
"marginBottom": 123,
"paddingX": 123
},
"buttons": {
"width": "<string>",
"height": "<string>",
"fontSize": 123,
"radius": 123,
"background": "<string>",
"text": "<string>",
"marginY": 123,
"paddingX": 123
},
"customCss": "<string>"
}
}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}Forms
Update a form
Replaces provided definition sections and preserves omitted sections. Requires forms:write. Send If-Match with the ETag from GET to prevent lost updates.
PATCH
https://api.onlyform.com
/
v1
/
forms
/
{formId}
Update a form
curl --request PATCH \
--url https://api.onlyform.com/v1/forms/{formId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.onlyform.com/v1/forms/{formId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onlyform.com/v1/forms/{formId}"
payload = {}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onlyform.com/v1/forms/{formId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"public_id": "<string>",
"workspace_id": "<string>",
"name": "<string>",
"is_closed": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"links": {
"self": "<string>",
"submissions": "<string>"
},
"definition": {
"blocks": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"required": true,
"properties": {
"buttonText": "<string>",
"buttonLink": "<string>",
"shareButtons": true,
"maxChars": 0,
"min": 123,
"max": 123,
"minVal": true,
"maxVal": true,
"dateSeparator": "<string>",
"disabledDays": 5,
"beforeDate": "2023-11-07T05:31:56Z",
"afterDate": "2023-11-07T05:31:56Z",
"specificDates": [
"2023-11-07T05:31:56Z"
],
"weekStartsOn": 4,
"quotationMarks": true,
"multiSelection": true,
"randomize": true,
"alphaOrder": true,
"defaultCountry": "<string>",
"from": 123,
"to": 123,
"scaleStep": 123,
"limit": 2,
"currency": "<string>",
"amount": "<string>",
"paymentGateway": "<string>",
"showFields": true,
"showDatePicker": true,
"showLabels": true,
"superSize": true,
"otherOption": true,
"otherText": "<string>",
"horizontalAlign": true,
"verticalAlign": true,
"perRow": 2,
"altText": true,
"imageAlt": "<string>",
"imageWidth": 123,
"firstLabel": "<string>",
"secondLabel": "<string>",
"thirdLabel": "<string>",
"leftLabel": true,
"centerLabel": true,
"rightLabel": true,
"addressOrContact": {
"firstName": {
"hide": true,
"required": true
},
"lastName": {
"hide": true,
"required": true
},
"email": {
"hide": true,
"required": true
},
"phone": {
"hide": true,
"required": true
},
"company": {
"hide": true,
"required": true
},
"address": {
"hide": true,
"required": true
},
"address2": {
"hide": true,
"required": true
},
"city": {
"hide": true,
"required": true
},
"state": {
"hide": true,
"required": true
},
"zip": {
"hide": true,
"required": true
},
"country": {
"hide": true,
"required": true
}
},
"legalText": "<string>",
"legalStopFurther": true,
"showSeconds": true,
"showTimePicker": true,
"videoLink": "<string>",
"pdfLink": "<string>",
"embedLink": "<string>",
"placeholderText": "<string>",
"numberFormat": "<string>",
"allowedFiles": [
"<string>"
],
"multipleFiles": true,
"maxFileSize": true,
"hide": true,
"showActions": true,
"colorOption": true,
"rule": {},
"image": {}
},
"part_of": "<string>",
"row_id": "<string>",
"choices": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"children": "<array>",
"matrix_columns": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
],
"matrix_rows": [
{
"id": "<string>",
"label": "<string>",
"image": "<unknown>",
"color": "<string>",
"row_id": "<string>",
"alt": "<string>"
}
]
}
],
"settings": {
"branding": true,
"navigation": true,
"progressBar": true,
"singlePage": true,
"inlineFields": true,
"borderRadius": 123,
"numberedQuestions": true,
"responseLimit": 0,
"darkMode": true,
"closed": true,
"utm": {
"campaign": true,
"content": true,
"medium": true,
"source": true,
"term": true
},
"showTitle": true,
"closeAt": "2023-11-07T05:31:56Z",
"closedMessage": "<string>",
"duplicateField": "<string>",
"redirectUrl": "<string>",
"submitLabel": "<string>",
"cover": {
"color": "<string>",
"image": {
"id": "<string>",
"url": "<string>",
"width": 1,
"height": 1,
"base64": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
},
"theme": {
"logo": {
"id": "<string>",
"url": "<string>",
"width": 1,
"height": 1,
"base64": "<string>"
},
"background": {
"brightness": 50,
"image": {
"id": "<string>",
"url": "<string>",
"width": 1,
"height": 1,
"base64": "<string>"
}
},
"colors": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"cardForeground": "<string>",
"popover": "<string>",
"popoverForeground": "<string>",
"primary": "<string>",
"primaryForeground": "<string>",
"secondary": "<string>",
"secondaryForeground": "<string>",
"muted": "<string>",
"mutedForeground": "<string>",
"accent": "<string>",
"accentForeground": "<string>",
"destructive": "<string>",
"destructiveForeground": "<string>",
"border": "<string>",
"input": "<string>",
"ring": "<string>",
"text": "<string>",
"chart1": "<string>",
"chart2": "<string>",
"chart3": "<string>",
"chart4": "<string>",
"chart5": "<string>",
"sidebar": "<string>",
"sidebarForeground": "<string>",
"sidebarPrimary": "<string>",
"sidebarPrimaryForeground": "<string>",
"sidebarAccent": "<string>",
"sidebarAccentForeground": "<string>",
"sidebarBorder": "<string>",
"sidebarRing": "<string>",
"dark": {
"background": "<string>",
"foreground": "<string>",
"card": "<string>",
"cardForeground": "<string>",
"popover": "<string>",
"popoverForeground": "<string>",
"primary": "<string>",
"primaryForeground": "<string>",
"secondary": "<string>",
"secondaryForeground": "<string>",
"muted": "<string>",
"mutedForeground": "<string>",
"accent": "<string>",
"accentForeground": "<string>",
"destructive": "<string>",
"destructiveForeground": "<string>",
"border": "<string>",
"input": "<string>",
"ring": "<string>",
"text": "<string>",
"chart1": "<string>",
"chart2": "<string>",
"chart3": "<string>",
"chart4": "<string>",
"chart5": "<string>",
"sidebar": "<string>",
"sidebarForeground": "<string>",
"sidebarPrimary": "<string>",
"sidebarPrimaryForeground": "<string>",
"sidebarAccent": "<string>",
"sidebarAccentForeground": "<string>",
"sidebarBorder": "<string>",
"sidebarRing": "<string>"
}
},
"alignment": {},
"size": {},
"font": "<string>",
"logoPlacement": {},
"layout": {
"pageWidth": "<string>",
"baseFontSize": "<string>"
},
"logoSize": {
"width": 123,
"height": 123,
"radius": 123
},
"coverHeight": "<string>",
"inputs": {
"width": "<string>",
"height": "<string>",
"background": "<string>",
"placeholder": "<string>",
"border": "<string>",
"borderWidth": 123,
"radius": 123,
"marginBottom": 123,
"paddingX": 123
},
"buttons": {
"width": "<string>",
"height": "<string>",
"fontSize": 123,
"radius": 123,
"background": "<string>",
"text": "<string>",
"marginY": 123,
"paddingX": 123
},
"customCss": "<string>"
}
}
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}Authorizations
A scoped key with the of_live_ prefix, generated from Profile > API keys.
Headers
Path Parameters
Pattern:
^[0-9a-fA-F]{24}$Example:
"507f1f77bcf86cd799439011"
Body
application/json
Response
Updated form.
Pattern:
^[0-9a-fA-F]{24}$Example:
"507f1f77bcf86cd799439011"
Pattern:
^[0-9a-fA-F]{24}$Example:
"507f1f77bcf86cd799439011"
Available options:
draft, published, deleted Show child attributes
Show child attributes
Form presentation model. CONVERSATIONAL is reserved for a future renderer and currently returns 422 UNSUPPORTED_FORM_TYPE when used for creation.
Available options:
SINGLE, MULTI, CONVERSATIONAL Show child attributes
Show child attributes
Was this page helpful?
⌘I