Connect a Slack agent. Requires project.channels.write.
Arguments
projectReferenceID!requiredProject ID or slug. Requires a person's credential; agent, run, and service-account callers are forbidden.
inputCreateChannelInput!requiredinput.platformChannelPlatform!requiredPlatform connected through the caller's Slack connection; Slack must already be connected. One of
slack.input.nameStringDisplay name, 1-255 characters.
input.agentIdString!requiredAn agent returned by channelAgents for the same runtime target.
input.respondToChannelRespondToDefault mentions. One of
mentions,direct_messages,all.input.allowedSlackChannelIds[String!]Slack channel IDs. Overlap with another channel in the same workspace is rejected with resource-already-exists. At most 250 IDs; empty means every Slack channel the bot is in. A preview_branch target needs at least one.
input.welcomeMessageStringAt most 4000 characters; null clears.
input.errorMessageStringAt most 4000 characters; null clears.
input.maxResponseTokensInt1-65536; null clears.
input.runtimeTargetKindRuntimeTargetKindDefault main_branch. One of
main_branch,environment,preview_branch.input.targetEnvironmentIdIDRequired when runtimeTargetKind is environment.
input.targetBranchIdIDRequired when runtimeTargetKind is preview_branch.
Responses
mutation CreateChannel($projectReference: ID!, $input: CreateChannelInput!) { createChannel(projectReference: $projectReference, input: $input) { id projectId platform name agentId enabled status installationId platformTeamId platformBotId workspaceName respondTo allowedSlackChannelIds welcomeMessage errorMessage maxResponseTokens runtimeTargetKind targetEnvironmentId targetBranchId resolvedTarget { resolvedInvokeMode } createdAt updatedAt }}{ "data": { "createChannel": { "id": "string", "projectId": "string", "platform": "slack", "name": "string", "agentId": "string", "enabled": false, "status": "connected", "installationId": "string", "platformTeamId": "string", "platformBotId": "string", "workspaceName": "string", "respondTo": "mentions", "allowedSlackChannelIds": [ "string" ], "welcomeMessage": "string", "errorMessage": "string", "maxResponseTokens": 0, "runtimeTargetKind": "main_branch", "targetEnvironmentId": "string", "targetBranchId": "string", "resolvedTarget": { "resolvedInvokeMode": "dispatch_override" }, "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-01-01T00:00:00Z" } }}The Channel! in data.createChannel.