# Forms API

> Create sign-up forms, publish them, and rotate their public token.

Base URL: `https://api.emailit.com/v2`. Authenticate with `Authorization: Bearer <API key>`.

## Create a form — POST /forms

> Create a draft sign-up form (popup, full page, flyout, embed or banner) with a starter definition and a public token.

# Create a form

Creates a sign-up form in `draft` status with a public `token`. Requires an API key with the `full` scope. Forms are in early access.

If you omit `definition`, Emailit generates a starter form: one step with a heading, a required email field and a **Subscribe** button, plus a success step. Build and style forms in the dashboard under **Email Marketing → Forms**, then [publish](/docs/api-reference/forms/publish/) them.

`POST /forms`

## Body parameters

- `name` (string, required): Name of the form. Visitors don't see it.

- `type` (string): How the form appears: `popup`, `full_page`, `flyout`, `embed` or `banner`.

- `definition` (object): The form's content, stored as-is. Emailit checks it only when you publish. Top-level fields: - `version` (integer): `1`. - `type` (string): the form type. - `steps` (array): each step has `id`, `name`, `kind` (`form` or `success`) and `blocks`. Blocks have an `id` and a `type`: `text`, `button` (`action`: `submit`, `next`, `close` or `go_to_url`), `image`, or an input (`email`, `text_input`, `phone`, `date`, `radio`, `checkbox`, `dropdown`) with a field `name`, `label` and `required`. - `styles`, `targeting`, `experiments` (objects): appearance and display rules set by the form builder.

- `settings` (object): Free-form settings stored with the form. Defaults to `{}`.

## Returns

Returns `201 Created` with the form object, including `definition` and `settings`.

- `token` (string): Public token that the embed script uses to load the form. See [Install a form](/docs/forms/install/).

- `status` (string): `draft` until you publish the form, then `live`.

- `published_at` (string | null): When the form was last published.

Returns `400` if `name` is missing or empty, or `type` isn't one of the allowed values.

**Request** `POST /forms`

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/forms \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Newsletter popup", "type": "popup" }'
```

**Node.js**

```javascript
const res = await fetch('https://api.emailit.com/v2/forms', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.EMAILIT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Newsletter popup', type: 'popup' }),
});
const form = await res.json();
```

**Python**

```python
import os, requests

