---
title: "Set Instance Auth"
method: POST
path: "/mcp-server/instance/set-auth"
tags: ["mcp-server"]
---

# Set Instance Auth

`POST /mcp-server/instance/set-auth`

Sets authentication data for a specific integration instance.
Accepts either API key authentication or general authentication data.
This updates the auth_metadata for the specified integration instance.

## Request body

- SetAuthRequest
  - `instanceId` string, required — The unique identifier for the connection instance
  - `authData` union, required — Authentication data
    - ApiKeyAuth
      - `token` string, nullable — The API key to save (token field)
      - `api_key` string, nullable — The API key to save (api_key field)
    - GeneralAuth
      - `data` object — Any other general authentication data to save

## Response `200`

Successful Response

- StatusResponse
  - `success` boolean, required
  - `message` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai.md) · [All operations](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/klavis-ai/klavis-ai-https-www-klavis-ai/versions/1f05ced7280f/schema)
