---
title: "Create a New Hub Secret"
method: POST
path: "/v1/hub/{hub_id}/secrets"
tags: ["Hub"]
---

# Create a New Hub Secret

`POST /v1/hub/{hub_id}/secrets`

Create a new secret for a specified hub

## Path parameters

- `hub_id` string, uuid, required

## Request body

- CreateHubSecret
  - `name` string, required
  - `value` string, required

## Response `200`

Successfully created the hub secret

- object
  - `metadata` object
  - `data` HubSecret
    - `publicId` string, uuid
    - `name` string
    - `value` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400` — Secret with the provided name already exists
- `403` — Not authorized to create a secret in this hub
- `404` — Hub not found

## Changes

- **2025-07-05** `9c58c1c1e7e8` — 1 info
  - endpoint added
- **2025-07-05** `69960ee36427` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/morta-technology/apis/morta-api-reference/changes/v1/hub/:hub_id/secrets/post.md)

---

[API](https://skmtc.dev/morta-technology/apis/morta-api-reference.md) · [All operations](https://skmtc.dev/morta-technology/apis/morta-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/morta-technology/morta-api-reference/revisions/9c58c1c1e7e8/schema)