r = requests.post(
    "https://api.emailit.com/v2/forms",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
    json={"name": "Newsletter popup", "type": "popup"},
)
form = r.json()
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->post('forms', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
    'json' => ['name' => 'Newsletter popup', 'type' => 'popup'],
]);
$form = json_decode($response->getBody(), true);
```

**201**

```json
{
  "object": "form",
  "id": "frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
  "name": "Newsletter popup",
  "type": "popup",
  "status": "draft",
  "token": "9636697db6c8f136d6742cee9c86eb3ed53b89f0a44e3ce6",
  "created_at": "2026-10-01T11:20:31.000000+00:00",
  "updated_at": "2026-10-01T11:20:31.000000+00:00",
  "published_at": null,
  "definition": {
    "version": 1,
    "type": "popup",
    "steps": [
      {
        "id": "3Rb7Lq2NcX9vZt4Wm8Kd1Hs6PyE",
        "name": "Step 1",
        "kind": "form",
        "blocks": [
          { "id": "3Rb7Lq5TgB2kVw7Nn1Ps4Fd9QzA", "type": "text", "content": "<p>Join our list</p>" },
          {
            "id": "3Rb7Lq3JfM6xYc0Rr5Hh8Gk2SeU",
            "type": "email",
            "label": "<p>Email</p>",
            "placeholder": "you@example.com",
            "required": true,
            "name": "email"
          },
          { "id": "3Rb7Lq4WdP1zQa6Ee9Jj3Lm7TfV", "type": "button", "label": "<p>Subscribe</p>", "action": "submit" }
        ]
      },
      {
        "id": "3Rb7Lq2XkS8wUe3Tt6Mn0Bv5RgC",
        "name": "Success",
        "kind": "success",
        "blocks": [
          { "id": "3Rb7Lq6YhD4cFi9Uu2Oo7Cx1WhB", "type": "text", "content": "<p>Thanks for subscribing!</p>" }
        ]
      }
    ],
    "styles": {
      "backgroundColor": "#ffffff",
      "textColor": "#0f172a",
      "primaryColor": "#03a071",
      "borderRadius": 12,
      "fontFamily": "Inter, system-ui, sans-serif",
      "buttonStyle": "solid"
    },
    "targeting": {},
    "experiments": {}
  },
  "settings": {}
}
```

**400**

```json
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Validation error",
  "details": [
    {
      "instancePath": "",
      "schemaPath": "#/required",
      "keyword": "required",
      "params": { "missingProperty": "name" },
      "message": "must have required property 'name'"
    }
  ]
}
```

---
Source: https://emailit.com/docs/api-reference/forms/create/

## Retrieve a form — GET /forms/{id}

> Retrieve a sign-up form by ID with its type, status, public token, full definition and settings.

# Retrieve a form

Retrieves a form with its full definition. Requires an API key with the `full` scope.

`GET /forms/{id}`

## Path parameters

- `id` (string, required): The form ID (`frm_…`).

## Returns

Returns the form object.

- `object` (string): Always `form`.

- `id` (string): Form ID, prefixed `frm_`.

- `name` (string): Name of the form.

- `type` (string): `popup`, `full_page`, `flyout`, `embed` or `banner`.

- `status` (string): `draft` or `live`. Only live forms load on your site.

- `token` (string): Public token used by the embed script.

- `definition` (object): Steps, blocks, styles and targeting. See [Create a form](/docs/api-reference/forms/create/).

- `settings` (object): Free-form settings.

- `created_at, updated_at, published_at` (string | null): Timestamps in UTC. `published_at` is `null` until the first publish.

Returns `404` if the form doesn't exist.

**Request** `GET /forms/{id}`

**cURL**

```bash
curl https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5 \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**Node.js**

```javascript
const res = await fetch('https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5', {
  headers: { Authorization: `Bearer ${process.env.EMAILIT_API_KEY}` },
});
const form = await res.json();
```

**Python**

```python
import os, requests

r = requests.get(
    "https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
)
form = r.json()
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->get('forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
]);
$form = json_decode($response->getBody(), true);
```

**200**

```json
{
  "object": "form",
  "id": "frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
  "name": "Newsletter popup",
  "type": "popup",
  "status": "live",
  "token": "9636697db6c8f136d6742cee9c86eb3ed53b89f0a44e3ce6",
  "created_at": "2026-10-01T11:20:31.000000+00:00",
  "updated_at": "2026-10-01T11:48:02.000000+00:00",
  "published_at": "2026-10-01T11:48:02.000000+00:00",
  "definition": {
    "version": 1,
    "type": "popup",
    "steps": [
      {
        "id": "3Rb7Lq2NcX9vZt4Wm8Kd1Hs6PyE",
        "name": "Step 1",
        "kind": "form",
        "blocks": [
          { "id": "3Rb7Lq5TgB2kVw7Nn1Ps4Fd9QzA", "type": "text", "content": "<p>Get our monthly product notes</p>" },
          {
            "id": "3Rb7Lq3JfM6xYc0Rr5Hh8Gk2SeU",
            "type": "email",
            "label": "<p>Email</p>",
            "placeholder": "you@example.com",
            "required": true,
            "name": "email"
          },
          { "id": "3Rb7Lq4WdP1zQa6Ee9Jj3Lm7TfV", "type": "button", "label": "<p>Subscribe</p>", "action": "submit" }
        ]
      },
      {
        "id": "3Rb7Lq2XkS8wUe3Tt6Mn0Bv5RgC",
        "name": "Success",
        "kind": "success",
        "blocks": [
          { "id": "3Rb7Lq6YhD4cFi9Uu2Oo7Cx1WhB", "type": "text", "content": "<p>Thanks for subscribing!</p>" }
        ]
      }
    ],
    "styles": {
      "backgroundColor": "#ffffff",
      "textColor": "#0f172a",
      "primaryColor": "#03a071",
      "borderRadius": 12,
      "fontFamily": "Inter, system-ui, sans-serif",
      "buttonStyle": "solid"
    },
    "targeting": {},
    "experiments": {}
  },
  "settings": {}
}
```

