The Cody connector lets your AI agent act in each user's Cody account. Each user connects their own Cody access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 18 tools.
- Tools
- 18
- What they doRead · write · destructive
- 9 · 7 · 29 read7 write2 destructive
- Users sign in with
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Cody connection
In AgentKit > Connections, create a Cody connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'cody'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Cody:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'cody_bots_list',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "cody"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Cody:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="cody_bots_list",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Cody credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolcody_bots_listList the AI bots in the Cody account, optionally filtered by name.Read-onlyList Bots
List the AI bots in the Cody account, optionally filtered by name. Returns each bot's id, name, model and created_at. Use this to find a bot ID for Create Conversation. Bots are created in the Cody dashboard, not through the API.
Inputs
keywordstring- Only return items whose name at least partially matches this text. Example: support.
cody_conversation_getGet one Cody conversation by ID.Read-onlyGet Conversation
Get one Cody conversation by ID. Returns its id, name, bot_id and created_at, plus focused document IDs when requested. Use List Messages for its messages.
Inputs
conversation_idstringrequired- ID of the conversation. Find it with List Conversations. Example: Cv7Mn2Bq8Tz4.
includesstring- Set to document_ids to include the IDs of the documents the conversation is focused on. Example: document_ids.one of
document_ids
cody_conversations_listList conversations in the Cody account, optionally filtered by bot or name.Read-onlyList Conversations
List conversations in the Cody account, optionally filtered by bot or name. Returns each conversation's id, name, bot_id and created_at, plus focused document IDs when requested. Use this to find a conversation. Use List Messages for the messages in one conversation.
Inputs
bot_idstring- Only return conversations that use this bot ID, from List Bots. Example: Xb8Lq3mN5pRw.
includesstring- Set to document_ids to include the IDs of the documents each conversation is focused on. Example: document_ids.one of
document_ids keywordstring- Only return items whose name at least partially matches this text. Example: support.
cody_document_getGet one document from the Cody knowledge base by ID.Read-onlyGet Document
Get one document from the Cody knowledge base by ID. Returns its id, name, status, folder_id, content_url and created_at. Use List Documents to find the ID.
Inputs
document_idstringrequired- ID of the document. Find it with List Documents. Example: Dc4Kp8Wn2Qx6.
cody_documents_listList documents in the Cody knowledge base, filtered by folder, conversation focus or name.Read-onlyList Documents
List documents in the Cody knowledge base, filtered by folder, conversation focus or name. Returns each document's id, name, status, folder_id and content_url. Use this to find a document ID. Use Get Document for one document.
Inputs
conversation_idstring- Only return documents the given conversation is focused on. Example: Cv7Mn2Bq8Tz4.
folder_idstring- Only return documents in this folder ID, from List Folders. Example: Fk2Lm9Qp4Xs7.
keywordstring- Only return documents whose name at least partially matches this text. Example: support.
cody_folder_getGet one Cody knowledge-base folder by ID.Read-onlyGet Folder
Get one Cody knowledge-base folder by ID. Returns its id, name and created_at. Use List Documents with the folder ID to see its documents.
Inputs
folder_idstringrequired- ID of the folder. Find it with List Folders. Example: Fk2Lm9Qp4Xs7.
cody_folders_listList the folders of the Cody knowledge base, optionally filtered by name.Read-onlyList Folders
List the folders of the Cody knowledge base, optionally filtered by name. Returns each folder's id, name and created_at. Use this to find a folder ID for Create Document or List Documents.
Inputs
keywordstring- Only return items whose name at least partially matches this text. Example: support.
cody_message_getGet one Cody message by ID.Read-onlyGet Message
Get one Cody message by ID. Returns its id, content, machine flag, conversation_id and created_at, plus sources or token usage when requested. Use List Messages to find the ID.
Inputs
message_idstringrequired- ID of the message. Find it with List Messages. Example: Ms3Jk7Lp1Vb9.
includesstring- Extra attributes to include: sources (knowledge-base documents used for the answer) or usage (tokens and credits used). Example: sources.one of
sourcesusage
cody_messages_listList messages, optionally only those in one Cody conversation.Read-onlyList Messages
List messages, optionally only those in one Cody conversation. Returns each message's id, content, machine (true for bot replies), conversation_id and created_at, plus sources or token usage when requested. Use Get Message for one message.
Inputs
conversation_idstring- Only return messages in this conversation ID, from List Conversations. Example: Cv7Mn2Bq8Tz4.
includesstring- Extra attributes to include: sources (knowledge-base documents used for the answer) or usage (tokens and credits used). Example: sources.one of
sourcesusage
cody_conversation_createStart a new conversation with a Cody bot, optionally focused on specific documents.WriteCreate Conversation
Start a new conversation with a Cody bot, optionally focused on specific documents. Returns the new conversation's id, name and bot_id. Use Send Message next to ask the bot a question in it.
Inputs
bot_idstringrequired- ID of the bot that answers in this conversation, from List Bots. Example: Xb8Lq3mN5pRw.
namestringrequired- Name of the conversation. Example: Customer onboarding questions.
document_idsarray- Document IDs to focus the conversation on, so the bot answers only from them (Focus Mode). Omit to use the bot's whole knowledge base. Example: ["Dc4Kp8Wn2Qx6"].
cody_conversation_updateRename a Cody conversation, change its bot or change the documents it is focused on.WriteUpdate Conversation
Rename a Cody conversation, change its bot or change the documents it is focused on. Returns the updated conversation. Send name and bot_id every time, even when unchanged.
Inputs
bot_idstringrequired- Bot ID for the conversation, from List Bots; send the current bot ID to keep it. Example: Xb8Lq3mN5pRw.
conversation_idstringrequired- ID of the conversation. Find it with List Conversations. Example: Cv7Mn2Bq8Tz4.
namestringrequired- New name of the conversation; send the current name to keep it. Example: Onboarding questions (resolved).
document_idsarray- Document IDs to focus the conversation on. Omit to keep using the bot's whole knowledge base. Example: ["Dc4Kp8Wn2Qx6"].
cody_document_createAdd a text or HTML document to the Cody knowledge base in a folder.WriteCreate Document
Add a text or HTML document to the Cody knowledge base in a folder. Returns the new document's id, name, status and folder_id; it is indexed in the background. Use Create Document From Webpage to import a public URL instead.
Inputs
contentstringrequired- Document content as plain text or HTML, up to 768 KB. HTML headings with paragraphs give the best answers. Example: <h2>Refunds</h2><p>We refund within 30 days of purchase.</p>.
folder_idstringrequired- Folder ID to add the document to, from List Folders. Example: Fk2Lm9Qp4Xs7.
namestringrequired- Name of the document. Example: Refund policy.
cody_document_create_from_webpageImport a public webpage into the Cody knowledge base as a document.WriteCreate Document From Webpage
Import a public webpage into the Cody knowledge base as a document. Returns the new document's id, name and status; the page is fetched and indexed in the background. The page must be reachable without a login. Use Create Document to add your own text.
Inputs
folder_idstringrequired- Folder ID to add the document to, from List Folders. Example: Fk2Lm9Qp4Xs7.
urlstringrequired- Public URL of the webpage to import. Example: https://example.com/help/refunds.
cody_folder_createCreate a folder in the Cody knowledge base.WriteCreate Folder
Create a folder in the Cody knowledge base. Returns the new folder's id and name. Add documents to it with Create Document or Create Document From Webpage.
Inputs
namestringrequired- Name of the folder. Example: Policies.
cody_folder_updateRename a Cody knowledge-base folder.WriteRename Folder
Rename a Cody knowledge-base folder. Returns the updated folder. Use List Folders to find the folder ID.
Inputs
folder_idstringrequired- ID of the folder. Find it with List Folders. Example: Fk2Lm9Qp4Xs7.
namestringrequired- New name of the folder. Example: Company policies.
cody_message_sendSend a message to a Cody conversation and wait for the bot's answer.WriteSend Message
Send a message to a Cody conversation and wait for the bot's answer. Returns the bot's reply message with its id, content and created_at. Use Create Conversation first. Each answer uses Cody message credits; a 402 means the account is out of credits.
Inputs
contentstringrequired- The question or message to send to the bot, up to 2000 characters. Example: What is the refund policy?.
conversation_idstringrequired- Conversation ID to send the message in, from Create Conversation or List Conversations. Example: Cv7Mn2Bq8Tz4.
cody_conversation_deleteDelete a Cody conversation and its messages.DestructiveDelete Conversation
Delete a Cody conversation and its messages. Returns an empty success response. This cannot be undone.
- Idempotent
Inputs
conversation_idstringrequired- ID of the conversation. Find it with List Conversations. Example: Cv7Mn2Bq8Tz4.
cody_document_deleteDelete a document from the Cody knowledge base.DestructiveDelete Document
Delete a document from the Cody knowledge base. Returns an empty success response. Bots stop using the document's content in answers.
- Idempotent
Inputs
document_idstringrequired- ID of the document. Find it with List Documents. Example: Dc4Kp8Wn2Qx6.
No tools match.