> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rogeriq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 `

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.

## Servers

- ` https://api.rogeriq.com/api/v1 `

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` apiKey `: ` apiKey `

  - Credential: ` X-API-Key ` in ` header `

  - API key with `riq_` prefix

## Parameters

### ` projectId ` (path, required)

- ` value `: type ` string `

## Request body (required)

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` name `

  - ` name `: type ` string `

  - ` fields `: type ` array `

    - ` array item `: type ` object `

  - ` success_action `: type ` string `

    - enum: ` ["inline","redirect"] `

  - ` success_message `: type ` string `

  - ` redirect_url `: type ` string `

  - ` allowed_origins `: type ` array `

    - ` array item `: type ` string `

  - ` rate_limit_per_ip `: type ` integer `

  - ` rate_limit_window_seconds `: type ` integer `

  - ` submit_button_label `: type ` string `

  - ` submit_button_align `: type ` string `

    - enum: ` ["left","center","right","full"] `

  - ` submit_button_color `: type ` string `; nullable

## Responses

### ` 201 ` — Created form

Content type: ` application/json `

- ` value `: type ` object `

  - ` data `: type ` object `

    - ` id `: type ` string `

    - ` project_id `: type ` string `

    - ` name `: type ` string `

    - ` slug `: type ` string `

    - ` fields `: type ` array `

      - ` array item `: type ` object `

        - ` id `: type ` string `

        - ` type `: type ` string `

          - enum: ` ["short_text","long_text","email","number","phone","checkbox","radio","single_select","multi_select","date","file"] `

        - ` label `: type ` string `

        - ` name `: type ` string `

        - ` required `: type ` boolean `

        - ` placeholder `: type ` string `; nullable

        - ` options `: type ` array ` — For single_select, multi_select, radio

          - ` array item `: type ` string `

    - ` success_action `: type ` string `

      - enum: ` ["inline","redirect"] `

    - ` success_message `: type ` string `

    - ` redirect_url `: type ` string `; nullable

    - ` allowed_origins `: type ` array `

      - ` array item `: type ` string `

    - ` rate_limit_per_ip `: type ` integer `

    - ` rate_limit_window_seconds `: type ` integer `

    - ` submit_button_label `: type ` string `

    - ` submit_button_align `: type ` string `

      - enum: ` ["left","center","right","full"] `

    - ` submit_button_color `: type ` string `; nullable — Hex color (e.g. #3B82F6). Null = brand default.

    - ` archived_at `: type ` string `; nullable; format ` date-time `

    - ` created_at `: type ` string `; format ` date-time `

    - ` updated_at `: type ` string `; format ` date-time `

### ` 400 ` — Slug already in use or invalid body

## Request examples

### cURL

```curl
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"
}'
```

### JavaScript

```javascript
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);
```

### Python

```python
import requests

headers = {
    '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())
```