Connect an agent to a Slack workspace

createChannel(projectReference: ID!, input: CreateChannelInput!): Channel!

Requires project.channels.write.

Arguments

ArgumentTypeRequiredDescription
projectReferenceID!YesProject ID or slug. Requires a person's credential; agent, run, and service-account callers are forbidden.
inputCreateChannelInput!Yes

Input fields

input

CreateChannelInput

FieldTypeRequiredDescription
platformChannelPlatform!YesPlatform connected through the caller's Slack connection; Slack must already be connected.
nameStringNoDisplay name, 1-255 characters.
agentIdString!YesAn agent returned by channelAgents for the same runtime target.
respondToChannelRespondToNoDefault mentions.
allowedSlackChannelIds[String!]NoSlack 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.
welcomeMessageStringNoAt most 4000 characters; null clears.
errorMessageStringNoAt most 4000 characters; null clears.
maxResponseTokensIntNo1-65536; null clears.
runtimeTargetKindRuntimeTargetKindNoDefault main_branch.
targetEnvironmentIdIDNoRequired when runtimeTargetKind is environment.
targetBranchIdIDNoRequired when runtimeTargetKind is preview_branch.

Response

Returns Channel!. Open the type for its fields and nested types.

FieldTypeDescription
idID!
projectIdID!
platformChannelPlatform!
nameString
agentIdStringProject agent that answers in this channel.
enabledBoolean!Always true today; kept for forward compatibility.
statusChannelStatus!
installationIdID

All fields of Channel.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation CreateChannel($projectReference: ID!, $input: CreateChannelInput!) {
  createChannel(projectReference: $projectReference, input: $input) {
    id
    projectId
    agentId
    name
    status
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "input": {
    "platform": "slack",
    "agentId": "agent-example"
  }
}