> For the complete documentation index, see [llms.txt](https://alphamoon.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alphamoon.gitbook.io/documentation/user-guide-how-tos/generating-new-api-key.md).

# Generating new API key

See how to generate new API keys using Alphamoon

At Alphamoon we use API keys to authenticate requests. In this step-by-step guide, we'll explain how to generate your new API key for the organization or the single process.

## Create organization API key

To create a new API key for your organization, sign in to Alphamoon and go to **Settings:**

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2F8E2J2mnsJFanAd50NpSt%2FZrzut%20ekranu%202024-05-15%20o%2015.17.44.png?alt=media&amp;token=2b4db71c-80ce-43a3-a6a9-e3b30b25ce43" alt=""><figcaption><p>Settings</p></figcaption></figure>

Next, choose the **API key** tab in the left-hand navigation panel:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FjZDMgcPeRJf1XiYb4C78%2FZrzut%20ekranu%202024-05-15%20o%2015.21.07.png?alt=media&amp;token=d7203c14-ff81-4b20-af07-64ac2cbc27f8" alt=""><figcaption><p>API keys</p></figcaption></figure>

\
Now, click the +**Create new API key** button on the top-right:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2F9kiGB4cwp1PidgcXW13p%2FZrzut%20ekranu%202024-05-15%20o%2015.27.47.png?alt=media&amp;token=182cdf2b-0e8e-4509-bf01-08d7de56a3b0" alt=""><figcaption><p>Create new API key button</p></figcaption></figure>

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FWhikMgJpLZa52oPTRMCu%2FZrzut%20ekranu%202024-05-15%20o%2015.32.53.png?alt=media&amp;token=c430490a-b35e-4f0a-bd0e-4303d4db3ce0" alt=""><figcaption></figcaption></figure>

**Once the modal shows up:**

* Enter your API key's name
* Select API access scopes (determining what actions you can perform within the API - you choose All or select only the ones you need).
* Select the expiration date of your API key (we recommend changing the API key every 3 to 6 months).

Then click the **Create** button.&#x20;

Once you create a new API key, make sure you **save it** in a safe place right away as you won't be able to view it again:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FBbseRZ5JeIGrwvD0ACzq%2FZrzut%20ekranu%202024-05-15%20o%2015.37.25.png?alt=media&amp;token=c4f1035e-4860-4828-bfc2-1e5f6474afa3" alt=""><figcaption><p>Save your new API key</p></figcaption></figure>

{% hint style="info" %}
**Note:**

Once expired your API key will stop working. Remember to **create a new one in advance** to ensure your application continues to operate.
{% endhint %}

You can remove an API key by clicking the three dots next to the given API key and selecting **Delete:**

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FlJg6k6e9MJDfooIznm3X%2FZrzut%20ekranu%202024-05-15%20o%2015.41.21.png?alt=media&amp;token=bc3dd2b2-a23b-49d7-a95e-a510364d7286" alt=""><figcaption><p>Delete API key</p></figcaption></figure>

## Create process API key

To create a new API key for your organization, first enter one of your processes in the Dashboard:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FwF4Fp2aayEjjV0mlpy5i%2FZrzut%20ekranu%202024-05-15%20o%2016.54.17.png?alt=media&amp;token=78ace5ad-31f0-4a48-8f5e-3522edbeced6" alt=""><figcaption><p>Dashboard</p></figcaption></figure>

Next, click the **Configuration** button:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2F9yabGRqAwuXwwvQlHCH5%2FZrzut%20ekranu%202024-05-15%20o%2016.56.09.png?alt=media&amp;token=30464b62-4db4-430c-8a04-f72094cb293d" alt=""><figcaption><p>Queue - Configuration button</p></figcaption></figure>

Once you enter the Configuration, select the **API keys tab** in the left-hand navigation panel:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FzSOwULpJ6ojKOQ2ymHde%2FZrzut%20ekranu%202024-05-15%20o%2016.59.24.png?alt=media&amp;token=89bc8ce5-4c10-4d83-9a4f-dbf51029f641" alt=""><figcaption><p>API keys tab</p></figcaption></figure>

Now, click the + **Generate new key** button on the top-right:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FW0OwcpfNfGrcSEV9DSeR%2FZrzut%20ekranu%202024-05-15%20o%2017.03.17.png?alt=media&amp;token=d0b439dd-39a9-433a-a7f6-394bbfcb862e" alt=""><figcaption><p>Generate new key button</p></figcaption></figure>

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FnkjQs3gFqWty8PqFzmKk%2Fimage.png?alt=media&amp;token=f15ff412-10fa-4eec-866e-b7f13e0aa93c" alt=""><figcaption><p>Generate new process API key</p></figcaption></figure>

**Once the modal shows up:**

* Enter your API key's name
* Select API access scopes (determining what actions you can perform within the API - you choose All or select only the ones you need).
* Select the expiration date of your API key (we recommend changing the API key every 3 to 6 months).

Then click the **Create** button.&#x20;

Once you create a new API key, make sure you **save it** in a safe place right away as you won't be able to view it again:

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FD4rqx3mizygSnXHtHRMW%2FZrzut%20ekranu%202024-05-15%20o%2017.11.29.png?alt=media&amp;token=8ed7e375-665b-4e79-8468-ccbfb8024b6c" alt=""><figcaption><p>Save new process API key</p></figcaption></figure>

You can remove your process API key by clicking the three dots next to the given API key and selecting **Delete:**

<figure><img src="https://1037371503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa3NQDmelveCcQtL0yaFs%2Fuploads%2FwLyDzIpS8e1Z4kDZ6rpq%2FZrzut%20ekranu%202024-05-15%20o%2017.15.13.png?alt=media&amp;token=efd30607-a39e-44e3-b66f-b8da967f42ec" alt=""><figcaption><p>Delete process API key</p></figcaption></figure>

## API key structure

The value of the API key is split by a colon into what we call a **user** and a **pass**. Bear in mind that these credentials are not the same as your Workspace login data.

**Example:**

If your **API key** has the value *h12shadjada:13ehjhj1b3j* then the value for the **user** is *h12shadjada* and the value for the **pass** is *13ehjhj1b3j*.<br>

## API key - security rules

To ensure the full security of your API keys as well as your credentials, we recommend you follow these best practices:

{% hint style="info" %}

* **Keep your API key and credentials confidential:** Treat your API key and credentials as sensitive information and avoid exposing them publicly or including them in source code repositories.
* **Use secure communication channels:** Always transmit the API key and credentials over HTTPS to prevent eavesdropping or interception.
* **Regularly rotate your API key and credentials:** For added security, consider rotating your API key and credentials periodically or whenever there is a potential compromise.
* **Restrict API key and credential permissions:** Limit the scope of the API key and credentials by providing only the necessary permissions required for your application.
* **Monitor API key and credential usage:** Keep track of API key and credential usage and set up alerts or notifications to identify any suspicious activity.<br>
  {% endhint %}

#### See next:
