> ## Documentation Index
> Fetch the complete documentation index at: https://wukong.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Channel Subscribers

> Add subscribers (members) to a channel

## Overview

Add subscribers (members) to a channel, supporting batch addition and reset mode.

## Request Body

### Required Parameters

<ParamField body="channel_id" type="string" required>
  Channel ID
</ParamField>

<ParamField body="channel_type" type="integer" required>
  Channel type

  * `1` - Personal channel
  * `2` - Group channel
</ParamField>

<ParamField body="subscribers" type="array" required>
  List of subscriber user IDs to add

  <ParamField body="subscribers[]" type="string">
    User ID
  </ParamField>
</ParamField>

### Optional Parameters

<ParamField body="reset" type="integer" default={0}>
  Whether to reset existing subscribers

  * `0` - Do not reset, append new subscribers
  * `1` - Reset, replace all existing subscribers
</ParamField>

<ParamField body="temp_subscriber" type="integer" default={0}>
  Whether as temporary subscriber

  * `0` - Permanent subscriber
  * `1` - Temporary subscriber
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "http://localhost:5001/channel/subscriber_add" \
    -H "Content-Type: application/json" \
    -d '{
      "channel_id": "group123",
      "channel_type": 2,
      "subscribers": ["user4", "user5", "user6"],
      "reset": 0,
      "temp_subscriber": 0
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('http://localhost:5001/channel/subscriber_add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      channel_id: 'group123',
      channel_type: 2,
      subscribers: ['user4', 'user5', 'user6'],
      reset: 0,
      temp_subscriber: 0
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  data = {
      "channel_id": "group123",
      "channel_type": 2,
      "subscribers": ["user4", "user5", "user6"],
      "reset": 0,
      "temp_subscriber": 0
  }

  response = requests.post('http://localhost:5001/channel/subscriber_add', json=data)
  result = response.json()
  print(result)
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      data := map[string]interface{}{
          "channel_id":      "group123",
          "channel_type":    2,
          "subscribers":     []string{"user4", "user5", "user6"},
          "reset":           0,
          "temp_subscriber": 0,
      }
      
      jsonData, _ := json.Marshal(data)
      
      resp, err := http.Post(
          "http://localhost:5001/channel/subscriber_add",
          "application/json",
          bytes.NewBuffer(jsonData),
      )
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()
      
      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Printf("%+v\n", result)
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "status": "ok"
  }
  ```
</ResponseExample>

## Response Fields

<ResponseField name="status" type="string" required>
  Operation status, returns `"ok"` on success
</ResponseField>

## Status Codes

| Status Code | Description                    |
| ----------- | ------------------------------ |
| 200         | Subscribers added successfully |
| 400         | Request parameter error        |
| 403         | No operation permission        |
| 404         | Channel does not exist         |
| 500         | Internal server error          |

## Parameter Description

### Reset Mode (reset)

| Value | Mode        | Description                                    | Use Case                   |
| ----- | ----------- | ---------------------------------------------- | -------------------------- |
| 0     | Append mode | Add new members to existing members            | Invite new members to join |
| 1     | Reset mode  | Clear existing members, set as new member list | Rebuild group              |

### Temporary Subscriber (temp\_subscriber)

| Value | Type                 | Features                       | Applicable Scenario                      |
| ----- | -------------------- | ------------------------------ | ---------------------------------------- |
| 0     | Permanent subscriber | Persistent member relationship | Official group members                   |
| 1     | Temporary subscriber | Temporary member relationship  | Temporary visitors, meeting participants |

## Use Cases

### Group Management

* **Invite new members**: Group owner or admin invites new users to join the group
* **Batch import**: Batch import member lists from other platforms
* **Rebuild group**: Use reset mode to rebuild group members