**404**

```json
{
  "error": "Form not found"
}
```

---
Source: https://emailit.com/docs/api-reference/forms/get/

## Update a form — POST /forms/{id}

> Change a form's name, type, definition or settings. Changes to a live form appear on your site right away.

# Update a form

Updates the fields you pass and leaves the others unchanged. Requires an API key with the `full` scope.

Changes to a `live` form are visible to visitors immediately; you don't need to publish again. To edit without affecting visitors, [unpublish](/docs/api-reference/forms/unpublish/) first.

`POST /forms/{id}`

## Path parameters

- `id` (string, required): The form ID (`frm_…`).

## Body parameters

- `name` (string): New name. Can't be empty.

- `type` (string): `popup`, `full_page`, `flyout`, `embed` or `banner`. Update `definition.type` to match.

- `definition` (object): Replaces the whole definition. See [Create a form](/docs/api-reference/forms/create/) for its structure.

- `settings` (object): Replaces the settings object.

## Returns

Returns the updated form object. Returns `400` if a field has the wrong type or `name` is empty, and `404` if the form doesn't exist.

**Request** `POST /forms/{id}`

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5 \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Newsletter popup (October)" }'
```

**Node.js**

```javascript
const res = await fetch('https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.EMAILIT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Newsletter popup (October)' }),
});
const form = await res.json();
```

**Python**

```python
import os, requests

r = requests.post(
    "https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
    json={"name": "Newsletter popup (October)"},
)
form = r.json()
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->post('forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
    'json' => ['name' => 'Newsletter popup (October)'],
]);
$form = json_decode($response->getBody(), true);
```

**200**

```json
{
  "object": "form",
  "id": "frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
  "name": "Newsletter popup (October)",
  "type": "popup",
  "status": "live",
  "token": "9636697db6c8f136d6742cee9c86eb3ed53b89f0a44e3ce6",
  "created_at": "2026-10-01T11:20:31.000000+00:00",
  "updated_at": "2026-10-02T08:05:14.000000+00:00",
  "published_at": "2026-10-01T11:48:02.000000+00:00",
  "definition": {
    "version": 1,
    "type": "popup",
    "steps": [
      {
        "id": "3Rb7Lq2NcX9vZt4Wm8Kd1Hs6PyE",
        "name": "Step 1",
        "kind": "form",
        "blocks": [
          { "id": "3Rb7Lq3JfM6xYc0Rr5Hh8Gk2SeU", "type": "email", "label": "<p>Email</p>", "required": true, "name": "email" },
          { "id": "3Rb7Lq4WdP1zQa6Ee9Jj3Lm7TfV", "type": "button", "label": "<p>Subscribe</p>", "action": "submit" }
        ]
      },
      {
        "id": "3Rb7Lq2XkS8wUe3Tt6Mn0Bv5RgC",
        "name": "Success",
        "kind": "success",
        "blocks": [{ "id": "3Rb7Lq6YhD4cFi9Uu2Oo7Cx1WhB", "type": "text", "content": "<p>Thanks for subscribing!</p>" }]
      }
    ],
    "styles": { "primaryColor": "#03a071", "borderRadius": 12, "buttonStyle": "solid" },
    "targeting": {},
    "experiments": {}
  },
  "settings": {}
}
```

**400**

```json
{
  "error": "Invalid name"
}
```

**404**

```json
{
  "error": "Form not found"
}
```

---
Source: https://emailit.com/docs/api-reference/forms/update/

## List forms — GET /forms

> List the sign-up forms in a workspace, newest first, with pagination, name search and filters by type and status.

# List forms

Returns the workspace's forms, newest first, without `definition` and `settings`. Requires an API key with the `full` scope.

`GET /forms`

## Query parameters

- `page` (integer): Page number, starting at 1.

- `limit` (integer): Forms per page, from 1 to 100.

- `search` (string): Case-insensitive match on part of the form name.

- `match`, `order`, `direction`: see [Filtering](https://emailit.com/docs/api-reference/filtering/).

### Filter keys

Filters use `key.condition=value` query parameters, for example `status.exact=live`. See [Filtering](/docs/api-reference/filtering/).

| Key | Type | Notes |
| --- | --- | --- |
| `name` | string | |
| `type` | enum | `popup`, `full_page`, `flyout`, `embed`, `banner` |
| `status` | enum | `draft`, `live` |
| `created_at` | date | |

Sort keys for `order`: `name`, `type`, `status`, `created_at`.

## Returns

- `data` (object[]): Forms on this page: `object`, `id`, `name`, `type`, `status`, `token`, `created_at`, `updated_at`, `published_at`.

- `total_records` (integer): Number of forms that match the query.

- `next_page_url` (string | null): Path of the next page, or `null` on the last page. It carries only `page` and `limit`; add your search and filters again when you follow it.

- `previous_page_url` (string | null): Path of the previous page, or `null` on the first page.

**Request** `GET /forms`

**cURL**

```bash
curl -G https://api.emailit.com/v2/forms \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -d status.exact=live
```

**Node.js**

```javascript
const params = new URLSearchParams({ 'status.exact': 'live' });
const res = await fetch(`https://api.emailit.com/v2/forms?${params}`, {
  headers: { Authorization: `Bearer ${process.env.EMAILIT_API_KEY}` },
});
const { data: forms } = await res.json();
```

**Python**

```python
import os, requests

