Skip to main content
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 the forms-write ability.

Request

POST /open/forms HTTP/1.1
Host: api.opnform.com
Content-Type: application/json
Authorization: Bearer <token>

Body Parameters

FieldTypeRequiredDescription
workspace_idnumberYesID of the workspace that will own the form.
titlestringYesHuman-readable title shown in the dashboard.
visibilitystringYesOne of public, draft, or closed.
languagestringYesTwo-letter ISO language code (e.g. en).
propertiesarrayYesArray of form blocks (see FormProperty schema).
…other fieldsmixedNoSee the Form schema for the full list of attributes.
Example request:
{
  "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

Authorization
string
header
required

Personal Access Token

Body

application/json
workspace_id
number
write-only

ID of the workspace that owns the form.

title
string

The title of the form.

visibility
enum<string>

The current visibility state of the form.

Available options:
public,
draft,
closed
tags
string[] | null
language
string

Two-letter ISO language code.

custom_domain
string | null
theme
enum<string>
Available options:
default,
simple,
notion
font_family
string | null
color
string
dark_mode
enum<string>
Available options:
light,
dark,
auto
width
enum<string>
Available options:
centered,
full
size
enum<string>
Available options:
sm,
md,
lg
border_radius
enum<string>
Available options:
none,
small,
full
layout_rtl
boolean
uppercase_labels
boolean
cover_picture
string<uri> | null
logo_picture
string<uri> | null
no_branding
boolean

Whether to hide the OpnForm branding.

transparent_background
boolean

Transparent background when form is embedded.

submit_button_text
string
Maximum string length: 50
submitted_text
string
Maximum string length: 2000
redirect_url
string<uri> | null
re_fillable
boolean
re_fill_button_text
string
Maximum string length: 50
confetti_on_submission
boolean
show_progress_bar
boolean
closes_at
string<date-time> | null
closed_text
string | null
max_submissions_count
integer | null
Required range: x >= 1
max_submissions_reached_text
string | null
auto_save
boolean
auto_focus
boolean
enable_partial_submissions
boolean
editable_submissions
boolean
editable_submissions_button_text
string
Maximum string length: 50
password
string | null
use_captcha
boolean
captcha_provider
enum<string>
Available options:
recaptcha,
hcaptcha
can_be_indexed
boolean
seo_meta
object | null
custom_code
string | null
database_fields_update
any[] | null
properties
object[]

An array of field and layout blocks that make up the form.

Response

Form created

id
number
read-only

The unique identifier for the form.

slug
string
read-only

The URL-friendly slug for the form.

title
string

The title of the form.

visibility
enum<string>

The current visibility state of the form.

Available options:
public,
draft,
closed
tags
string[] | null
language
string

Two-letter ISO language code.

custom_domain
string | null
theme
enum<string>
Available options:
default,
simple,
notion
font_family
string | null
color
string
dark_mode
enum<string>
Available options:
light,
dark,
auto
width
enum<string>
Available options:
centered,
full
size
enum<string>
Available options:
sm,
md,
lg
border_radius
enum<string>
Available options:
none,
small,
full
layout_rtl
boolean
uppercase_labels
boolean
cover_picture
string<uri> | null
logo_picture
string<uri> | null
no_branding
boolean

Whether to hide the OpnForm branding.

transparent_background
boolean

Transparent background when form is embedded.

submit_button_text
string
Maximum string length: 50
submitted_text
string
Maximum string length: 2000
redirect_url
string<uri> | null
re_fillable
boolean
re_fill_button_text
string
Maximum string length: 50
confetti_on_submission
boolean
show_progress_bar
boolean
closes_at
string<date-time> | null
closed_text
string | null
max_submissions_count
integer | null
Required range: x >= 1
max_submissions_reached_text
string | null
auto_save
boolean
auto_focus
boolean
enable_partial_submissions
boolean
editable_submissions
boolean
editable_submissions_button_text
string
Maximum string length: 50
password
string | null
use_captcha
boolean
captcha_provider
enum<string>
Available options:
recaptcha,
hcaptcha
can_be_indexed
boolean
seo_meta
object | null
custom_code
string | null
database_fields_update
any[] | null
properties
object[]

An array of field and layout blocks that make up the form.