Skip to main content
POST
/
mcp-server
/
instance
/
set-auth
Set Instance Auth
curl --request POST \
  --url https://api.klavis.ai/mcp-server/instance/set-auth \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "instanceId": "<string>",
  "authData": {
    "token": "<string>",
    "api_key": "<string>"
  }
}
'
import requests

url = "https://api.klavis.ai/mcp-server/instance/set-auth"

payload = {
"instanceId": "<string>",
"authData": {
"token": "<string>",
"api_key": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instanceId: '<string>', authData: {token: '<string>', api_key: '<string>'}})
};

fetch('https://api.klavis.ai/mcp-server/instance/set-auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instanceId: '<string>', authData: {token: '<string>', api_key: '<string>'}})
};

fetch('https://api.klavis.ai/mcp-server/instance/set-auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "success": true,
  "message": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

Authorization
string
header
required

Your Klavis AI API key.

Body

application/json
instanceId
string
required

The unique identifier for the connection instance

authData
Option 1: API Key · object
required

Authentication data

Response

Successful Response

success
boolean
required
message
string | null