Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

The "Remove Admin" operation in the Group resource of this Green API node allows users to remove admin rights from a participant in a WhatsApp group. This is useful for managing group permissions dynamically, such as when an admin should no longer have elevated privileges or when restructuring group roles.

Typical scenarios include:

  • Revoking admin rights from a user who no longer needs them.
  • Managing group membership and roles programmatically within workflows.
  • Automating group administration tasks based on external triggers or conditions.

For example, a workflow could automatically remove admin rights from a participant after a certain event or time period, helping maintain group order without manual intervention.

Properties

Name Meaning
Mode Selects whether the node performs an action ("Action") or listens for incoming webhooks ("Listen for Incoming Webhook"). For this operation, use "Action".
Resource The type of entity to operate on; here it must be "Group".
Operation The specific action to perform; here it is "Remove Admin".
Group ID The unique identifier of the WhatsApp group where the admin rights will be removed. Format example: 972501234567-1587570015@g.us.
Participant Chat ID The chat ID of the participant whose admin rights are to be removed. Format example: 972501234567@c.us.

Output

The node outputs a JSON array containing the response from the Green API server for the "removeAdmin" request. The structure typically includes confirmation of the operation's success or failure and any relevant metadata returned by the API.

Example output JSON (simplified):

{
  "result": true,
  "message": "Admin rights removed successfully"
}

No binary data output is involved in this operation.

Dependencies

  • Requires valid credentials for the Green API service, including an instance ID and an API token.
  • The node makes HTTP POST requests to the Green API endpoints.
  • No additional environment variables are required beyond the configured credentials.

Troubleshooting

  • Common issues:

    • Invalid or missing Group ID or Participant Chat ID will cause the operation to fail.
    • Insufficient permissions or invalid API credentials can result in authentication errors.
    • Network connectivity problems may prevent successful API calls.
  • Error messages:

    • "Failed to remove admin: <error message>" indicates the API call failed. Check the provided Group ID and Participant Chat ID for correctness.
    • Errors related to reading files or binary data do not apply to this operation but may appear if other operations are used incorrectly.
    • If the node is set to "trigger" mode instead of "action", it will throw an error instructing to use it as a trigger node.
  • Resolution tips:

    • Verify that the Group ID and Participant Chat ID are correctly formatted and correspond to actual WhatsApp entities.
    • Ensure the API credentials are valid and have the necessary permissions.
    • Confirm network access to the Green API endpoints.
    • Use the node only in "Action" mode for this operation.

Links and References

Discussion