Create a form
Creates a new dynamic form. If fields is omitted or empty, the form starts with Name, Email, and Message fields by default.
POST
/projects/{projectId}/forms
Creates a new dynamic form. If fields is omitted or empty, the form starts with Name, Email, and Message fields by default.
Authentication
API Key (header: X-API-Key)
Path Parameters
projectId
string
required
path
Request Body required
application/jsonname
string
REQUIRED
fields
object[]
Array of:
success_action
string
Enum:
inline, redirectsuccess_message
string
redirect_url
string
allowed_origins
string[]
Array of:
rate_limit_per_ip
integer
rate_limit_window_seconds
integer
submit_button_label
string
submit_button_align
string
Enum:
left, center, right, fullsubmit_button_color
string | null
Responses
201
Created form
application/jsondata
object
id
string
project_id
string
name
string
slug
string
fields
object[]
Array of:
id
string
type
string
Enum:
short_text, long_text, email, number, phone, checkbox, radio, single_select, multi_select, date, filelabel
string
name
string
required
boolean
placeholder
string | null
options
string[]
For single_select, multi_select, radio
Array of:
success_action
string
Enum:
inline, redirectsuccess_message
string
redirect_url
string | null
allowed_origins
string[]
Array of:
rate_limit_per_ip
integer
rate_limit_window_seconds
integer
submit_button_label
string
submit_button_align
string
Enum:
left, center, right, fullsubmit_button_color
string | null
Hex color (e.g. #3B82F6). Null = brand default.
archived_at
string (date-time) | null
created_at
string (date-time)
updated_at
string (date-time)
400
Slug already in use or invalid body
curl -X POST 'https://api.rogeriq.com/api/v1/projects/string/forms' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "fields": [ {} ], "success_action": "inline", "success_message": "string", "redirect_url": "string", "allowed_origins": [ "string" ], "rate_limit_per_ip": 0, "rate_limit_window_seconds": 0, "submit_button_label": "string", "submit_button_align": "left", "submit_button_color": "string"}'
const response = await fetch('https://api.rogeriq.com/api/v1/projects/string/forms', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "string", "fields": [ {} ], "success_action": "inline", "success_message": "string", "redirect_url": "string", "allowed_origins": [ "string" ], "rate_limit_per_ip": 0, "rate_limit_window_seconds": 0, "submit_button_label": "string", "submit_button_align": "left", "submit_button_color": "string" })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://api.rogeriq.com/api/v1/projects/string/forms', headers=headers, json={ "name": "string", "fields": [ {} ], "success_action": "inline", "success_message": "string", "redirect_url": "string", "allowed_origins": [ "string" ], "rate_limit_per_ip": 0, "rate_limit_window_seconds": 0, "submit_button_label": "string", "submit_button_align": "left", "submit_button_color": "string"})print(response.json())
201
Response
{ "data": { "id": "<string>", "project_id": "<string>", "name": "<string>", "slug": "<string>", "fields": [ { "id": "<string>", "type": "short_text", "label": "<string>", "name": "<string>", "required": true, "placeholder": "<string>", "options": [ "<string>" ] } ], "success_action": "inline", "success_message": "<string>", "redirect_url": "<string>", "allowed_origins": [ "<string>" ], "rate_limit_per_ip": 123, "rate_limit_window_seconds": 123, "submit_button_label": "<string>", "submit_button_align": "left", "submit_button_color": "<string>", "archived_at": "2024-01-01T00:00:00Z", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" }}
API Playground
Try this endpoint
POST
/projects/{projectId}/forms