# API Key Generation

> API keys are issued exclusively to individuals (natural persons).
>
> To use the API for business purposes, you must designate an authorized company representative and generate API keys in their name, or assign as the authorized representative a person who already has an existing API key.
>
> The authorized representative’s details must be specified in the contract with Nova Post.

### How to create a key for a European client

1. **Create an account** [in the My Nova Post cabinet](https://my.novapost.com/)

Register at my.novapost.com. [Step-by-step registration instructions](https://novapost.com/en-pl/my-nova-post-instructions#registration)[ ](https://api-portal-stage.novapost.com/en/my-nova-post-instructions#registration)

2. **Affiliate an individual to the organization**

   1. Write an email to the NovaPost sales manager.
   2. In the letter, provide the tax code and the name of the organization, details of the individual: full name, phone number, email.

   The details of the individual must match those for which the account in the My Nova Post cabinet was or will be registered.

{% hint style="warning" %}
When registering, use the phone number and email address of the authorized representative specified in the contract.\
If an account has already been created, re-registration is not required.
{% endhint %}

3. Create an API key in your My Nova Post account. Go to the “Integrations → API Keys” section at my.novapost.com and create a key for the production environment.

When creating a key, the system will automatically display all organizations assigned to your account. You can:

* select one or more organizations to which access is granted through this key;
* or create separate keys for each organization if you need to divide access between teams or projects.

<figure><img src="/files/a9UU3Au9hOtAsh8c5NYG" alt=""><figcaption></figcaption></figure>

#### The key immediately appears in the list of information about:

* creation date
* name
* status (active/deactivated)
* organization
* validity period

#### How to Create a Test API Key - method 1

On the test key generation page in the Nova Post portal:

* Enter the phone number registered in your My Nova Post account (**my.novapost.com**) and submit a request to generate the key.
* After a successful request, a test API key for the sandbox (Stage environment) will be generated.\
  The key will be linked to an individual (natural person) and will not be associated with any organization. [Generate a test key](https://api-portal-stage.novapost.com/en/test-api-keys)

Method 2

## Create or renew a test API key (Sandbox only)

> Public endpoint available only in non-production environments (Sandbox) \
> to create or renew a test API key for a client identified by phone.\
> \
> Requirements:\
> \- The phone number must be registered in the Client Portal (EBC): <https://my.novapost.com/\\>
> \- UA key generation is currently not supported\
> \
> Behavior:\
> \- If a key already exists and is Active, a repeated call within the same day \
> &#x20; will return the same key\
> \- If expired, the key will be reactivated with a new expiration date\
> \- If deleted by cleanup, a new key will be created\
> \- Only one active key is allowed per phone, limited to one request per day\
> \
> Next step:\
> After receiving the apiKey, you must generate a temporary JWT by calling \
> \[GET /clients/authorization]\(<https://api-portal.novapost.com/novaposhta-docs/integration-guide/how-to-generate-a-jwt-token>). The JWT is required for all authorized requests. \
> Paste the jwt into the \*\*\[Authorize]\(<https://api.novapost.com/developers/index.html#auth)\\*\\>\* dialog under the \`JWT\` scheme \
> in this documentation to enable Try-it-out.\</br>\
> \
> 🔹\*\*Description of control elements:\*\*\
> \
> \*\*SCHEMA\*\*\</br>\
> Displays the full technical structure of the request or response, including field names, data types, required fields, allowed values, and validation rules.\
> \- \*\*Single line description\*\*\</br>\
> &#x20; A description that fits into a single line; any text that does not fit remains hidden.\
> \- \*\*Multiline description\*\*\</br>\
> &#x20; An expanded description that displays more than one line of text.\
> \
> \*\*EXAMPLE\*\*\</br>\
> Shows a ready-made sample JSON with correctly formatted values to demonstrate how a valid request or response should look.<br>

```json
{"openapi":"3.0.0","info":{"title":"API Nova Post","version":"1.0.0"},"tags":[{"name":"Authorization"}],"servers":[{"description":"sandbox","url":"https://api-stage.novapost.pl/v.1.0/"},{"description":"production","url":"https://api.novapost.com/v.1.0/"}],"security":[],"paths":{"/test-api-keys":{"post":{"tags":["Authorization"],"summary":"Create or renew a test API key (Sandbox only)","description":"Public endpoint available only in non-production environments (Sandbox) \nto create or renew a test API key for a client identified by phone.\n\nRequirements:\n- The phone number must be registered in the Client Portal (EBC): https://my.novapost.com/\n- UA key generation is currently not supported\n\nBehavior:\n- If a key already exists and is Active, a repeated call within the same day \n  will return the same key\n- If expired, the key will be reactivated with a new expiration date\n- If deleted by cleanup, a new key will be created\n- Only one active key is allowed per phone, limited to one request per day\n\nNext step:\nAfter receiving the apiKey, you must generate a temporary JWT by calling \n[GET /clients/authorization](https://api-portal.novapost.com/novaposhta-docs/integration-guide/how-to-generate-a-jwt-token). The JWT is required for all authorized requests. \nPaste the jwt into the **[Authorize](https://api.novapost.com/developers/index.html#auth)** dialog under the `JWT` scheme \nin this documentation to enable Try-it-out.</br>\n\n🔹**Description of control elements:**\n\n**SCHEMA**</br>\nDisplays the full technical structure of the request or response, including field names, data types, required fields, allowed values, and validation rules.\n- **Single line description**</br>\n  A description that fits into a single line; any text that does not fit remains hidden.\n- **Multiline description**</br>\n  An expanded description that displays more than one line of text.\n\n**EXAMPLE**</br>\nShows a ready-made sample JSON with correctly formatted values to demonstrate how a valid request or response should look.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["phone"],"properties":{"phone":{"type":"string","description":"Phone number registered in EBC. Format like 49XXXXXXXXX (no '+'). UA keys generation is currently not supported."}}}}}},"responses":{"200":{"description":"Test API key created or returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestApiKeyResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Client not found in EBC","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Multiple matching clients found in EBC","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Daily limit exceeded for this user (one request per day)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"$ref":"#/components/responses/Time-out"}}}}},"components":{"schemas":{"TestApiKeyResponse":{"type":"object","additionalProperties":false,"required":["apiKey","createdAt","expDate","status"],"properties":{"apiKey":{"type":"string","description":"Test API key for Stage usage only."},"createdAt":{"type":"string","format":"date-time"},"expDate":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["Active","Expired"]}}},"ErrorResponse":{"type":"object","additionalProperties":false,"required":["success","errors"],"properties":{"success":{"type":"boolean"},"errors":{"type":"array","items":{"type":"string"}}}},"Error":{"type":"object","properties":{"errors":{"type":"object","properties":{"":{"type":"string"}}}}}},"responses":{"Time-out":{"description":"Connection time-out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```

#### How to create a key for a client from Ukraine

Generate keys in the Business account in Ukraine under the "Settings - Security" section. [Direct link to the section](https://new.novaposhta.ua/dashboard/settings/developers).&#x20;

1. Log in to the business cabinet at new\.novaposhta.ua as a legal entity.

<figure><img src="/files/WnMwXYcy4NCF82vHY2eM" alt=""><figcaption></figcaption></figure>

2. Go to the "Settings" section.

<figure><img src="/files/6bBbxOE0AdmaUCtWIN1m" alt=""><figcaption></figcaption></figure>

3. Select the "Security" section.

<figure><img src="/files/BUS4aBNP2v1jVBVhs2tM" alt=""><figcaption></figcaption></figure>

4. Click "Create key"

<figure><img src="/files/G54eV52WTZP9axeDvFJn" alt=""><figcaption></figcaption></figure>

5\. **The key has been created.** Copy the code for using the Nova Post API.

<figure><img src="/files/KqJx8YeU33Ad71nSyNxA" alt=""><figcaption></figcaption></figure>

#### Additional Recommendations

**Security:** Store your API keys securely and do not share them with third parties.

**Testing:** Use the sandbox environment to validate your integration before moving to production.

**Access Control:** Regularly review the list of users who have access to your account and API keys.Additional Recommendations


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-portal.novapost.com/novaposhta-docs/integration-guide/api-key-generation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