r = requests.get(
    "https://api.emailit.com/v2/forms",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
    params={"status.exact": "live"},
)
forms = r.json()["data"]
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->get('forms', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
    'query' => ['status.exact' => 'live'],
]);
$forms = json_decode($response->getBody(), true)['data'];
```

**200**

```json
{
  "data": [
    {
      "object": "form",
      "id": "frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
      "name": "Newsletter popup",
      "type": "popup",
      "status": "live",
      "token": "9636697db6c8f136d6742cee9c86eb3ed53b89f0a44e3ce6",
      "created_at": "2026-10-01T11:20:31.000000+00:00",
      "updated_at": "2026-10-01T11:48:02.000000+00:00",
      "published_at": "2026-10-01T11:48:02.000000+00:00"
    }
  ],
  "total_records": 1,
  "next_page_url": null,
  "previous_page_url": null
}
```

---
Source: https://emailit.com/docs/api-reference/forms/list/

## Publish a form — POST /forms/{id}/publish

> Set a sign-up form live so the embed script shows it on your site. The form needs a form step and a success step.

# Publish a form

Sets the form's status to `live` and updates `published_at`. Live forms load on any site where the Emailit script is [installed](/docs/forms/install/) and can receive submissions. Requires an API key with the `full` scope.

The definition needs at least one step with `kind: "form"` and one with `kind: "success"`; otherwise the request returns `422`. Submissions are stored with the form and don't create contacts yet.

`POST /forms/{id}/publish`

## Path parameters

- `id` (string, required): The form ID (`frm_…`).

## Returns

Returns the form object with `status` set to `live`. Returns `422` if the definition is incomplete and `404` if the form doesn't exist.

**Request** `POST /forms/{id}/publish`

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/publish \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**Node.js**

```javascript
const res = await fetch('https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/publish', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.EMAILIT_API_KEY}` },
});
const form = await res.json();
```

**Python**

```python
import os, requests

r = requests.post(
    "https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/publish",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
)
form = r.json()
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->post('forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/publish', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
]);
$form = json_decode($response->getBody(), true);
```

**200**

