# Create Opt-In Process

Creates an opt-in process (subscriber list) and its confirmation email, without subscribing anyone or sending. Defaults to double opt-in; single opt-in skips confirmation and requires the user’s approval. copyFromOptInProcessId also copies the confirmation email text; supplied settings override the copy. A page parameter is a name the platform fills with contact data; a UTM parameter is a value under a fixed name; both require the redirect URL in the same call. The change-email role is set separately with update-opt-in-process. Returns both process and email IDs.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the new process; must be free within the account",
      "minLength": 1,
      "maxLength": 250
    },
    "notes": {
      "type": [
        "null",
        "string"
      ],
      "description": "Internal note, not visible to contacts",
      "default": null,
      "maxLength": 2000
    },
    "optInMode": {
      "type": [
        "null",
        "string"
      ],
      "description": "\"double\" for a confirmation email, \"single\" without one; defaults to double",
      "default": null,
      "enum": [
        "double",
        "single"
      ]
    },
    "pendingRedirectUrl": {
      "type": [
        "null",
        "string"
      ],
      "description": "URL a contact reaches after subscribing, before confirming; omit for the KlickTipp page",
      "default": null,
      "maxLength": 2000
    },
    "confirmedRedirectUrl": {
      "type": [
        "null",
        "string"
      ],
      "description": "URL a contact reaches after confirming; omit for the KlickTipp page",
      "default": null,
      "maxLength": 2000
    },
    "resendConfirmationEmail": {
      "type": [
        "null",
        "boolean"
      ],
      "description": "Whether an already pending contact receives the confirmation email again on a repeated subscription",
      "default": null
    },
    "deletePendingSubscribersAfterDays": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Days after which unconfirmed contacts are deleted, one of 0, 1, 3, 7, 14; 0 keeps them",
      "default": null,
      "enum": [
        0,
        1,
        3,
        7,
        14
      ]
    },
    "metaLabels": {
      "type": "array",
      "description": "Labels of the new process",
      "default": null,
      "items": {
        "type": "string",
        "maxLength": 250
      },
      "maxItems": 50
    },
    "pendingPageParameters": {
      "type": "object",
      "description": "Query parameters appended to pendingRedirectUrl, by the name each is appended under; needs pendingRedirectUrl in the same call",
      "default": null,
      "properties": {
        "subscriberParameterName": {
          "type": "string",
          "maxLength": 100
        },
        "emailParameterName": {
          "type": "string",
          "maxLength": 100
        },
        "listParameterName": {
          "type": "string",
          "maxLength": 100
        },
        "subscriberKeyParameterName": {
          "type": "string",
          "maxLength": 100
        }
      },
      "additionalProperties": false
    },
    "confirmedPageParameters": {
      "type": "object",
      "description": "Query parameters appended to confirmedRedirectUrl, by the name each is appended under; needs confirmedRedirectUrl in the same call",
      "default": null,
      "properties": {
        "subscriberParameterName": {
          "type": "string",
          "maxLength": 100
        },
        "emailParameterName": {
          "type": "string",
          "maxLength": 100
        },
        "listParameterName": {
          "type": "string",
          "maxLength": 100
        },
        "subscriberKeyParameterName": {
          "type": "string",
          "maxLength": 100
        },
        "referralLinkParameterName": {
          "type": "string",
          "maxLength": 100,
          "description": "Name the referral link is appended under; only together with referralLinkId"
        },
        "referralLinkId": {
          "type": "integer",
          "minimum": 0,
          "description": "ID of the account's own referral-link tool, as get-opt-in-process reports it; 0 means no referral link, and then referralLinkParameterName has to be empty too"
        }
      },
      "additionalProperties": false
    },
    "pendingUtmParameters": {
      "type": "object",
      "description": "Campaign tracking values appended to pendingRedirectUrl, by query name; the value, not the name; needs pendingRedirectUrl in the same call",
      "default": null,
      "properties": {
        "utm_source": {
          "type": "string",
          "maxLength": 200
        },
        "utm_medium": {
          "type": "string",
          "maxLength": 200
        },
        "utm_campaign": {
          "type": "string",
          "maxLength": 200
        },
        "utm_term": {
          "type": "string",
          "maxLength": 200
        },
        "utm_content": {
          "type": "string",
          "maxLength": 200
        }
      },
      "additionalProperties": false
    },
    "confirmedUtmParameters": {
      "type": "object",
      "description": "The same for confirmedRedirectUrl; needs confirmedRedirectUrl in the same call",
      "default": null,
      "properties": {
        "utm_source": {
          "type": "string",
          "maxLength": 200
        },
        "utm_medium": {
          "type": "string",
          "maxLength": 200
        },
        "utm_campaign": {
          "type": "string",
          "maxLength": 200
        },
        "utm_term": {
          "type": "string",
          "maxLength": 200
        },
        "utm_content": {
          "type": "string",
          "maxLength": 200
        }
      },
      "additionalProperties": false
    },
    "copyFromOptInProcessId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Existing process to copy settings and confirmation email from; the arguments above still win",
      "default": null,
      "minimum": 1
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "id",
    "accountId",
    "name",
    "isDefaultProcess",
    "optInMode",
    "createdAt",
    "confirmationEmailId",
    "resendConfirmationEmail",
    "useForChangeEmail",
    "deletePendingSubscribersAfterDays",
    "pendingRedirectUrl",
    "confirmedRedirectUrl",
    "metaLabels",
    "notes",
    "pendingPageParameters",
    "confirmedPageParameters",
    "pendingUtmParameters",
    "confirmedUtmParameters",
    "editUrl"
  ],
  "properties": {
    "id": {
      "type": "integer"
    },
    "accountId": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "isDefaultProcess": {
      "type": "boolean"
    },
    "optInMode": {
      "type": "string"
    },
    "createdAt": {
      "type": "string"
    },
    "confirmationEmailId": {
      "type": "integer"
    },
    "resendConfirmationEmail": {
      "type": "boolean"
    },
    "useForChangeEmail": {
      "type": "boolean"
    },
    "deletePendingSubscribersAfterDays": {
      "type": "integer"
    },
    "pendingRedirectUrl": {
      "type": "string"
    },
    "confirmedRedirectUrl": {
      "type": "string"
    },
    "metaLabels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "string"
    },
    "pendingPageParameters": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "confirmedPageParameters": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "integer"
        ]
      }
    },
    "pendingUtmParameters": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "confirmedUtmParameters": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "editUrl": {
      "type": "string"
    }
  }
}
```

