Start a conversation in a project when a user or an agent opens a new thread, optionally with a first user message; a retry with the same idempotency key returns the same conversation. Requires project.conversations.create.
Arguments
inputCreateConversationInput!requiredinput.projectReferenceStringinput.typeStringinput.titleStringinput.metadataJSONinput.idempotencyKeyStringRetrying with the same key and the same input returns the same conversation; a different input fails with IDEMPOTENCY_CONFLICT.
input.initialMessageCreateConversationInitialMessageInputA first user message stored atomically with the conversation.
Responses
mutation CreateConversation($input: CreateConversationInput!) { createConversation(input: $input) { id projectId respondingAgentId type title summary status currentNode messageCount lastMessageAt metadata createdBy archivedAt createdAt updatedAt participants { id conversationId participantId participantType userId agentId displayName agentKind avatarUrl role lastReadMessageId notificationPreference joinedAt } activeAgentRun { runId conversationId messageId projectId requestedByUserId triggerPrincipalType triggerPrincipalId agentId status implementationKind workerKey sourceTargetKind sourceTargetEnvironmentId sourceTargetBranchId sourceTargetReleaseVersion runtimeTargetKind runtimeTargetEnvironmentId runtimeTargetBranchId parentConversationId parentRunId spawnedFromMessageId spawnedFromToolCallId inputAnchorMessageId handoffMessageId resolvedDeploymentId latestEventId latestExternalEventSequence waitingToolCallId waitingToolName terminalErrorCode terminalErrorMessage createdAt startedAt finishedAt runSnapshot } initialMessageId }}{ "data": { "createConversation": { "id": "string", "projectId": "string", "respondingAgentId": "string", "type": "string", "title": "string", "summary": "string", "status": "string", "currentNode": "string", "messageCount": 0, "lastMessageAt": "string", "metadata": {}, "createdBy": "string", "archivedAt": "string", "createdAt": "string", "updatedAt": "string", "participants": [ { "id": "string", "conversationId": "string", "participantId": "string", "participantType": "string", "userId": "string", "agentId": "string", "displayName": "string", "agentKind": "string", "avatarUrl": "https://example.com", "role": "string", "lastReadMessageId": "string", "notificationPreference": "string", "joinedAt": "string" } ], "activeAgentRun": { "runId": "string", "conversationId": "string", "messageId": "string", "projectId": "string", "requestedByUserId": "string", "triggerPrincipalType": "string", "triggerPrincipalId": "string", "agentId": "string", "status": "string", "implementationKind": "string", "workerKey": "string", "sourceTargetKind": "string", "sourceTargetEnvironmentId": "string", "sourceTargetBranchId": "string", "sourceTargetReleaseVersion": "string", "runtimeTargetKind": "string", "runtimeTargetEnvironmentId": "string", "runtimeTargetBranchId": "string", "parentConversationId": "string", "parentRunId": "string", "spawnedFromMessageId": "string", "spawnedFromToolCallId": "string", "inputAnchorMessageId": "string", "handoffMessageId": "string", "resolvedDeploymentId": "string", "latestEventId": 0, "latestExternalEventSequence": 0, "waitingToolCallId": "string", "waitingToolName": "string", "terminalErrorCode": "string", "terminalErrorMessage": "string", "createdAt": "string", "startedAt": "string", "finishedAt": "string", "runSnapshot": {} }, "initialMessageId": "string" } }}The Conversation! in data.createConversation.