---
title: "Create or Update a secret value in a user scope"
method: PUT
path: "/user/actions/secrets/{secretname}"
tags: ["user"]
---

# Create or Update a secret value in a user scope

`PUT /user/actions/secrets/{secretname}`

## Path parameters

- `secretname` string, required

## Request body

- CreateOrUpdateSecretOption — CreateOrUpdateSecretOption options when creating or updating secret
  - `data` string, required — Data of the secret to update
  - `description` string — Description of the secret to update

## Response `201`

response when creating a secret

## Other responses

- `204` — response when updating a secret
- `400` — APIError is error format response
- `404` — APINotFound is a not found empty response

---

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