---
title: "Save secrets"
method: PATCH
path: "/agents/{id}/secrets"
tags: ["Secrets"]
---

# Save secrets

`PATCH /agents/{id}/secrets`

## Request

- Base URL: `https://app.artil.ai/api`
- URL: `https://app.artil.ai/api/agents/{id}/secrets`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://mcp.artil.ai/oauth/authorize`
    - Token URL: `https://mcp.artil.ai/oauth/token` scopes: `agent`

Save secrets, replacing ones with the same names. A person turns on the agent's secrets first.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `secrets` object, required
  - `kind` 'secret' | 'password' | 'otp': secret, password, or otp for a one-time password, kept as its otpauth:// link

## Response `204`

The secrets are saved

## Other responses

- `4XX`: The request failed; the error says why
- `5XX`: The request failed; the error says why

---

[API](https://skmtc.dev/artil/apis/artil-api.md) - [All operations](https://skmtc.dev/artil/apis/artil-api/llms.txt) - [OpenAPI document](https://skmtc.dev/artil/apis/artil-api/revisions/55db0efa0cb8?raw)
