---
title: "Set a secret to a project"
method: PUT
path: "/api/projects/{id}/secrets/{key}"
tags: ["Project"]
---

# Set a secret to a project

`PUT /api/projects/{id}/secrets/{key}`

## Path parameters

- `id` integer, required
- `key` string, required

## Request body

- RestSetSecretRequest

## Response `200`

successful operation

- RestSecret

## Changes

- **2026-07-17** `f20fc79e6266` — 1 info
  - added the success response with the status `200`
- **2019-12-24** `9afe0472258c` — 1 breaking
  - removed the success response with the status `200`

[Change history](https://skmtc.dev/treasure-data/apis/digdag/changes/api/projects/:id/secrets/:key/put.md)

---

[API](https://skmtc.dev/treasure-data/apis/digdag.md) · [All operations](https://skmtc.dev/treasure-data/apis/digdag/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/treasure-data/digdag/revisions/f20fc79e6266/schema)
