---
title: "Update Mcp Api Key"
method: POST
path: "/api/py/mcp/update-key"
---

# Update Mcp Api Key

`POST /api/py/mcp/update-key`

Rotate the API key for an existing api_key connection and re-validate.

Also accepts an optional ``header_name`` so users can switch a connection
between the default ``Authorization: Bearer`` flow and a custom header
(or vice versa) at the same time as rotating the key — no need to
disconnect + re-add.

## Request body

- UpdateKeyRequest
  - `connection_id` string, required
  - `api_key` string, nullable
  - `header_name` string, nullable
  - `headers` HeaderEntry[], nullable
    - `name` string, required
    - `value` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/getauctor/apis/fastapi.md) · [All operations](https://skmtc.dev/getauctor/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getauctor/fastapi/revisions/aeb6faa3b8f0/schema)
