---
title: "PUT /api/v1/keys/{name}"
method: PUT
path: "/api/v1/keys/{name}"
---

# PUT /api/v1/keys/{name}

`PUT /api/v1/keys/{name}`

Create a new key value pair or update an existing one.

## Path parameters

- `name` string, required

## Request body

- KeyValuePairRequest
  - `name` string, required — Key Name.
  - `value` string, required — Key's value.
  - `secret` boolean — Encrypt value before saving the value.
  - `encrypted` boolean — Value provided is already encrypted with this instances crypto key and should be stored as-is. This is useful when migrating / loading keys from one StackStorm instance to another.
  - `scope` string — Scope the item is under. Example: 'user'.
  - `ttl` integer — TTL (in seconds) for this value.
  - `user` string, nullable — User for user scoped items (admin only).

## Response `200`

Key set/updated.

## Other responses

- `default` — Unexpected error

---

[API](https://skmtc.net/stackstorm/apis/stackstorm-api.md) · [All operations](https://skmtc.net/stackstorm/apis/stackstorm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stackstorm/stackstorm-api/versions/85e49f390588/schema)
