# Cody

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

App · 18 actions. Web page: https://docs.lodol.com/docs/integrations/cody

## Actions

### Create conversation

Start a conversation with a Cody assistant.

**Inputs**

- Name (`name`, text, required): Name.
- Bot (`bot_id`, text, required): Bot id.
- Document ids (`document_ids`, list): 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**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {
    "data": {
      "bot_id": "example",
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}
```

### Create folder

Create a knowledge-base folder.

**Inputs**

- Name (`name`, text, required): Name.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {
    "data": {
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}
```

### Create text document

Add text to an existing knowledge-base folder.

**Inputs**

- Name (`name`, text, required): Name.
- Folder (`folder_id`, text, required): Folder id.
- Content (`content`, text, required): Up to 768 KB of text or html only.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {
    "data": {
      "content_url": "example",
      "created_at": 1,
      "folder_id": "example",
      "id": "example",
      "name": "example",
      "status": "syncing"
    }
  }
}
```

### Delete conversation

Remove a conversation.

**Inputs**

- Id (`id`, text, required): Id of the conversation

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {}
}
```

### Delete document

Remove a document from the knowledge base.

**Inputs**

- Id (`id`, text, required): Id.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {}
}
```

### Get conversation

Read a conversation by ID.

**Inputs**

- Id (`id`, text, required): Id of the conversation

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {
    "data": {
      "bot_id": "example",
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}
```

### Get document

Read a knowledge-base document.

**Inputs**

- Id (`id`, text, required): Id.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Id (`id`, text, required): Id.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {
    "data": {
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}
```

### Get message

Read a conversation message.

**Inputs**

- Id (`id`, text, required): ID of the message.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Folder (`folder_id`, text, required): Folder id.
- Url (`url`, text, required): Valid and publicly accessible webpage URL.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Keyword (`keyword`, text): Keyword to filter the list of bots to only those that at least partially match the bot name.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Bot (`bot_id`, text): Id of the bot to filter the list of conversations to only those that are using the selected bot.
- Keyword (`keyword`, text): Keyword to filter the list of conversations to only those that at least partially match the conversation name.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Folder (`folder_id`, text): Id of the folder to list documents for.
- Conversation id (`conversation_id`, text): Id of the conversation to only list documents the conversation is focused on.
- Keyword (`keyword`, text): Keyword to filter the list to documents that partially match the name.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Keyword (`keyword`, text): Keyword to filter the list to folders that partially match the name.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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 id (`conversation_id`, text): Id of the conversation to filter the list of messages to only that conversation.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Id (`id`, text, required): Id.
- Name (`name`, text, required): Name.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {
    "data": {
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}
```

### Send message

Send a message and get the assistant’s reply.

**Inputs**

- Content (`content`, text, required): Content.
- Conversation id (`conversation_id`, text, required): Conversation id.

**Outputs**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "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**

- Id (`id`, text, required): Id of the conversation
- Name (`name`, text, required): Name.
- Bot (`bot_id`, text, required): Bot id.
- Document ids (`document_ids`, list): 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**

- `data` (object): The response from Cody.

**Example output**

```json
{
  "data": {
    "data": {
      "bot_id": "example",
      "created_at": 1,
      "id": "example",
      "name": "example"
    }
  }
}
```
