Skip to main content
Credal | Documentation

Search documentation

Type to search this documentation.

On this pageOverview

Create Conversation

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

OPTIONAL. Create a new conversation with the Agent. The conversation ID can be used in the sendMessage endpoint. The sendMessage endpoint automatically creates new conversations upon first request, but calling this endpoint can simplify certain use cases where it is helpful for the application to have the conversation ID before the first message is sent.

Reference: https://docs.credal.ai/api-reference/api-reference/copilots/create-conversation

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

This endpoint expects an object.

  • agentId (UUID, required) — Credal-generated Agent ID to specify which agent to route the request to.
  • userEmail (string, required) — End-user for the conversation.
  • conversationId (UUID, required)

Request

JSON
{
  "agentId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
  "userEmail": "ravin@credal.ai"
}

Response

JSON
{
  "conversationId": "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
}

SDK Code

Example0
import { CredalClient } from "@credal/sdk";

async function main() {
    const client = new CredalClient({
        apiKey: "YOUR_TOKEN_HERE",
    });
    await client.copilots.createConversation({
        agentId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
        userEmail: "ravin@credal.ai",
    });
}
main();
Example0
from credal import CredalV0
import uuid

client = CredalV0(
    api_key="YOUR_TOKEN_HERE",
)

client.copilots.create_conversation(
    agent_id=uuid.UUID("82e4b12a-6990-45d4-8ebd-85c00e030c24"),
    user_email="ravin@credal.ai",
)
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu