> ## Documentation Index
> Fetch the complete documentation index at: https://www.klavis.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Instance 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.



## OpenAPI

````yaml post /mcp-server/instance/set-auth
openapi: 3.1.0
info:
  title: Klavis AI (https://www.klavis.ai)
  description: Klavis AI - Open Source MCP Integrations for AI Applications
  version: 0.1.0
servers:
  - url: https://api.klavis.ai
    description: US Production server
  - url: https://api.eu.klavis.ai
    description: EU Production server
security: []
paths:
  /mcp-server/instance/set-auth:
    post:
      tags:
        - mcp-server
      summary: Set Instance Auth
      description: |-
        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.
      operationId: setInstanceAuth
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetAuthRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SetAuthRequest:
      properties:
        instanceId:
          type: string
          title: Instanceid
          description: The unique identifier for the connection instance
        authData:
          anyOf:
            - $ref: '#/components/schemas/ApiKeyAuth'
            - $ref: '#/components/schemas/GeneralAuth'
          title: SetAuthRequestAuthData
          description: Authentication data
      type: object
      required:
        - instanceId
        - authData
      title: SetAuthRequest
    StatusResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
      type: object
      required:
        - success
      title: StatusResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiKeyAuth:
      properties:
        token:
          anyOf:
            - type: string
            - type: 'null'
          title: Token
          description: The API key to save (token field)
        api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key
          description: The API key to save (api_key field)
      additionalProperties: false
      type: object
      title: 'Option 1: API Key'
    GeneralAuth:
      properties:
        data:
          additionalProperties: true
          type: object
          title: Data
          description: Any other general authentication data to save
      additionalProperties: false
      type: object
      title: 'Option 2: General Auth Data'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      description: Your Klavis AI API key.
      scheme: bearer
      x-fern-bearer:
        name: api_key

````