---
title: "Create a secret"
method: POST
path: "/projects/{project_id}/secrets"
tags: ["Management"]
---

# Create a secret

`POST /projects/{project_id}/secrets`

Create a new secret

## Path parameters

- `project_id` integer, required

## Request body

- Secret
  - `id` integer
  - `name` string
  - `project_id` integer
  - `project_name` string
  - `kind` string
  - `username` string
  - `key` string

## Response `201`

Successfully created run

- Secret
  - `id` integer
  - `name` string
  - `project_id` integer
  - `project_name` string
  - `kind` string
  - `username` string
  - `key` string

## Changes

> 50 revisions in range; 35 could not be searched.

- **2021-01-31** `ecd12e02213d` — 2 info
  - added optional request body
  - added the media type `application/json` for the response with the status `201`
- **2021-01-31** `6dffc3a4de00` — 2 breaking
  - removed the request body
  - removed the media type `application/json` for the response with the status `201`

[Change history](https://skmtc.dev/kraken-ci/apis/server-api/changes/projects/:project_id/secrets/post.md)

---

[API](https://skmtc.dev/kraken-ci/apis/server-api.md) · [All operations](https://skmtc.dev/kraken-ci/apis/server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kraken-ci/server-api/revisions/1f2ae877f985/schema)
