Switch icon

Switch

Switch API Integration

Overview

This node integrates with the Switch API to manage communication channels and groups within a community. Specifically, the "Create Channel" operation allows users to create a new channel by specifying its name, an optional icon URL, and whether the channel should be private.

Common scenarios for this node include automating the setup of communication channels in team collaboration platforms or community management systems. For example, when onboarding new projects or teams, you can automatically create dedicated channels with specific privacy settings and branding (via icons).

Practical example: Automatically create a private channel named "Project Alpha" with a custom icon URL whenever a new project is initiated in your workflow.

Properties

Name Meaning
Channel Name The name of the channel to create. This is a required string input.
Icon URL of the icon image to associate with the channel. Optional string.
Is Private Boolean flag indicating if the channel should be private (true) or public (false). Required.

Output

The node outputs a JSON object representing the response from the Switch API after creating the channel. This typically includes details about the newly created channel such as its ID, name, privacy status, and possibly other metadata returned by the API.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "id": "string",
  "name": "string",
  "icon": "string",
  "isPrivate": true
}

Dependencies

  • Requires an active connection to the Switch API via an API key credential.
  • The node makes HTTP POST requests to http://localhost:8000/createChannel endpoint.
  • The API key credential must be configured in n8n to authorize requests.
  • The local server at localhost:8000 must be accessible and running the Switch API service.

Troubleshooting

  • Common issues:

    • Network errors if the Switch API server is not reachable at localhost:8000.
    • Authentication failures if the API key credential is missing or invalid.
    • Validation errors if required properties like "Channel Name" or "Is Private" are missing or malformed.
  • Error messages:

    • "Operation "createChannel" not supported": Indicates the operation parameter was incorrect or unsupported; ensure the operation is set exactly to "createChannel".
    • API response errors may include messages about invalid parameters or permission issues; verify all inputs and API credentials.
  • Resolutions:

    • Confirm the Switch API service is running and accessible.
    • Verify API key credentials are correctly set up in n8n.
    • Double-check that all required fields are provided and valid.

Links and References

Discussion