```json
{
  "object": "form",
  "id": "frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
  "name": "Newsletter popup",
  "type": "popup",
  "status": "live",
  "token": "9636697db6c8f136d6742cee9c86eb3ed53b89f0a44e3ce6",
  "created_at": "2026-10-01T11:20:31.000000+00:00",
  "updated_at": "2026-10-01T11:48:02.000000+00:00",
  "published_at": "2026-10-01T11:48:02.000000+00:00",
  "definition": {
    "version": 1,
    "type": "popup",
    "steps": [
      {
        "id": "3Rb7Lq2NcX9vZt4Wm8Kd1Hs6PyE",
        "name": "Step 1",
        "kind": "form",
        "blocks": [
          { "id": "3Rb7Lq3JfM6xYc0Rr5Hh8Gk2SeU", "type": "email", "label": "<p>Email</p>", "required": true, "name": "email" },
          { "id": "3Rb7Lq4WdP1zQa6Ee9Jj3Lm7TfV", "type": "button", "label": "<p>Subscribe</p>", "action": "submit" }
        ]
      },
      {
        "id": "3Rb7Lq2XkS8wUe3Tt6Mn0Bv5RgC",
        "name": "Success",
        "kind": "success",
        "blocks": [{ "id": "3Rb7Lq6YhD4cFi9Uu2Oo7Cx1WhB", "type": "text", "content": "<p>Thanks for subscribing!</p>" }]
      }
    ],
    "styles": { "primaryColor": "#03a071", "borderRadius": 12, "buttonStyle": "solid" },
    "targeting": {},
    "experiments": {}
  },
  "settings": {}
}
```

**422**

```json
{
  "error": "Form must have a success step"
}
```

**404**

```json
{
  "error": "Form not found"
}
```

---
Source: https://emailit.com/docs/api-reference/forms/publish/

## Unpublish a form — POST /forms/{id}/unpublish

> Take a live sign-up form offline by setting it back to draft. The embed script stops showing it and submissions stop.

# Unpublish a form

Sets the form's status back to `draft`. The embed script stops loading it and new submissions are rejected. The token, definition and `published_at` stay the same, so you can [publish](/docs/api-reference/forms/publish/) it again later. Requires an API key with the `full` scope.

`POST /forms/{id}/unpublish`

## Path parameters

- `id` (string, required): The form ID (`frm_…`).

## Returns

Returns the form object with `status` set to `draft`. Returns `404` if the form doesn't exist.

**Request** `POST /forms/{id}/unpublish`

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/unpublish \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**Node.js**

```javascript
const res = await fetch('https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/unpublish', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.EMAILIT_API_KEY}` },
});
const form = await res.json();
```

**Python**

```python
import os, requests

r = requests.post(
    "https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/unpublish",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
)
form = r.json()
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->post('forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/unpublish', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
]);
$form = json_decode($response->getBody(), true);
```

**200**

```json
{
  "object": "form",
  "id": "frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
  "name": "Newsletter popup",
  "type": "popup",
  "status": "draft",
  "token": "9636697db6c8f136d6742cee9c86eb3ed53b89f0a44e3ce6",
  "created_at": "2026-10-01T11:20:31.000000+00:00",
  "updated_at": "2026-10-06T07:30:00.000000+00:00",
  "published_at": "2026-10-01T11:48:02.000000+00:00",
  "definition": {
    "version": 1,
    "type": "popup",
    "steps": [
      {
        "id": "3Rb7Lq2NcX9vZt4Wm8Kd1Hs6PyE",
        "name": "Step 1",
        "kind": "form",
        "blocks": [
          { "id": "3Rb7Lq3JfM6xYc0Rr5Hh8Gk2SeU", "type": "email", "label": "<p>Email</p>", "required": true, "name": "email" },
          { "id": "3Rb7Lq4WdP1zQa6Ee9Jj3Lm7TfV", "type": "button", "label": "<p>Subscribe</p>", "action": "submit" }
        ]
      },
      {
        "id": "3Rb7Lq2XkS8wUe3Tt6Mn0Bv5RgC",
        "name": "Success",
        "kind": "success",
        "blocks": [{ "id": "3Rb7Lq6YhD4cFi9Uu2Oo7Cx1WhB", "type": "text", "content": "<p>Thanks for subscribing!</p>" }]
      }
    ],
    "styles": { "primaryColor": "#03a071", "borderRadius": 12, "buttonStyle": "solid" },
    "targeting": {},
    "experiments": {}
  },
  "settings": {}
}
```

**404**

```json
{
  "error": "Form not found"
}
```

---
Source: https://emailit.com/docs/api-reference/forms/unpublish/

## Reset the public token — POST /forms/{id}/reset-token

> Replace a form's public token. Embed codes that use the old token stop loading the form immediately.

# Reset the public token

Generates a new public `token` for the form. The old token stops working immediately: sites that load the form with it no longer show it and can't submit to it. Update your embed code with the new token. Requires an API key with the `full` scope.

`POST /forms/{id}/reset-token`

## Path parameters

- `id` (string, required): The form ID (`frm_…`).

## Returns

Returns the form object with the new `token`. The status doesn't change. Returns `404` if the form doesn't exist.

**Request** `POST /forms/{id}/reset-token`

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/reset-token \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**Node.js**

```javascript
const res = await fetch('https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/reset-token', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.EMAILIT_API_KEY}` },
});
const { token } = await res.json();
```

