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

# Update a form

Partial update. Only include the fields you want to change.

` PATCH /projects/{projectId}/forms/{formId} `

Update a form

Partial update. Only include the fields you want to change.

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

### ` formId ` (path, required)

- ` value `: type ` string `

## Request body (optional)

Content type: ` application/json `

- ` value `: 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 `

## Responses

### ` 200 ` — Updated 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 conflict

### ` 404 ` — Not found

## Request examples

### cURL

```curl
curl -X PATCH 'https://api.rogeriq.com/api/v1/projects/string/forms/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "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": 0,
  "rate_limit_window_seconds": 0,
  "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"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.rogeriq.com/api/v1/projects/string/forms/string', {
  method: 'PATCH',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "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": 0,
    "rate_limit_window_seconds": 0,
    "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"
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.patch('https://api.rogeriq.com/api/v1/projects/string/forms/string', headers=headers, json={
  "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": 0,
  "rate_limit_window_seconds": 0,
  "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"
})
print(response.json())
```