> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/developers/functions/save_acpt_form.md).

# save\_acpt\_form

Create or update a form

Create or update a form.

### Usage

```php
save_acpt_form([
    'name'   => 'new-form',
    'label'  => 'New form',
    'key'    => '12345678',
    'action' => 'CUSTOM',
    'fields' => [],
    'meta'   => [],
]);
```

### Parameters

| Parameter | Type   | Required | Description                                                                                                |
| --------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------- |
| `name`    | string | Required | The form name (slug)                                                                                       |
| `key`     | string | Required | A unique form key used to identify the form publicly                                                       |
| `action`  | string | Required | The submission action. Allowed values: `NONE`, `EMAIL`, `PHP`, `AJAX`, `CUSTOM`, `FILL_META`, `FILL_TABLE` |
| `label`   | string | Optional | The human-readable form label                                                                              |
| `fields`  | array  | Optional | Array of form field definitions                                                                            |
| `meta`    | array  | Optional | Array of associated meta field bindings                                                                    |

### Return

| Type   | Description                           |
| ------ | ------------------------------------- |
| `bool` | `true` on success, `false` on failure |
