Create Form
curl --request POST \
--url https://api.opnform.com/open/forms \
--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,
"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"
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,
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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,
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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,
'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"
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 \"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("POST", 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.post("https://api.opnform.com/open/forms")
.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 \"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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"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>",
"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,
"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>"
}
]
}Forms
Create Form
Create a new form; requires forms-write ability.
POST
/
open
/
forms
Create Form
curl --request POST \
--url https://api.opnform.com/open/forms \
--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,
"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"
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,
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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,
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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,
'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"
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 \"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("POST", 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.post("https://api.opnform.com/open/forms")
.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 \"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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"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>",
"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,
"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>"
}
]
}Create Form
Create a new form within a workspace.Authentication & Scope
Requires a Personal Access Token with theforms-write ability.
Request
POST /open/forms HTTP/1.1
Host: api.opnform.com
Content-Type: application/json
Authorization: Bearer <token>
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| workspace_id | number | Yes | ID of the workspace that will own the form. |
| title | string | Yes | Human-readable title shown in the dashboard. |
| visibility | string | Yes | One of public, draft, or closed. |
| language | string | Yes | Two-letter ISO language code (e.g. en). |
| properties | array | Yes | Array of form blocks (see FormProperty schema). |
| …other fields | mixed | No | See the Form schema for the full list of attributes. |
{
"workspace_id": 1,
"title": "Event Registration",
"visibility": "public",
"language": "en",
"properties": [
{
"id": "field-1",
"type": "short_text",
"name": "First name",
"required": true
}
]
}
Response
201 Created – Returns the full Form object.
{
"id": 99,
"slug": "event-registration",
"title": "Event Registration",
"visibility": "public",
"properties": [...]
}
403 Forbidden – The token does not include the forms-write ability.Authorizations
Personal Access Token
Body
application/json
ID of the workspace that owns the form.
The title of the form.
The current visibility state of the form.
Available options:
public, draft, closed Two-letter ISO language code.
Available options:
default, simple, notion Available options:
light, dark, auto Available options:
centered, full Available options:
sm, md, lg Available options:
none, small, full Whether to hide the OpnForm branding.
Transparent background when form is embedded.
Maximum string length:
50Maximum string length:
2000Maximum string length:
50Required range:
x >= 1Maximum string length:
50Available options:
recaptcha, hcaptcha An array of field and layout blocks that make up the form.
Show child attributes
Show child attributes
Response
Form created
The unique identifier for the form.
The URL-friendly slug for the form.
The title of the form.
The current visibility state of the form.
Available options:
public, draft, closed Two-letter ISO language code.
Available options:
default, simple, notion Available options:
light, dark, auto Available options:
centered, full Available options:
sm, md, lg Available options:
none, small, full Whether to hide the OpnForm branding.
Transparent background when form is embedded.
Maximum string length:
50Maximum string length:
2000Maximum string length:
50Required range:
x >= 1Maximum string length:
50Available options:
recaptcha, hcaptcha An array of field and layout blocks that make up the form.
Show child attributes
Show child attributes
Was this page helpful?
⌘I