# Add Nova to Your Customer PortalTo connect a customer portal to a Nova cPanel & WHM server: embed a Nova Prompt widget on your site, then use WHM API 1's createacct (new users) and create_user_session (new and existing users) functions to create the cPanel account and a one-time login session carrying the user's prompt, and redirect the user into the Nova Prompt interface. createacct requires a username and a Nova plan; create_user_session requires the user, a base64-encoded promptToken (max 5000 decoded characters), and the cpaneld service.

You can add Nova to your customer portal by embedding the Nova script directly into a page and connecting to your Nova-enabled cPanel & WHM server.

## Step 1: Create a Nova Prompt page and embed the Nova script

Create a Nova Prompt page in your customer portal and embed the Nova script in it.

You can customize the script to:

- Adjust the styles of the prompt field.
- Pass the user-entered prompt as a parameter.

For more information, read our [Nova Prompt Integration Widget Guide](/en/partners/nova-prompt-widget-integration-guide/) documentation and review our <a href="https://embeded.nova.webpros.com/" target="_blank">example of an embedded prompt</a>.

## Step 2: Establish communication with the cPanel & WHM server

When a user enters a prompt and clicks _Start Building_, your system should trigger the signup and signin processes.

To create this automation, you can use WHM API 1 to establish communication between your customer portal and the Nova cPanel & WHM server.

**For new users:**
   - Use [WHM API 1's `createacct`](#create-a-nova-cpanel-account) function to create a new user account with the Nova package.
   - Then, use [WHM API 1's `create_user_session`](#create-a-cpanel-account-session) function to create a cPanel session and include the user's prompt as a parameter.

**For existing users:**
   - Use [WHM API 1's `create_user_session`](#create-a-cpanel-account-session) function to create a cPanel session and include the user's prompt as a parameter.

{{< callout context="caution" icon="outline/alert-triangle" >}}

Currently, each time a user logs in to Nova, cPanel generates an API token for Nova and sends the user a notification email. This can create unnecessary spam in the user's mailbox. To resolve this issue:

- Do not include an email when creating the cPanel account, or remove the email address from the existing cPanel account.
- Disable the _API Token Created_ email in WHM's _Contact >> Manager >> Notifications_.

{{< /callout >}}

### Create a Nova cPanel account

To create a Nova cPanel account, use WHM API 1's <a href="https://api.docs.cpanel.net/openapi/whm/operation/createacct/" target="_blank">`createacct`</a> function.

When you run the `createacct` function, you must specify the correct `plan` parameter value. The `plan` parameter controls which package the function assigns to the cPanel account. When you send the API call, use one of the Nova packages that you created on the cPanel & WHM server. For more information about required packages (plans), read our [Nova cPanel Package](/en/partners/cpanel-integration/set-up-nova-in-whm/#creating-a-nova-hosting-package) documentation.

| Parameter | Description |  <div style="width:120px">Example</div> |
| ---- | ---- | ---- |
| `username`  | The Nova cPanel account user. You or your customer determine this parameter's value. | `example1` |
| `plan` | The package name for the Nova cPanel account. You determine this parameter's value by the package you created for your Nova offerings. | `nova-basic` |

##### Browser-based call example

```
https://server.cpanel-nova-server.com:2087/cpsess1539046834/json-api/createacct?api.version=1&username=example1&plan=nova-basic
```

### Create a cPanel account session

Use WHM API 1's <a href="https://api.docs.cpanel.net/openapi/whm/operation/create_user_session/" target="_blank">`create_user_session`</a> function to generate a one-time login URL for the Nova user's account.

| <div style="width:115px">Parameter</div>  | Description | <div style="width:200px">Example</div> |
| ---- | ---- | ---- |
| `user` | The Nova cPanel account user. | `example1`|
| `promptToken` | The prompt token to pre-populate the user's website-generation goals when logging into the Nova interface. {{< callout context="note" icon="outline/info-circle" >}}<ul><li>This value must be base64-encoded.</li><li>Maximum decoded length is 5000 characters.</li></ul>{{< /callout >}} | `promptToken=SSB3YW50IHRvIGNyZWF0ZSBhIHJlc3RhdXJhbnQgd2Vic2l0ZQ==` |
| `service` | The session's service. In this example, we are connecting to the cPanel daemon. | `cpaneld` |

##### Browser-based call example

```
https:server.cpanel-nova-server.com:2087cpsess1539046834/json-api/create_user_session?api.version=1&service=cpaneld&user=example1&promptToken=SSB3YW50IHRvIGNyZWF0ZSBhIHJlc3RhdXJhbnQgd2Vic2l0ZQ
```

##### Example return output

```
data:
  cp_security_token: /cpsess1324512216
  expires: '1767902267'
  service: cpaneld
  session: example1:98ly3rv7sLWxbFne:create_user_session,88f6d68eccc54ddbd9c4d829eea3eb4e
  url: https://192-0-2-0.cprapid.com:2083/cpsess8341218523/login/?session=example16%3a98ly3rv7sLWxbFne%3acreate_user_session%2c88f6d68eccc54ddbd9c4d829eea3eb4e
metadata:
  command: create_user_session
  reason: Created session
  result: 1
  version: 1
```

## Step 3: Redirect to the Nova Prompt interface

After the `create_user_session` API call completes successfully, the system will redirect the user to the Nova Prompt interface, where they will see the prompt that you added in Step 1.

From here, users can start using Nova to build their first website or web app.
