> This page is for API Reference, version v0 (default).
> For other versions, use one of these documentation indexes:
> - v0 (default): https://docs.credal.ai/api-reference/v-0/llms.txt
> - v1: https://docs.credal.ai/api-reference/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.credal.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.credal.ai/_mcp/server.

# Send Message

POST https://api.credal.ai/api/v0/copilots/sendMessage
Content-Type: application/json

**Deprecated.** Use the [v1 Agents API](/api-reference/v-1/api-reference/agents) instead: send a message with `POST /v1/agents/sendMessage`, then poll for the response with `GET /v1/agents/fetchAgentResponse`.

Reference: https://docs.credal.ai/api-reference/api-reference/copilots/send-message

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an object.

- `agentId` (UUID, required) — Credal-generated Agent ID to specify which agent to route the request to.
- `message` (string, required) — The message you want to send to your agent.
- `userEmail` (string, required) — The user profile you want to use when sending the message.
- `conversationId` (UUID, optional) — Credal-generated conversation ID for sending follow up messages. Conversation ID is returned after initial message. Optional, to be left off for first messages on new conversations.
- `inputVariables` (list of InputVariable, optional) — Optional input variables to be used in the message. Map the name of the variable to a list of urls.

## Response

### 200

- `sendChatResult` (SendMessageResponse, required)

## Types

### InputVariable

- `name` (string, required)
- `ids` (list of UUID, required)

### SendMessageResponse

- `type`: `ai_response_result`
  - `conversationId` (UUID, required)
  - `inserted_audit_log` (InsertedAuditLog, required)
  - `messageId` (UUID, required)
  - `referencedSources` (list of ReferencedSource, required)
  - `response` (ResponseChunk, required)
  - `sourcesInDataContext` (list of ReferencedSource, required)
  - `warnings` (list of string, required)
  - `webSearchResults` (list of WebSearchResult, required)
- `type`: `blocked_result`
  - `blocks` (list of string, required)
  - `conversationId` (UUID, required)
  - `inserted_audit_log` (InsertedAuditLog, required)
  - `warnings` (list of string, required)

### InsertedAuditLog

- `id` (UUID, required)

### ReferencedSource

- `id` (string, required)
- `externalResourceId` (ExternalResourceId, required)
- `name` (string, required)
- `url` (string, optional)

### ResponseChunk

- `message` (string, required)
- `dataChunk` (string, required)
- `structuredOutput` (any, optional)

### WebSearchResult

- `title` (string, required)
- `url` (string, required)
- `contents` (string, required)

### ExternalResourceId

- `externalResourceId` (string, required)
- `resourceType` (enum, required)
  - Allowed values: `GOOGLE_DRIVE_ITEM`, `MICROSOFT_DRIVE_ITEM`, `ZENDESK_TICKET`, `ZENDESK_ARTICLE`, `ZENDESK_GROUP`, `ZENDESK_ARTICLE_SECTION`, `ZENDESK_ARTICLE_CATEGORY`, `CONFLUENCE_PAGE`, `CONFLUENCE_SPACE`, `JIRA_TICKET`, `JIRA_PROJECT`, `SALESFORCE_TASK`, `BOX_FILE`, `BOX_FOLDER`, `NOTION_PAGE`, `NOTION_DATABASE`, `SLACK_CHANNEL`, `MONGO_COLLECTION_SYNC`, `UNKNOWN`

## Examples

**Request**

```json
{
  "agentId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
  "message": "Is Credal SOC 2 compliant?",
  "userEmail": "ravin@credal.ai",
  "inputVariables": [
    {
      "name": "input1",
      "ids": [
        "82e4b12a-6990-45d4-8ebd-85c00e030c24"
      ]
    },
    {
      "name": "input2",
      "ids": [
        "82e4b12a-6990-45d4-8ebd-85c00e030c25",
        "82e4b12a-6990-45d4-8ebd-85c00e030c26"
      ]
    }
  ]
}
```

**Response**

```json
{
  "sendChatResult": {
    "type": "ai_response_result",
    "conversationId": "fc938005-92db-411a-88eb-32ca50d5f744",
    "inserted_audit_log": {
      "id": "5842804e-ffbe-4f8d-873e-f007fff93440"
    },
    "messageId": "dd721cd8-4bf2-4b94-9869-258df3dab9dc",
    "referencedSources": [
      {
        "id": "1",
        "externalResourceId": {
          "externalResourceId": "123456",
          "resourceType": "GOOGLE_DRIVE_ITEM"
        },
        "name": "Example Document",
        "url": "https://drive.google.com/file/d/123456/view"
      }
    ],
    "response": {
      "message": "Based on the context provided, Credal is SOC 2 compliant...",
      "dataChunk": "...SOC 2 is a technical audit that requires companies to establish and follow strict information security policies and procedures. Credal's SOC 2 report is available upon request..."
    },
    "sourcesInDataContext": [
      {
        "id": "1",
        "externalResourceId": {
          "externalResourceId": "123456",
          "resourceType": "GOOGLE_DRIVE_ITEM"
        },
        "name": "Example Document",
        "url": "https://drive.google.com/file/d/123456/view"
      },
      {
        "id": "2",
        "externalResourceId": {
          "externalResourceId": "123457",
          "resourceType": "GOOGLE_DRIVE_ITEM"
        },
        "name": "Example Document 2",
        "url": "https://drive.google.com/file/d/123457/view"
      }
    ],
    "warnings": [],
    "webSearchResults": [
      {
        "title": "SOC 2 Compliance",
        "url": "https://www.credal.ai/soc2",
        "contents": "Credal is SOC 2 compliant. Learn more about SOC 2 compliance at Credal."
      }
    ]
  }
}
```