---
title: "Create Harbor Key"
method: POST
path: "/api/harbors/{harbor_id}/keys"
tags: ["Harbors"]
---

# Create Harbor Key

`POST /api/harbors/{harbor_id}/keys`

Generates a new Harbor credential and returns its plaintext value once.

Store the returned `value` securely. Polytomic returns it only in this response.

## Path parameters

- `harbor_id` string, uuid, required — Unique identifier of the Harbor.

## Headers

- `X-Polytomic-Version` string

## Response `200`

OK

- HarborKeyEnvelope
  - `data` HarborAPIKeyCreatedResponse
    - `created_at` string, date-time — When the credential was created.
    - `id` string, uuid — Unique identifier of the credential.
    - `mode` string — Credential authorization mode.
    - `value` string — Plaintext credential. This value is returned only once.

## Other responses

- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/polytomic/apis/polytomic-api.md) · [All operations](https://skmtc.net/polytomic/apis/polytomic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/polytomic/polytomic-api/revisions/00c653316d35/schema)
