API Reference

Every API call in SENDUNE is a simple, language agnostic, cURL request.

SENDUNE does not publish integration libraries for any programming languages. You do not have to embed or update or maintain any of our code within your code. This is in line with our first principles.

Base URL

https://api.sendune.com

The Base URL is followed by the endpoint you wish to call. Every API call must include the relevant 'secret key'. The base URL accepts only HTTPS traffic. HTTP is rejected.

There are four API endpoints.

1. Contacts API

The 'add-contact' endpoint is is used to add/update contacts.

https://api.sendune.com/add-contact
 {
      "method": "POST",
      "url": "https://api.sendune.com/add-contact",
      "headers": {"template-key": "*****************************zkLG"},
      "body": {
          "email": "example@gmail.com",
          "status": "Unsubscribe",
          "full_name": "John Due",
          "mobile": "+918098763849",
          "dob": "10-10-1990",
          "gender": "Male",
          "city": "Hyderabad",
          "country": "India",
          "add_tags": "aaa,bbb,ccc",
          "remove_tags": "ddd,eee,fff"
      }
 }

IMPORTANT:

  • The API call MUST include the Contact Upload Secret Key.

  • The API call MUST include the 'Primary Key' of the contact. Primary Key is used to uniquely identify a contact in the database. This is either the Email or the Mobile Number of your end user.

  • Mobile numbers must strictly be in E.164 format. (Example: +442071838750).

2. Email API

The 'send-email' endpoint is used to send transactional emails. Every email template you create comes with a 'Template Key' which must be used in the cURL request.

https://api.sendune.com/send-email
{
      "method": "POST",
      "url": "https://api.sendune.com/send-email",
      "headers": {"template-key": "***********************HOcm"},
      "body": {
          "email": "example@gmail.com",
          "subject": "Subject",
          "replace-tag": "Value"
       }
}

IMPORTANT:

  • The API call MUST include the Template Key.

  • Template Key is unique to each email template you create.

  • Template keys are secrets and must not be used on the client side.

3. SMS API

The 'send-sms' endpoint is used to send both transactional and marketing SMS.

https://api.sendune.com/send-sms
{
      "method": "POST",
      "url": "https://api.sendune.com/send-sms",
      "headers": {"template-key": "**************************4lVm"},
      "body": {
          "sender_id": "ABCDEF",
          "origination_number": "+449876543212",
          "mobile": "+449876543210",
          "message": "Hello John."
       }
}

IMPORTANT:

  • The API call MUST include the Template Key.

  • Template Key is unique to Transactional SMS and Marketing SMS.

  • 'Origination Number' is required only when sending to USA mobile numbers.

  • All mobile numbers MUST be in E.164 format.

4. OTP API

The 'send-otp' endpoint is used to send One Time Passwords (OTP's).

OTP is a special type of Transactional SMS. They are used to send one time codes intended for Login or Two-Factor Authentication (2FA) or other high value transactions.

OTP SMS has a template that allows you to customise fields like App Name, OTP Size, and OTP Expiry Time.

The OTP SMS has two parts, Send API and Verify API.

Send API is used to trigger the SMS containing one time code to the end user.

https://api.sendune.com/send-otp

Request:

{
      "method": "POST",
      "url": "https://api.sendune.com/send-otp",
      "headers": {"template-key": "****************************elA2"},
      "body": {
          "sender_id": "ABCDEF"
          "origination_number": "+449876543212"
          "mobile": "+449876543210",
       }
}

Success Response:

{
      "success": true,
      "message": "OTP Sent"
}

Failed Response:

{
      "success": false,
      "message": "message details",
      "error": "error details"
}

IMPORTANT:

  • The API call MUST include the Template Key. Template Key is unique to OTP SMS.

  • 'Origination Number' is required only when sending to USA mobile numbers.

  • All mobile numbers MUST STRICTLY be in E.164 format.

Rate Limits

Rate limits apply only to the Contacts API (add-contact) endpoint as per the below table.

PlanRate Limit (requests/minute)

Free

60

Paid

1,800 (Soft Limit)

Enterprise

Upto 60,000

To illustrate, the 'Paid Plan' has a rate limit of 1800 requests/minute. This lets you call the SENDUNE Contacts API 30 times per second or do a single burst of 1800 calls in one second or anywhere in between. The sum total of all API calls must not exceed 1800 in one minute.

API rate limit is a soft limit for paid plans, meaning you can do occasional short bursts that exceed the rate limit as long as you are not abusing our systems.

IMPORTANT NOTE

API rate limits do not apply to the Email, SMS, OTP endpoints.

Email/SMS sending rates are determined by AWS. For example, if your AWS SES email sending rate is 250/second, you can call the 'send-email' endpoint up to 250 times per second - even if you are on the 'Free Plan'.

Last updated