Update Form
curl --request PUT \
--url https://api.opnform.com/open/forms/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": 123,
"title": "<string>",
"tags": [
"<string>"
],
"language": "<string>",
"custom_domain": "<string>",
"font_family": "<string>",
"color": "<string>",
"layout_rtl": true,
"uppercase_labels": true,
"cover_picture": "<string>",
"logo_picture": "<string>",
"no_branding": true,
"transparent_background": true,
"submit_button_text": "<string>",
"submitted_text": "<string>",
"redirect_url": "<string>",
"re_fillable": true,
"re_fill_button_text": "<string>",
"confetti_on_submission": true,
"show_progress_bar": true,
"submission_retention_value": 1825,
"closes_at": "2023-11-07T05:31:56Z",
"closed_text": "<string>",
"max_submissions_count": 2,
"max_submissions_reached_text": "<string>",
"auto_save": true,
"auto_focus": true,
"enable_partial_submissions": true,
"editable_submissions": true,
"editable_submissions_button_text": "<string>",
"password": "<string>",
"use_captcha": true,
"can_be_indexed": true,
"seo_meta": {},
"custom_code": "<string>",
"database_fields_update": [
"<unknown>"
],
"properties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"help": "<string>",
"hidden": true,
"required": true,
"placeholder": "<string>"
}
]
}
'import requests
url = "https://api.opnform.com/open/forms/{id}"
payload = {
"workspace_id": 123,
"title": "<string>",
"tags": ["<string>"],
"language": "<string>",
"custom_domain": "<string>",
"font_family": "<string>",
"color": "<string>",
"layout_rtl": True,
"uppercase_labels": True,
"cover_picture": "<string>",
"logo_picture": "<string>",
"no_branding": True,
"transparent_background": True,
"submit_button_text": "<string>",
"submitted_text": "<string>",
"redirect_url": "<string>",
"re_fillable": True,
"re_fill_button_text": "<string>",
"confetti_on_submission": True,
"show_progress_bar": True,
"submission_retention_value": 1825,
"closes_at": "2023-11-07T05:31:56Z",
"closed_text": "<string>",
"max_submissions_count": 2,
"max_submissions_reached_text": "<string>",
"auto_save": True,
"auto_focus": True,
"enable_partial_submissions": True,
"editable_submissions": True,
"editable_submissions_button_text": "<string>",
"password": "<string>",
"use_captcha": True,
"can_be_indexed": True,
"seo_meta": {},
"custom_code": "<string>",
"database_fields_update": ["<unknown>"],
"properties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"help": "<string>",
"hidden": True,
"required": True,
"placeholder": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workspace_id: 123,
title: '<string>',
tags: ['<string>'],
language: '<string>',
custom_domain: '<string>',
font_family: '<string>',
color: '<string>',
layout_rtl: true,
uppercase_labels: true,
cover_picture: '<string>',
logo_picture: '<string>',
no_branding: true,
transparent_background: true,
submit_button_text: '<string>',
submitted_text: '<string>',
redirect_url: '<string>',
re_fillable: true,
re_fill_button_text: '<string>',
confetti_on_submission: true,
show_progress_bar: true,
submission_retention_value: 1825,
closes_at: '2023-11-07T05:31:56Z',
closed_text: '<string>',
max_submissions_count: 2,
max_submissions_reached_text: '<string>',
auto_save: true,
auto_focus: true,
enable_partial_submissions: true,
editable_submissions: true,
editable_submissions_button_text: '<string>',
password: '<string>',
use_captcha: true,
can_be_indexed: true,
seo_meta: {},
custom_code: '<string>',
database_fields_update: ['<unknown>'],
properties: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: '<string>',
name: '<string>',
help: '<string>',
hidden: true,
required: true,
placeholder: '<string>'
}
]
})
};
fetch('https://api.opnform.com/open/forms/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opnform.com/open/forms/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => 123,
'title' => '<string>',
'tags' => [
'<string>'
],
'language' => '<string>',
'custom_domain' => '<string>',
'font_family' => '<string>',
'color' => '<string>',
'layout_rtl' => true,
'uppercase_labels' => true,
'cover_picture' => '<string>',
'logo_picture' => '<string>',
'no_branding' => true,
'transparent_background' => true,
'submit_button_text' => '<string>',
'submitted_text' => '<string>',
'redirect_url' => '<string>',
're_fillable' => true,
're_fill_button_text' => '<string>',
'confetti_on_submission' => true,
'show_progress_bar' => true,
'submission_retention_value' => 1825,
'closes_at' => '2023-11-07T05:31:56Z',
'closed_text' => '<string>',
'max_submissions_count' => 2,
'max_submissions_reached_text' => '<string>',
'auto_save' => true,
'auto_focus' => true,
'enable_partial_submissions' => true,
'editable_submissions' => true,
'editable_submissions_button_text' => '<string>',
'password' => '<string>',
'use_captcha' => true,
'can_be_indexed' => true,
'seo_meta' => [
],
'custom_code' => '<string>',
'database_fields_update' => [
'<unknown>'
],
'properties' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => '<string>',
'name' => '<string>',
'help' => '<string>',
'hidden' => true,
'required' => true,
'placeholder' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.opnform.com/open/forms/{id}"
payload := strings.NewReader("{\n \"workspace_id\": 123,\n \"title\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"custom_domain\": \"<string>\",\n \"font_family\": \"<string>\",\n \"color\": \"<string>\",\n \"layout_rtl\": true,\n \"uppercase_labels\": true,\n \"cover_picture\": \"<string>\",\n \"logo_picture\": \"<string>\",\n \"no_branding\": true,\n \"transparent_background\": true,\n \"submit_button_text\": \"<string>\",\n \"submitted_text\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"re_fillable\": true,\n \"re_fill_button_text\": \"<string>\",\n \"confetti_on_submission\": true,\n \"show_progress_bar\": true,\n \"submission_retention_value\": 1825,\n \"closes_at\": \"2023-11-07T05:31:56Z\",\n \"closed_text\": \"<string>\",\n \"max_submissions_count\": 2,\n \"max_submissions_reached_text\": \"<string>\",\n \"auto_save\": true,\n \"auto_focus\": true,\n \"enable_partial_submissions\": true,\n \"editable_submissions\": true,\n \"editable_submissions_button_text\": \"<string>\",\n \"password\": \"<string>\",\n \"use_captcha\": true,\n \"can_be_indexed\": true,\n \"seo_meta\": {},\n \"custom_code\": \"<string>\",\n \"database_fields_update\": [\n \"<unknown>\"\n ],\n \"properties\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"help\": \"<string>\",\n \"hidden\": true,\n \"required\": true,\n \"placeholder\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.put("https://api.opnform.com/open/forms/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": 123,\n \"title\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"custom_domain\": \"<string>\",\n \"font_family\": \"<string>\",\n \"color\": \"<string>\",\n \"layout_rtl\": true,\n \"uppercase_labels\": true,\n \"cover_picture\": \"<string>\",\n \"logo_picture\": \"<string>\",\n \"no_branding\": true,\n \"transparent_background\": true,\n \"submit_button_text\": \"<string>\",\n \"submitted_text\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"re_fillable\": true,\n \"re_fill_button_text\": \"<string>\",\n \"confetti_on_submission\": true,\n \"show_progress_bar\": true,\n \"submission_retention_value\": 1825,\n \"closes_at\": \"2023-11-07T05:31:56Z\",\n \"closed_text\": \"<string>\",\n \"max_submissions_count\": 2,\n \"max_submissions_reached_text\": \"<string>\",\n \"auto_save\": true,\n \"auto_focus\": true,\n \"enable_partial_submissions\": true,\n \"editable_submissions\": true,\n \"editable_submissions_button_text\": \"<string>\",\n \"password\": \"<string>\",\n \"use_captcha\": true,\n \"can_be_indexed\": true,\n \"seo_meta\": {},\n \"custom_code\": \"<string>\",\n \"database_fields_update\": [\n \"<unknown>\"\n ],\n \"properties\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"help\": \"<string>\",\n \"hidden\": true,\n \"required\": true,\n \"placeholder\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opnform.com/open/forms/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": 123,\n \"title\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"custom_domain\": \"<string>\",\n \"font_family\": \"<string>\",\n \"color\": \"<string>\",\n \"layout_rtl\": true,\n \"uppercase_labels\": true,\n \"cover_picture\": \"<string>\",\n \"logo_picture\": \"<string>\",\n \"no_branding\": true,\n \"transparent_background\": true,\n \"submit_button_text\": \"<string>\",\n \"submitted_text\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"re_fillable\": true,\n \"re_fill_button_text\": \"<string>\",\n \"confetti_on_submission\": true,\n \"show_progress_bar\": true,\n \"submission_retention_value\": 1825,\n \"closes_at\": \"2023-11-07T05:31:56Z\",\n \"closed_text\": \"<string>\",\n \"max_submissions_count\": 2,\n \"max_submissions_reached_text\": \"<string>\",\n \"auto_save\": true,\n \"auto_focus\": true,\n \"enable_partial_submissions\": true,\n \"editable_submissions\": true,\n \"editable_submissions_button_text\": \"<string>\",\n \"password\": \"<string>\",\n \"use_captcha\": true,\n \"can_be_indexed\": true,\n \"seo_meta\": {},\n \"custom_code\": \"<string>\",\n \"database_fields_update\": [\n \"<unknown>\"\n ],\n \"properties\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"help\": \"<string>\",\n \"hidden\": true,\n \"required\": true,\n \"placeholder\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"slug": "<string>",
"title": "<string>",
"visibility": "public",
"tags": [
"<string>"
],
"language": "<string>",
"custom_domain": "<string>",
"theme": "default",
"font_family": "<string>",
"color": "<string>",
"dark_mode": "light",
"width": "centered",
"size": "sm",
"border_radius": "none",
"layout_rtl": true,
"uppercase_labels": true,
"cover_picture": "<string>",
"logo_picture": "<string>",
"no_branding": true,
"transparent_background": true,
"submit_button_text": "<string>",
"submitted_text": "<string>",
"redirect_url": "<string>",
"re_fillable": true,
"re_fill_button_text": "<string>",
"confetti_on_submission": true,
"show_progress_bar": true,
"submission_retention_value": 1825,
"submission_retention_unit": "day",
"closes_at": "2023-11-07T05:31:56Z",
"closed_text": "<string>",
"max_submissions_count": 2,
"max_submissions_reached_text": "<string>",
"auto_save": true,
"auto_focus": true,
"enable_partial_submissions": true,
"editable_submissions": true,
"editable_submissions_button_text": "<string>",
"password": "<string>",
"use_captcha": true,
"captcha_provider": "recaptcha",
"can_be_indexed": true,
"seo_meta": {},
"custom_code": "<string>",
"database_fields_update": [
"<unknown>"
],
"properties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"help": "<string>",
"hidden": true,
"required": true,
"placeholder": "<string>",
"width": "full"
}
]
}Forms
Update Form
Update an existing form. Requires forms-write.
PUT
/
open
/
forms
/
{id}
Update Form
curl --request PUT \
--url https://api.opnform.com/open/forms/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": 123,
"title": "<string>",
"tags": [
"<string>"
],
"language": "<string>",
"custom_domain": "<string>",
"font_family": "<string>",
"color": "<string>",
"layout_rtl": true,
"uppercase_labels": true,
"cover_picture": "<string>",
"logo_picture": "<string>",
"no_branding": true,
"transparent_background": true,
"submit_button_text": "<string>",
"submitted_text": "<string>",
"redirect_url": "<string>",
"re_fillable": true,
"re_fill_button_text": "<string>",
"confetti_on_submission": true,
"show_progress_bar": true,
"submission_retention_value": 1825,
"closes_at": "2023-11-07T05:31:56Z",
"closed_text": "<string>",
"max_submissions_count": 2,
"max_submissions_reached_text": "<string>",
"auto_save": true,
"auto_focus": true,
"enable_partial_submissions": true,
"editable_submissions": true,
"editable_submissions_button_text": "<string>",
"password": "<string>",
"use_captcha": true,
"can_be_indexed": true,
"seo_meta": {},
"custom_code": "<string>",
"database_fields_update": [
"<unknown>"
],
"properties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"help": "<string>",
"hidden": true,
"required": true,
"placeholder": "<string>"
}
]
}
'import requests
url = "https://api.opnform.com/open/forms/{id}"
payload = {
"workspace_id": 123,
"title": "<string>",
"tags": ["<string>"],
"language": "<string>",
"custom_domain": "<string>",
"font_family": "<string>",
"color": "<string>",
"layout_rtl": True,
"uppercase_labels": True,
"cover_picture": "<string>",
"logo_picture": "<string>",
"no_branding": True,
"transparent_background": True,
"submit_button_text": "<string>",
"submitted_text": "<string>",
"redirect_url": "<string>",
"re_fillable": True,
"re_fill_button_text": "<string>",
"confetti_on_submission": True,
"show_progress_bar": True,
"submission_retention_value": 1825,
"closes_at": "2023-11-07T05:31:56Z",
"closed_text": "<string>",
"max_submissions_count": 2,
"max_submissions_reached_text": "<string>",
"auto_save": True,
"auto_focus": True,
"enable_partial_submissions": True,
"editable_submissions": True,
"editable_submissions_button_text": "<string>",
"password": "<string>",
"use_captcha": True,
"can_be_indexed": True,
"seo_meta": {},
"custom_code": "<string>",
"database_fields_update": ["<unknown>"],
"properties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"help": "<string>",
"hidden": True,
"required": True,
"placeholder": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workspace_id: 123,
title: '<string>',
tags: ['<string>'],
language: '<string>',
custom_domain: '<string>',
font_family: '<string>',
color: '<string>',
layout_rtl: true,
uppercase_labels: true,
cover_picture: '<string>',
logo_picture: '<string>',
no_branding: true,
transparent_background: true,
submit_button_text: '<string>',
submitted_text: '<string>',
redirect_url: '<string>',
re_fillable: true,
re_fill_button_text: '<string>',
confetti_on_submission: true,
show_progress_bar: true,
submission_retention_value: 1825,
closes_at: '2023-11-07T05:31:56Z',
closed_text: '<string>',
max_submissions_count: 2,
max_submissions_reached_text: '<string>',
auto_save: true,
auto_focus: true,
enable_partial_submissions: true,
editable_submissions: true,
editable_submissions_button_text: '<string>',
password: '<string>',
use_captcha: true,
can_be_indexed: true,
seo_meta: {},
custom_code: '<string>',
database_fields_update: ['<unknown>'],
properties: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: '<string>',
name: '<string>',
help: '<string>',
hidden: true,
required: true,
placeholder: '<string>'
}
]
})
};
fetch('https://api.opnform.com/open/forms/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opnform.com/open/forms/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => 123,
'title' => '<string>',
'tags' => [
'<string>'
],
'language' => '<string>',
'custom_domain' => '<string>',
'font_family' => '<string>',
'color' => '<string>',
'layout_rtl' => true,
'uppercase_labels' => true,
'cover_picture' => '<string>',
'logo_picture' => '<string>',
'no_branding' => true,
'transparent_background' => true,
'submit_button_text' => '<string>',
'submitted_text' => '<string>',
'redirect_url' => '<string>',
're_fillable' => true,
're_fill_button_text' => '<string>',
'confetti_on_submission' => true,
'show_progress_bar' => true,
'submission_retention_value' => 1825,
'closes_at' => '2023-11-07T05:31:56Z',
'closed_text' => '<string>',
'max_submissions_count' => 2,
'max_submissions_reached_text' => '<string>',
'auto_save' => true,
'auto_focus' => true,
'enable_partial_submissions' => true,
'editable_submissions' => true,
'editable_submissions_button_text' => '<string>',
'password' => '<string>',
'use_captcha' => true,
'can_be_indexed' => true,
'seo_meta' => [
],
'custom_code' => '<string>',
'database_fields_update' => [
'<unknown>'
],
'properties' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => '<string>',
'name' => '<string>',
'help' => '<string>',
'hidden' => true,
'required' => true,
'placeholder' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.opnform.com/open/forms/{id}"
payload := strings.NewReader("{\n \"workspace_id\": 123,\n \"title\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"custom_domain\": \"<string>\",\n \"font_family\": \"<string>\",\n \"color\": \"<string>\",\n \"layout_rtl\": true,\n \"uppercase_labels\": true,\n \"cover_picture\": \"<string>\",\n \"logo_picture\": \"<string>\",\n \"no_branding\": true,\n \"transparent_background\": true,\n \"submit_button_text\": \"<string>\",\n \"submitted_text\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"re_fillable\": true,\n \"re_fill_button_text\": \"<string>\",\n \"confetti_on_submission\": true,\n \"show_progress_bar\": true,\n \"submission_retention_value\": 1825,\n \"closes_at\": \"2023-11-07T05:31:56Z\",\n \"closed_text\": \"<string>\",\n \"max_submissions_count\": 2,\n \"max_submissions_reached_text\": \"<string>\",\n \"auto_save\": true,\n \"auto_focus\": true,\n \"enable_partial_submissions\": true,\n \"editable_submissions\": true,\n \"editable_submissions_button_text\": \"<string>\",\n \"password\": \"<string>\",\n \"use_captcha\": true,\n \"can_be_indexed\": true,\n \"seo_meta\": {},\n \"custom_code\": \"<string>\",\n \"database_fields_update\": [\n \"<unknown>\"\n ],\n \"properties\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"help\": \"<string>\",\n \"hidden\": true,\n \"required\": true,\n \"placeholder\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.put("https://api.opnform.com/open/forms/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": 123,\n \"title\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"custom_domain\": \"<string>\",\n \"font_family\": \"<string>\",\n \"color\": \"<string>\",\n \"layout_rtl\": true,\n \"uppercase_labels\": true,\n \"cover_picture\": \"<string>\",\n \"logo_picture\": \"<string>\",\n \"no_branding\": true,\n \"transparent_background\": true,\n \"submit_button_text\": \"<string>\",\n \"submitted_text\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"re_fillable\": true,\n \"re_fill_button_text\": \"<string>\",\n \"confetti_on_submission\": true,\n \"show_progress_bar\": true,\n \"submission_retention_value\": 1825,\n \"closes_at\": \"2023-11-07T05:31:56Z\",\n \"closed_text\": \"<string>\",\n \"max_submissions_count\": 2,\n \"max_submissions_reached_text\": \"<string>\",\n \"auto_save\": true,\n \"auto_focus\": true,\n \"enable_partial_submissions\": true,\n \"editable_submissions\": true,\n \"editable_submissions_button_text\": \"<string>\",\n \"password\": \"<string>\",\n \"use_captcha\": true,\n \"can_be_indexed\": true,\n \"seo_meta\": {},\n \"custom_code\": \"<string>\",\n \"database_fields_update\": [\n \"<unknown>\"\n ],\n \"properties\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"help\": \"<string>\",\n \"hidden\": true,\n \"required\": true,\n \"placeholder\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opnform.com/open/forms/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": 123,\n \"title\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"custom_domain\": \"<string>\",\n \"font_family\": \"<string>\",\n \"color\": \"<string>\",\n \"layout_rtl\": true,\n \"uppercase_labels\": true,\n \"cover_picture\": \"<string>\",\n \"logo_picture\": \"<string>\",\n \"no_branding\": true,\n \"transparent_background\": true,\n \"submit_button_text\": \"<string>\",\n \"submitted_text\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"re_fillable\": true,\n \"re_fill_button_text\": \"<string>\",\n \"confetti_on_submission\": true,\n \"show_progress_bar\": true,\n \"submission_retention_value\": 1825,\n \"closes_at\": \"2023-11-07T05:31:56Z\",\n \"closed_text\": \"<string>\",\n \"max_submissions_count\": 2,\n \"max_submissions_reached_text\": \"<string>\",\n \"auto_save\": true,\n \"auto_focus\": true,\n \"enable_partial_submissions\": true,\n \"editable_submissions\": true,\n \"editable_submissions_button_text\": \"<string>\",\n \"password\": \"<string>\",\n \"use_captcha\": true,\n \"can_be_indexed\": true,\n \"seo_meta\": {},\n \"custom_code\": \"<string>\",\n \"database_fields_update\": [\n \"<unknown>\"\n ],\n \"properties\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"help\": \"<string>\",\n \"hidden\": true,\n \"required\": true,\n \"placeholder\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"slug": "<string>",
"title": "<string>",
"visibility": "public",
"tags": [
"<string>"
],
"language": "<string>",
"custom_domain": "<string>",
"theme": "default",
"font_family": "<string>",
"color": "<string>",
"dark_mode": "light",
"width": "centered",
"size": "sm",
"border_radius": "none",
"layout_rtl": true,
"uppercase_labels": true,
"cover_picture": "<string>",
"logo_picture": "<string>",
"no_branding": true,
"transparent_background": true,
"submit_button_text": "<string>",
"submitted_text": "<string>",
"redirect_url": "<string>",
"re_fillable": true,
"re_fill_button_text": "<string>",
"confetti_on_submission": true,
"show_progress_bar": true,
"submission_retention_value": 1825,
"submission_retention_unit": "day",
"closes_at": "2023-11-07T05:31:56Z",
"closed_text": "<string>",
"max_submissions_count": 2,
"max_submissions_reached_text": "<string>",
"auto_save": true,
"auto_focus": true,
"enable_partial_submissions": true,
"editable_submissions": true,
"editable_submissions_button_text": "<string>",
"password": "<string>",
"use_captcha": true,
"captcha_provider": "recaptcha",
"can_be_indexed": true,
"seo_meta": {},
"custom_code": "<string>",
"database_fields_update": [
"<unknown>"
],
"properties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"help": "<string>",
"hidden": true,
"required": true,
"placeholder": "<string>",
"width": "full"
}
]
}Update Form
Update an existing form. You can modify any attribute that can be set when creating a form.Authentication & Scope
Requires a token with theforms-write ability.
Request
PUT /open/forms/{id} HTTP/1.1
Host: api.opnform.com
Content-Type: application/json
Authorization: Bearer <token>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | number | Numeric ID of the form to edit |
Body Parameters
All fields from the Create Form endpoint may be supplied. However, the API validation requires you to include specific fields in every update request, even if you only want to change one optional field.Required Fields in Updates
These fields must always be included:| Field | Type | Description |
|---|---|---|
| title | string | Form title (max 60 characters) |
| visibility | string | Form visibility state ("public", "closed", "draft") |
| language | string | Two-letter ISO language code (e.g. en) |
| theme | string | Form theme |
| presentation_style | string | How the form is presented |
| width | string | Form container width |
| size | string | Form text size |
| border_radius | string | Form border radius |
| dark_mode | string | Dark mode setting |
| color | string | Primary color (hex format) |
| uppercase_labels | boolean | Whether labels should be uppercase |
| no_branding | boolean | Hide OpnForm branding |
| transparent_background | boolean | Use transparent background |
| properties | array | Array of form fields/blocks — must never be empty, or existing properties will be lost |
| …other fields | mixed | All other fields from Create Form (description, logo_picture, etc.) |
Important: Omitting any of the required fields will result in a validation error. You must include all these fields in your update request, even if you’re only changing one optional field. Additionally, the
properties array cannot be empty — always send your complete form fields.Recommended Update Pattern
To safely update a form without accidentally losing properties:- Fetch the current form state using the Get Form endpoint
- Modify only the fields you want to change in the fetched response
- Send the complete updated form (including all required fields and properties) back to this endpoint
Best Practice Example: If you only want to change form visibility, fetch the form first, update only the
visibility field locally, then send the complete form back with all its properties intact.Custom SEO and link previews
On OpnForm Cloud, Pro and higher plans can publish a custom page title, description, link preview image, and favicon on both OpnForm URLs and custom domains. Supply these settings inseo_meta:
{
"seo_meta": {
"page_title": "Contact our team",
"page_description": "Send us your questions and we will get back to you.",
"page_thumbnail": "https://example.com/form-preview.png",
"page_favicon": "https://example.com/favicon.png"
}
}
seo_meta. Free workspaces can save these settings for preview, but they are omitted from the public form until the workspace upgrades.
Automatically delete old submissions
Setsubmission_retention_value and submission_retention_unit together to permanently delete submissions after a retention period. The period is measured from each submission’s last update, and the cleanup runs hourly.
{
"submission_retention_value": 3,
"submission_retention_unit": "day"
}
day, week, month, or year. Set both fields to null to disable automatic deletion.
Expired submissions, uploaded files, and submission versions are permanently deleted and cannot be restored. Shortening an existing retention period can make older submissions eligible during the next hourly cleanup.
Body Example
Example request updating title and visibility (note: all required fields must be included):{
"title": "Customer Feedback (v2)",
"visibility": "closed",
"language": "en",
"theme": "light",
"presentation_style": "default",
"width": "normal",
"size": "medium",
"border_radius": "medium",
"dark_mode": "off",
"color": "#3b82f6",
"uppercase_labels": false,
"no_branding": false,
"transparent_background": false,
"properties": [
{
"id": "field-1",
"type": "short_text",
"name": "First name",
"required": true
}
],
"closed_text": "Form is currently closed"
}
Response
200 OK – Returns the updated Form object.
403 Forbidden – The token lacks forms-write or you don’t have permission.Body
application/json
Response
Updated
Was this page helpful?