**Python**

```python
import os, requests

r = requests.post(
    "https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/reset-token",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
)
token = r.json()["token"]
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->post('forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5/reset-token', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
]);
$token = json_decode($response->getBody(), true)['token'];
```

**200**

```json
{
  "object": "form",
  "id": "frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
  "name": "Newsletter popup",
  "type": "popup",
  "status": "live",
  "token": "e5ed3f9ec299ae1c5dc043c45f2a616c352e47a13b6b763b",
  "created_at": "2026-10-01T11:20:31.000000+00:00",
  "updated_at": "2026-10-06T09:12:44.000000+00:00",
  "published_at": "2026-10-01T11:48:02.000000+00:00",
  "definition": {
    "version": 1,
    "type": "popup",
    "steps": [
      {
        "id": "3Rb7Lq2NcX9vZt4Wm8Kd1Hs6PyE",
        "name": "Step 1",
        "kind": "form",
        "blocks": [
          { "id": "3Rb7Lq3JfM6xYc0Rr5Hh8Gk2SeU", "type": "email", "label": "<p>Email</p>", "required": true, "name": "email" },
          { "id": "3Rb7Lq4WdP1zQa6Ee9Jj3Lm7TfV", "type": "button", "label": "<p>Subscribe</p>", "action": "submit" }
        ]
      },
      {
        "id": "3Rb7Lq2XkS8wUe3Tt6Mn0Bv5RgC",
        "name": "Success",
        "kind": "success",
        "blocks": [{ "id": "3Rb7Lq6YhD4cFi9Uu2Oo7Cx1WhB", "type": "text", "content": "<p>Thanks for subscribing!</p>" }]
      }
    ],
    "styles": { "primaryColor": "#03a071", "borderRadius": 12, "buttonStyle": "solid" },
    "targeting": {},
    "experiments": {}
  },
  "settings": {}
}
```

**404**

```json
{
  "error": "Form not found"
}
```

---
Source: https://emailit.com/docs/api-reference/forms/reset-token/

## Delete a form — DELETE /forms/{id}

> Permanently delete a sign-up form together with all of its stored submissions. Returns 204 with no body.

# Delete a form

Permanently deletes a form and all of its stored submissions. Sites that embed it stop showing it. Requires an API key with the `full` scope.

`DELETE /forms/{id}`

## Path parameters

- `id` (string, required): The form ID (`frm_…`).

## Returns

Returns `204 No Content` with an empty body. Returns `404` if the form doesn't exist.

**Request** `DELETE /forms/{id}`

**cURL**

```bash
curl -X DELETE https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5 \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**Node.js**

```javascript
const res = await fetch('https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5', {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.EMAILIT_API_KEY}` },
});
console.log(res.status); // 204
```

**Python**

```python
import os, requests

r = requests.delete(
    "https://api.emailit.com/v2/forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5",
    headers={"Authorization": f"Bearer {os.environ['EMAILIT_API_KEY']}"},
)
print(r.status_code)  # 204
```

**PHP**

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.emailit.com/v2/']);

$response = $client->delete('forms/frm_3Bzpif9xswMlVbFvGZSPNixm5j5', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('EMAILIT_API_KEY')],
]);
echo $response->getStatusCode(); // 204
```

**204**

```text
(empty body)
```

**404**

```json
{
  "error": "Form not found"
}
```

---
Source: https://emailit.com/docs/api-reference/forms/delete/
