---
title: "Generate a new API Key for a private location"
method: POST
path: "/v1/private-locations/{id}/keys"
tags: ["Private locations"]
---

# Generate a new API Key for a private location

`POST /v1/private-locations/{id}/keys`

Creates an api key on the private location.

## Path parameters

- `id` string, required

## Headers

- `x-checkly-account` string — Your Checkly account ID, you can find it at https://app.checklyhq.com/settings/account/general

## Response `201`

Created

- PrivateLocationKeys
  - `id` string, required
  - `rawKey` string, required
  - `maskedKey` string, required — The masked key value.
  - `created_at` string, date, required
  - `updated_at` string, date, nullable

## Other responses

- `401` — Unauthorized
- `402` — Payment Required
- `403` — Forbidden
- `429` — Too Many Requests

---

[API](https://skmtc.net/checklyhq/apis/checkly-public-api.md) · [All operations](https://skmtc.net/checklyhq/apis/checkly-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/checklyhq/checkly-public-api/revisions/87d29dc7b4fe/schema)
