> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keywordinsights.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# N8N - Keyword Discovery

> Create a basic N8N Flow for Keyword Discovery Orders

## Step 1 - Authentication via API key

* Use an HTTP Request node and select the following options:
* Authentication: `Generic Credential Type`
* Generic Auth Type: `Header Auth`
* Header Auth: `Header Auth account`

<img src="https://mintcdn.com/snippetdigital/HSuWZ5eFnP-6yTnC/images/mintlify-api-auth-main-window.png?fit=max&auto=format&n=HSuWZ5eFnP-6yTnC&q=85&s=5546f24219cb0d282d5a31bafadb259a" alt="Authentication section in Mintlify" width="518" height="570" data-path="images/mintlify-api-auth-main-window.png" />

* Then click the `Edit Pencil icon` to open up the detail model to enter your API key:
* Then in the modal, add X-API-KEY: `kwi_sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890abc`

<img src="https://mintcdn.com/snippetdigital/HSuWZ5eFnP-6yTnC/images/mintlify-api-auth-main-window-detail.png?fit=max&auto=format&n=HSuWZ5eFnP-6yTnC&q=85&s=403a7b30690bc3507e2482e97e505030" alt="Authentication section in Mintlify" width="1093" height="690" data-path="images/mintlify-api-auth-main-window-detail.png" />

### Alternatively you can authenticate via username and password

* Use an HTTP Request node
* URL: `Keywordinsightsapi.keywordinsights.ai/authentication/login`
* Method: `POST`
* Body -> JSON: `{  "email": "<email>",  "password": "<password>"}`
  <img src="https://mintcdn.com/snippetdigital/HSuWZ5eFnP-6yTnC/images/mintlify-simple-auth.png?fit=max&auto=format&n=HSuWZ5eFnP-6yTnC&q=85&s=f69a0a6fff6cb28d5ea26c0c5d4f26f0" alt="Authentication section in Mintlify" width="1250" height="1452" data-path="images/mintlify-simple-auth.png" />

## Step 2 - Creating a Keyword Discovery Order

* Ensure the output of the Auth node shows in the second node if you are using the legacy username and sandbox

<img src="https://mintcdn.com/snippetdigital/HSuWZ5eFnP-6yTnC/images/mintlify-content-brief-order-1.png?fit=max&auto=format&n=HSuWZ5eFnP-6yTnC&q=85&s=518ba084300e15571c8873b3067c698d" alt="Authentication section in Mintlify" width="1970" height="1446" data-path="images/mintlify-content-brief-order-1.png" />

* Paste the following json into the body,
  * `folder_id`: optional if you want the project placed in a specific folder

```
{
    "folder_id": "",
    "language": "en",
    "location": "United Kingdom",
    "seed_keyword": "how to become a model in ukraine"
}
```

<img src="https://mintcdn.com/snippetdigital/wmw1ZXBqY7KeUZqp/images/mintlify-keyword-discovery-order-1.png?fit=max&auto=format&n=wmw1ZXBqY7KeUZqp&q=85&s=ef3c9a2536a0a1677a843ccd1f14448e" alt="Body payload for keyword discovery" width="1290" height="1452" data-path="images/mintlify-keyword-discovery-order-1.png" />
