Cody

App · 18 actions

Work with Cody assistants, knowledge-base documents, conversations and messages.

Actions

ActionWhat it does
Create conversationStart a conversation with a Cody assistant.
Create folderCreate a knowledge-base folder.
Create text documentAdd text to an existing knowledge-base folder.
Delete conversationRemove a conversation.
Delete documentRemove a document from the knowledge base.
Get conversationRead a conversation by ID.
Get documentRead a knowledge-base document.
Get folderRead a knowledge-base folder.
Get messageRead a conversation message.
Import webpageAdd a public webpage to a knowledge-base folder.
List botsFind Cody assistants in the connected workspace.
List conversationsFind conversations by assistant or name.
List documentsFind documents by folder, conversation or search text.
List foldersFind knowledge-base folders by name.
List messagesRead messages in a conversation.
Rename folderChange the name of a knowledge-base folder.
Send messageSend a message and get the assistant’s reply.
Update conversationSet the name, assistant and optional focus documents on a conversation.

Create conversation

Start a conversation with a Cody assistant.

Inputs

NamenametextRequired
Name.
Botbot_idtextRequired
Bot id.
Document idsdocument_idslist
Only documents that exist in the folders the bot has access to are allowed. You can give bot access to all folders if you wish to limit documents from your whole knowledge base.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "bot_id": "example",
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}

Create folder

Create a knowledge-base folder.

Inputs

NamenametextRequired
Name.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}

Create text document

Add text to an existing knowledge-base folder.

Inputs

NamenametextRequired
Name.
Folderfolder_idtextRequired
Folder id.
ContentcontenttextRequired
Up to 768 KB of text or html only.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "content_url": "example",
      "created_at": 1,
      "folder_id": "example",
      "id": "example",
      "name": "example",
      "status": "syncing"
    }
  }
}

Delete conversation

Remove a conversation.

Inputs

IdidtextRequired
Id of the conversation

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {}
}

Delete document

Remove a document from the knowledge base.

Inputs

IdidtextRequired
Id.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {}
}

Get conversation

Read a conversation by ID.

Inputs

IdidtextRequired
Id of the conversation

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "bot_id": "example",
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}

Get document

Read a knowledge-base document.

Inputs

IdidtextRequired
Id.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "content_url": "example",
      "created_at": 1,
      "folder_id": "example",
      "id": "example",
      "name": "example",
      "status": "syncing"
    }
  }
}

Get folder

Read a knowledge-base folder.

Inputs

IdidtextRequired
Id.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}

Get message

Read a conversation message.

Inputs

IdidtextRequired
ID of the message.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "content": "example",
      "conversation_id": "example",
      "created_at": 1,
      "failed_responding": false,
      "flagged": false,
      "id": "example",
      "machine": false,
      "sources": {
        "data": []
      },
      "usage": {
        "credits": 1.0,
        "tokens": 1
      }
    }
  }
}

Import webpage

Add a public webpage to a knowledge-base folder.

Inputs

Folderfolder_idtextRequired
Folder id.
UrlurltextRequired
Valid and publicly accessible webpage URL.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "content_url": "example",
      "created_at": 1,
      "folder_id": "example",
      "id": "example",
      "name": "example",
      "status": "syncing"
    }
  }
}

List bots

Find Cody assistants in the connected workspace.

Inputs

Keywordkeywordtext
Keyword to filter the list of bots to only those that at least partially match the bot name.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next_page": 1,
        "per_page": 1,
        "previous_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}

List conversations

Find conversations by assistant or name.

Inputs

Botbot_idtext
Id of the bot to filter the list of conversations to only those that are using the selected bot.
Keywordkeywordtext
Keyword to filter the list of conversations to only those that at least partially match the conversation name.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next_page": 1,
        "per_page": 1,
        "previous_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}

List documents

Find documents by folder, conversation or search text.

Inputs

Folderfolder_idtext
Id of the folder to list documents for.
Conversation idconversation_idtext
Id of the conversation to only list documents the conversation is focused on.
Keywordkeywordtext
Keyword to filter the list to documents that partially match the name.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next_page": 1,
        "per_page": 1,
        "previous_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}

List folders

Find knowledge-base folders by name.

Inputs

Keywordkeywordtext
Keyword to filter the list to folders that partially match the name.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next_page": 1,
        "per_page": 1,
        "previous_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}

List messages

Read messages in a conversation.

Inputs

Conversation idconversation_idtext
Id of the conversation to filter the list of messages to only that conversation.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next_page": 1,
        "per_page": 1,
        "previous_page": 1,
        "total": 1,
        "total_pages": 1
      }
    }
  }
}

Rename folder

Change the name of a knowledge-base folder.

Inputs

IdidtextRequired
Id.
NamenametextRequired
Name.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}

Send message

Send a message and get the assistant’s reply.

Inputs

ContentcontenttextRequired
Content.
Conversation idconversation_idtextRequired
Conversation id.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "content": "example",
      "conversation_id": "example",
      "created_at": 1,
      "failed_responding": false,
      "flagged": false,
      "id": "example",
      "machine": false
    }
  }
}

Update conversation

Set the name, assistant and optional focus documents on a conversation.

Inputs

IdidtextRequired
Id of the conversation
NamenametextRequired
Name.
Botbot_idtextRequired
Bot id.
Document idsdocument_idslist
Only documents that exist in the folders the bot has access to are allowed. You can give bot access to all folders if you wish to limit documents from your whole knowledge base.

Outputs

dataobject
The response from Cody.
Example output
{
  "data": {
    "data": {
      "bot_id": "example",
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}

On this page