ClickSend icon

ClickSend

Consume ClickSend API

Overview

The ClickSend node for n8n, when configured with the "SMS" resource and the "Calculate SMS Price" operation, allows users to estimate the cost of sending one or more SMS messages before actually dispatching them. This is particularly useful for budgeting, pre-validation, or providing cost transparency in automated workflows that involve messaging customers, notifications, or alerts.

Practical examples:

  • A business wants to calculate the total cost of a marketing SMS campaign before sending.
  • An application needs to display estimated SMS costs to users before they confirm sending bulk messages.
  • Automated workflows require validation that the cost of sending SMS does not exceed a set budget.

Properties

Name Type Meaning
SMS Messages Collection An array of SMS message objects, each representing a message to price. Each object contains:
  Body String The content of the SMS message. Required.
  To String Recipient phone number in E.164 format (e.g., +61411111111). Required.
  Source Name String Method/source of sending (e.g., 'wordpress', 'php', 'c#').
  Schedule DateTime Optional scheduled time for delivery. Leave blank for immediate delivery.
  Custom String String Custom reference string returned with replies and delivery reports.
  List ID Number List ID if sending to a group/list instead of an individual recipient.
  Country Code String ISO alpha-2 country code (e.g., "US", "AU") for formatting numbers not in international format.
  From Email String Email address for reply forwarding. If omitted, replies go to the sender's email.

Output

The output will be a JSON object containing the calculated price(s) for the provided SMS messages. The structure typically includes:

  • Pricing details per message (such as cost, currency, breakdown by destination, etc.)
  • Any errors encountered during calculation (e.g., invalid numbers, unsupported countries)

Example output structure:

{
  "messages": [
    {
      "to": "+61411111111",
      "body": "Hello from n8n!",
      "price": 0.05,
      "currency": "USD"
    }
  ],
  "total_price": 0.05,
  "currency": "USD"
}

Note: Actual fields may vary depending on the ClickSend API response.

Dependencies

  • External Service: Requires access to the ClickSend API with valid credentials.
  • n8n Credentials: You must configure the clickSendApi credential in your n8n instance.
  • Environment: Internet access to reach https://rest.clicksend.com/v3.

Troubleshooting

Common issues:

  • Invalid phone number format: Ensure all numbers are in E.164 format or provide a valid country code for formatting.
  • Missing required fields: Both "Body" and "To" are mandatory for each message.
  • Authentication errors: Make sure your ClickSend API credentials are correct and active.
  • API quota exceeded: Check your ClickSend account limits if you receive quota or rate limit errors.

Common error messages:

  • "Invalid recipient number": Check the "To" field and country code.
  • "Authentication failed": Verify your ClickSend API credentials in n8n.
  • "Missing required parameter": Ensure all required fields are filled for each message.

Links and References

Discussion