---
title: "Create or renew a test API key (Sandbox only)"
method: POST
path: "/test-api-keys"
tags: ["Authorization"]
---

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

`POST /test-api-keys`

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 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.

## Request body

- object
  - `phone` string, required — Phone number registered in EBC. Format like 49XXXXXXXXX (no '+'). UA keys generation is currently not supported.

## Response `200`

Test API key created or returned

- TestApiKeyResponse
  - `apiKey` string, required — Test API key for Stage usage only.
  - `createdAt` string, date-time, required
  - `expDate` string, date-time, required
  - `status` 'Active' | 'Expired', required

## Other responses

- `400` — Validation error
- `404` — Client not found in EBC
- `409` — Multiple matching clients found in EBC
- `429` — Daily limit exceeded for this user (one request per day)
- `503` — Connection time-out

---

[API](https://skmtc.net/novapost/apis/api-nova-post.md) · [All operations](https://skmtc.net/novapost/apis/api-nova-post/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/novapost/api-nova-post/revisions/60e380005037/schema)
