36 KiB
Search...
Ctrl KAsk AI
Search...
Navigation
Gmail OAuth
Authorize Gmail
Authorize Gmail
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/oauth/gmail/authorize
200
422
Copy
Ask AI
"<any>"
GET
/
oauth
/
gmail
/
authorize
Try it
Authorize Gmail
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/oauth/gmail/authorize
200
422
Copy
Ask AI
"<any>"
Assistant
Responses are generated using AI and may contain mistakes.
Query Parameters
instance_id
string
required
Unique identifier for the client instance requesting authorization
client_id
string | null
Client ID for white labeling, if not provided will use default credentials
scope
string | null
Optional OAuth scopes to request (comma-separated string)
redirect_url
string | null
Optional URL to redirect to after authorization completes
Response
200
200422
application/json
Successful Response
The response is of type any.
Authorize Wordpress Authorize Gcalendar
Search...
Ctrl KAsk AI
Search...
Navigation
API References
Introduction
On this page
Base URL
The Klavis API is built on REST principles. We enforce HTTPS in every request to improve data security, integrity, and privacy. The API does not support HTTP.
All requests contain the following base URL:
Copy
Ask AI
https://api.klavis.ai
Authentication
To authenticate you need to add an Authorization header with the contents of the header being Bearer key_123456789 where key_123456789 is your API Key.
Copy
Ask AI
Authorization: Bearer key_123456789
Response codes
Klavis uses standard HTTP codes to indicate the success or failure of your requests.
In general, 2xx HTTP codes correspond to success, 4xx codes are for user-related failures, and 5xx codes are for infrastructure issues.
| Status | Description |
|---|---|
| 200 | Successful request. |
| 400 | Check that the parameters were correct. |
| 401 | The API key used was missing. |
| 403 | The API key used was invalid. |
| 404 | The resource was not found. |
| 429 | The rate limit was exceeded. |
| 5xx | Indicates an error with Klavis servers. |
Check Error Codes for a comprehensive breakdown of all possible API errors.
Rate limit
The default maximum rate limit is 2 requests per second. This number can be increased for trusted senders by request. After that, you’ll hit the rate limit and receive a 429 response error code.
Assistant
Responses are generated using AI and may contain mistakes.
Search...
Ctrl KAsk AI
Search...
Navigation
Function Calling with MCP
Call Tool
Call Tool
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/call-tool \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverUrl": "<string>",
"toolName": "<string>",
"toolArgs": {},
"connectionType": "StreamableHttp"
}'
200
422
Copy
Ask AI
{
"success": true,
"result": {
"content": [\
"<any>"\
],
"isError": false
},
"error": "<string>"
}
POST
/
mcp-server
/
call-tool
Try it
Call Tool
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/call-tool \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverUrl": "<string>",
"toolName": "<string>",
"toolArgs": {},
"connectionType": "StreamableHttp"
}'
200
422
Copy
Ask AI
{
"success": true,
"result": {
"content": [\
"<any>"\
],
"isError": false
},
"error": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Body
application/json
serverUrl
string
required
The full URL for connecting to the MCP server
toolName
string
required
The name of the tool to call
toolArgs
object
The input parameters for the tool
connectionType
enum
The connection type to use for the MCP server. Default is STREAMABLE_HTTP.
Available options:
SSE,
StreamableHttp
Response
200
200422
application/json
Successful Response
success
boolean
required
Whether the API call was successful
result
object | null
The result of the tool call, if successful The server's response to a tool call.
Show child attributes
result.content
any[]
required
The content of the tool call
result.isError
boolean
default:false
Whether the tool call was successful
error
string | null
Error message, if the tool call failed
Search...
Ctrl KAsk AI
Search...
Navigation
Manage MCP Server
Create a Server Instance
Create a Server Instance
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/instance/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverName": "Affinity",
"userId": "<string>",
"platformName": "<string>",
"connectionType": "StreamableHttp"
}'
200
422
Copy
Ask AI
{
"serverUrl": "<string>",
"instanceId": "<string>",
"oauthUrl": "<string>"
}
POST
/
mcp-server
/
instance
/
create
Try it
Create a Server Instance
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/instance/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverName": "Affinity",
"userId": "<string>",
"platformName": "<string>",
"connectionType": "StreamableHttp"
}'
200
422
Copy
Ask AI
{
"serverUrl": "<string>",
"instanceId": "<string>",
"oauthUrl": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Body
application/json
serverName
enum
required
The name of the target MCP server.
Available options:
Affinity,
Airtable,
Asana,
Attio,
ClickUp,
Close,
Confluence,
Discord,
Doc2markdown,
Firecrawl Deep Research,
Firecrawl Web Search,
GitHub,
Gmail,
Gong,
Google Calendar,
Google Docs,
Google Drive,
Google Sheets,
HubSpot,
Jira,
Klavis ReportGen,
Linear,
Markdown2doc,
Notion,
Plai,
Postgres,
Resend,
Salesforce,
Slack,
Supabase,
WhatsApp,
WordPress,
YouTube
userId
string
required
The identifier for the user requesting the server URL.
Minimum length: 1
platformName
string
required
The name of the platform associated with the user.
Minimum length: 1
connectionType
enum
The connection type to use for the MCP server. Default is STREAMABLE_HTTP.
Available options:
SSE,
StreamableHttp
Response
200
200422
application/json
Successful Response
serverUrl
string
required
The full URL for connecting to the MCP server, including the instance ID.
instanceId
string
required
The unique identifier for this specific server connection instance.
oauthUrl
string | null
The OAuth authorization URL for the specified server, if OAuth is configured.
Introduction Get Server Instance
Search...
Ctrl KAsk AI
Search...
Navigation
Manage MCP Server
Delete a Server Instance
Delete a Server Instance
cURL
Copy
Ask AI
curl --request DELETE \
--url https://api.klavis.ai/mcp-server/instance/delete/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"success": true,
"message": "<string>"
}
DELETE
/
mcp-server
/
instance
/
delete
/
{instance_id}
Try it
Delete a Server Instance
cURL
Copy
Ask AI
curl --request DELETE \
--url https://api.klavis.ai/mcp-server/instance/delete/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"success": true,
"message": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Path Parameters
instance_id
string
required
The ID of the connection instance to delete.
Response
200
200422
application/json
Successful Response
success
boolean
required
message
string | null
Get Server Instance Get All Servers
Search...
Ctrl KAsk AI
Search...
Navigation
Auth / OAuth
Delete Auth data for a Server Instance
Delete Auth data for a Server Instance
cURL
Copy
Ask AI
curl --request DELETE \
--url https://api.klavis.ai/mcp-server/instance/delete-auth/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"success": true,
"message": "<string>"
}
DELETE
/
mcp-server
/
instance
/
delete-auth
/
{instance_id}
Try it
Delete Auth data for a Server Instance
cURL
Copy
Ask AI
curl --request DELETE \
--url https://api.klavis.ai/mcp-server/instance/delete-auth/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"success": true,
"message": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Path Parameters
instance_id
string
required
The ID of the connection instance to delete auth for.
Response
200
200422
application/json
Successful Response
success
boolean
required
message
string | null
Get Authentication Metadata Authorize Github
Search...
Ctrl KAsk AI
Search...
Navigation
MCP Server Metadata
Get All Servers
Get All Servers
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/servers \
--header 'Authorization: Bearer <token>'
200
Copy
Ask AI
{
"servers": [\
{\
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\
"name": "<string>",\
"description": "<string>",\
"tools": [\
{\
"name": "<string>",\
"description": "<string>"\
}\
],\
"authNeeded": true\
}\
]
}
GET
/
mcp-server
/
servers
Try it
Get All Servers
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/servers \
--header 'Authorization: Bearer <token>'
200
Copy
Ask AI
{
"servers": [\
{\
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\
"name": "<string>",\
"description": "<string>",\
"tools": [\
{\
"name": "<string>",\
"description": "<string>"\
}\
],\
"authNeeded": true\
}\
]
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Response
200 - application/json
Successful Response
servers
McpServer · object[]
required
Show child attributes
id
string
required
name
string
required
description
string | null
tools
ServerTool · object[] | null
authNeeded
boolean
default:true
Delete a Server Instance Get Tools
Search...
Ctrl KAsk AI
Search...
Navigation
Auth / OAuth
Get Authentication Metadata
Get Authentication Metadata
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/instance/get-auth/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"success": true,
"authData": {},
"error": "<string>"
}
GET
/
mcp-server
/
instance
/
get-auth
/
{instance_id}
Try it
Get Authentication Metadata
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/instance/get-auth/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"success": true,
"authData": {},
"error": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Path Parameters
instance_id
string
required
The ID of the connection instance to get auth metadata for.
Response
200
200422
application/json
Successful Response
success
boolean
required
Whether the request was successful
authData
object | null
Complete authentication metadata including access token, refresh token, scope, expiration, and platform-specific data
error
string | null
Error message if the request failed
Set Auth Token Delete Auth data for a Server Instance
Search...
Ctrl KAsk AI
Search...
Navigation
Auth / OAuth
Get OAuth URL
Get OAuth URL
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/oauth-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverName": "Affinity",
"instanceId": "<string>",
"clientId": "<string>",
"scope": "<string>",
"redirectUrl": "<string>"
}'
200
422
Copy
Ask AI
{
"oauthUrl": "<string>"
}
POST
/
mcp-server
/
oauth-url
Try it
Get OAuth URL
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/oauth-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverName": "Affinity",
"instanceId": "<string>",
"clientId": "<string>",
"scope": "<string>",
"redirectUrl": "<string>"
}'
200
422
Copy
Ask AI
{
"oauthUrl": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Body
application/json
serverName
enum
required
The name of the target MCP server.
Available options:
Affinity,
Airtable,
Asana,
Attio,
ClickUp,
Close,
Confluence,
Discord,
Doc2markdown,
Firecrawl Deep Research,
Firecrawl Web Search,
GitHub,
Gmail,
Gong,
Google Calendar,
Google Docs,
Google Drive,
Google Sheets,
HubSpot,
Jira,
Klavis ReportGen,
Linear,
Markdown2doc,
Notion,
Plai,
Postgres,
Resend,
Salesforce,
Slack,
Supabase,
WhatsApp,
WordPress,
YouTube
instanceId
string
required
The unique identifier for the connection instance.
clientId
string | null
Optional client ID for white labeling. If not provided, will use default credentials.
scope
string | null
Optional OAuth scopes to request (comma-separated string).
redirectUrl
string | null
Optional URL to redirect to after authorization completes.
Response
200
200422
application/json
Successful Response
oauthUrl
string
required
The OAuth authorization URL for the specified server.
Search...
Ctrl KAsk AI
Search...
Navigation
Manage MCP Server
Get Server Instance
Get Server Instance
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/instance/get/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"instanceId": "<string>",
"authNeeded": false,
"isAuthenticated": false,
"serverName": "",
"platform": "",
"externalUserId": ""
}
GET
/
mcp-server
/
instance
/
get
/
{instance_id}
Try it
Get Server Instance
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/instance/get/{instance_id} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"instanceId": "<string>",
"authNeeded": false,
"isAuthenticated": false,
"serverName": "",
"platform": "",
"externalUserId": ""
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Path Parameters
instance_id
string
required
The ID of the connection instance whose status is being checked. This is returned by the Create API.
Response
200
200422
application/json
Successful Response
instanceId
string | null
The unique identifier of the connection instance.
authNeeded
boolean
default:false
Indicates whether authentication is required for this server instance.
isAuthenticated
boolean
default:false
Indicates whether the instance is authenticated successfully.
serverName
string
default:""
The name of the MCP server associated with the instance.
platform
string
default:""
The platform associated with the instance.
externalUserId
string
default:""
The user's identifier on the external platform.
Create a Server Instance Delete a Server Instance
Search...
Ctrl KAsk AI
Search...
Navigation
MCP Server Metadata
Get Tools
Get Tools
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/tools/{server_name} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"tools": [\
{\
"name": "<string>",\
"description": "<string>"\
}\
]
}
GET
/
mcp-server
/
tools
/
{server_name}
Try it
Get Tools
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/mcp-server/tools/{server_name} \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"tools": [\
{\
"name": "<string>",\
"description": "<string>"\
}\
]
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Path Parameters
server_name
enum
required
The name of the target MCP server.
Available options:
Affinity,
Airtable,
Asana,
Attio,
ClickUp,
Close,
Confluence,
Discord,
Doc2markdown,
Firecrawl Deep Research,
Firecrawl Web Search,
GitHub,
Gmail,
Gong,
Google Calendar,
Google Docs,
Google Drive,
Google Sheets,
HubSpot,
Jira,
Klavis ReportGen,
Linear,
Markdown2doc,
Notion,
Plai,
Postgres,
Resend,
Salesforce,
Slack,
Supabase,
WhatsApp,
WordPress,
YouTube
Response
200
200422
application/json
Successful Response
tools
ServerTool · object[]
List of available tools with their descriptions
Show child attributes
name
string
required
description
string
required
Search...
Ctrl KAsk AI
Search...
Navigation
Function Calling with MCP
List Tools
List Tools
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/list-tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverUrl": "<string>",
"connectionType": "StreamableHttp",
"format": "mcp_native"
}'
200
422
Copy
Ask AI
{
"success": true,
"tools": [\
"<any>"\
],
"format": "openai",
"error": "<string>"
}
POST
/
mcp-server
/
list-tools
Try it
List Tools
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/list-tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"serverUrl": "<string>",
"connectionType": "StreamableHttp",
"format": "mcp_native"
}'
200
422
Copy
Ask AI
{
"success": true,
"tools": [\
"<any>"\
],
"format": "openai",
"error": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Body
application/json
serverUrl
string
required
The full URL for connecting to the MCP server
connectionType
enum
The connection type to use for the MCP server. Default is STREAMABLE_HTTP.
Available options:
SSE,
StreamableHttp
format
enum
The format to return tools in. Default is MCP Native format for maximum compatibility.
Available options:
openai,
anthropic,
gemini,
mcp_native
Response
200
200422
application/json
Successful Response
success
boolean
required
Whether the list tools request was successful
format
enum
required
The format of the returned tools
Available options:
openai,
anthropic,
gemini,
mcp_native
tools
any[] | null
List of tools in the requested format
error
string | null
Error message, if the request failed
Search...
Ctrl KAsk AI
Search...
Navigation
Auth / OAuth
Set Auth Token
Set Auth Token
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/instance/set-auth-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"instanceId": "<string>",
"authToken": "<string>"
}'
200
422
Copy
Ask AI
{
"success": true,
"message": "<string>"
}
POST
/
mcp-server
/
instance
/
set-auth-token
Try it
Set Auth Token
cURL
Copy
Ask AI
curl --request POST \
--url https://api.klavis.ai/mcp-server/instance/set-auth-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"instanceId": "<string>",
"authToken": "<string>"
}'
200
422
Copy
Ask AI
{
"success": true,
"message": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Body
application/json
instanceId
string
required
The unique identifier for the connection instance
authToken
string
required
The authentication token to save
Response
200
200422
application/json
Successful Response
success
boolean
required
message
string | null
Get OAuth URL Get Authentication Metadata
Search...
Ctrl KAsk AI
Search...
Navigation
User
Get user instances
Get user instances
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/user/instances \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"instances": [\
{\
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\
"name": "<string>",\
"description": "<string>",\
"tools": [\
{\
"name": "<string>",\
"description": "<string>"\
}\
],\
"authNeeded": true,\
"isAuthenticated": false\
}\
]
}
GET
/
user
/
instances
Try it
Get user instances
cURL
Copy
Ask AI
curl --request GET \
--url https://api.klavis.ai/user/instances \
--header 'Authorization: Bearer <token>'
200
422
Copy
Ask AI
{
"instances": [\
{\
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\
"name": "<string>",\
"description": "<string>",\
"tools": [\
{\
"name": "<string>",\
"description": "<string>"\
}\
],\
"authNeeded": true,\
"isAuthenticated": false\
}\
]
}
Assistant
Responses are generated using AI and may contain mistakes.
Authorizations
Authorization
string
header
required
Your Klavis AI API key.
Query Parameters
user_id
string
required
The external user ID
platform_name
string
required
The platform name
Response
200
200422
application/json
Successful Response
instances
ExtendedMcpServer · object[]
required
Show child attributes
