Generic RCS API

Learn how to configure RCS API

Overview

This document describes how messaging providers can integrate with CleverTap to send Rich Communication Services (RCS) messages. The API supports the following message types:

SMS fallback is supported for all message types if the recipient is unreachable via RCS.

Base Configuration

This section outlines the core API details required to integrate with CleverTap's RCS platform.

Messaging API Endpoint

BSPs are requested to create an endpoint where CleverTap can send the notification payload for campaigns. Customers must ask BSPs to share the API endpoint that can accept the CleverTap Payload to save the provider in the CleverTap Dashboard.

Authentication

Authentication details will be provided during provider setup. The process is similar to generic SMS integration.

Headers

Content-Type: application/json

Message Types

CleverTap supports four RCS message formats, each with optional SMS fallback.

Text Message

Used for sending simple messages with optional interactive buttons such as quick replies, links, or dialers.
Supports:

  • Suggestions: REPLY, DIAL_PHONE, OPEN_URL
  • SMS fallback

Example Payload:

{
  "payloadVersion": 0.1,
  "msgId": "CT_TXT_20240315_001_ABC123",
  "to": "+911234567890",
  "callbackURL": "https://your-callback-endpoint.com/rcs/callback",
  "rcsContent": {
    "senderId": "BRAND_RCS_001",
    "customParam": [
      {
        "name": "campaign_id", 
        "value": "welcome_flow_2024"
      },
      {
        "name": "user_segment",
        "value": "premium_users"
      }
    ],
    "content": {
      "type": "TEXT",
      "text": "Welcome to our service! Would you like to explore our premium features?",
      "suggestions": [
        {
          "type": "REPLY",
          "text": "Yes, show me",
          "postbackData": "explore_premium"
        },
        {
          "type": "REPLY", 
          "text": "Maybe later",
          "postbackData": "remind_later"
        },
        {
          "type": "OPEN_URL",
          "text": "Learn More",
          "postbackData": "visit_website",
          "url": "https://example.com/features"
        }
      ]
    }
  },
  "smsContent": {
    "senderId": "BRAND001",
    "body": "Welcome to our service! Learn more at example.com/features",
    "customParam": [
      {
        "name": "campaign_id",
        "value": "welcome_flow_2024"
      }
    ]
  }
}

TEMPLATE Message

Used for sending structured, pre-approved messages with dynamic fields populated using parameters.
Supports:

  • Template IDs and personalization parameters
  • SMS fallback

Example Payload:

{
  "payloadVersion": 0.1,
  "msgId": "CT_TMPL_20240315_002_DEF456",
  "to": "+911234567890", 
  "callbackURL": "https://your-callback-endpoint.com/rcs/callback",
  "rcsContent": {
    "senderId": "BRAND_RCS_001",
    "customParam": [
      {
        "name": "template_category",
        "value": "transactional"
      },
      {
        "name": "business_unit",
        "value": "ecommerce"
      }
    ],
    "content": {
      "type": "TEMPLATE",
      "templateId": "ORDER_CONFIRMATION_V3",
      "parameters": [
        {
          "name": "1",
          "value": "John Smith"
        },
        {
          "name": "2", 
          "value": "ORD789012"
        },
        {
          "name": "order_amount",
          "value": "₹2,499"
        },
        {
          "name": "delivery_date",
          "value": "March 20, 2024"
        }
      ]
    }
  },
  "smsContent": {
    "senderId": "BRAND001",
    "body": "Hi John Smith, your order #ORD789012 for ₹2,499 is confirmed. Expected delivery: March 20, 2024",
    "customParam": [
      {
        "name": "template_category", 
        "value": "transactional"
      }
    ]
  }
}

CARD Message

Used for sending rich media with one card, including:

  • Title and description
  • Media Types
    • IMAGE: Static image content (JPG, PNG, GIF)
    • VIDEO: Video content (MP4, MOV, AVI)
  • Up to 10 suggestions
    • Supports: REPLY, DIAL_PHONE, OPEN_URL
  • Orientation: HORIZONTAL, VERTICAL
  • Alignment: LEFT, RIGHT
  • Media height settings: SHORT, MEDIUM, TALL
  • SMS fallback

Example Payload:

{
  "payloadVersion": 0.1,
  "msgId": "CT_CARD_20240315_003_GHI789",
  "to": "+911234567890",
  "callbackURL": "https://your-callback-endpoint.com/rcs/callback", 
  "rcsContent": {
    "senderId": "BRAND_RCS_001",
    "customParam": [
      {
        "name": "product_category",
        "value": "electronics"
      },
      {
        "name": "campaign_type",
        "value": "product_launch"
      }
    ],
    "content": {
      "type": "CARD",
      "orientation": "HORIZONTAL",
      "alignment": "LEFT",
      "cardContent": {
        "title": "Latest Smartphone Model XYZ", //Max 200 characters
        "description": "Experience cutting-edge technology with an advanced camera system, long-lasting battery, and premium design. Available in multiple colors.", //Max 2000 characters
        "media": {
          "type": "IMAGE",
          "mediaUrl": "https://cdn.example.com/products/smartphone-xyz-hero.jpg",
          "thumbnailUrl": "https://cdn.example.com/products/smartphone-xyz-thumb.jpg", 
          "height": "MEDIUM"
        },
        "suggestions": [  //Max 10 suggestions
          {
            "type": "OPEN_URL",
            "text": "Buy Now - ₹49,999",
            "postbackData": "purchase_smartphone_xyz",
            "url": "https://store.example.com/smartphone-xyz"
          },
          {
            "type": "DIAL_PHONE",
            "text": "Call Expert",
            "postbackData": "expert_consultation",
            "phoneNumber": "+918001234567"
          },
          {
            "type": "REPLY",
            "text": "More Details",
            "postbackData": "request_details_smartphone"
          }
        ]
      }
    }
  },
  "smsContent": {
    "senderId": "BRAND001",
    "body": "Latest Smartphone Model XYZ - ₹49,999. Buy: store.example.com/smartphone-xyz Call: +918001234567",
    "customParam": [
      {
        "name": "product_category",
        "value": "electronics"  
      }
    ]
  }
}

CAROUSEL Message

Used for showcasing multiple cards in a horizontally scrollable format.
Each card can include:

  • Title and description
  • Media Types
    • IMAGE: Static image content (JPG, PNG, GIF)
    • VIDEO: Video content (MP4, MOV, AVI)
  • Up to 10 suggestions
    • Supports: REPLY, DIAL_PHONE, OPEN_URL
  • Card width: SMALL, MEDIUM
  • Media height settings: SHORT, MEDIUM, TALL
  • SMS fallback

Example Payload:

{
  "payloadVersion": 0.1,
  "msgId": "CT_CAROUSEL_20240315_004_JKL012",
  "to": "+911234567890",
  "callbackURL": "https://your-callback-endpoint.com/rcs/callback",
  "rcsContent": {
    "senderId": "BRAND_RCS_001", 
    "customParam": [
      {
        "name": "catalog_type",
        "value": "featured_products"
      },
      {
        "name": "season",
        "value": "spring_collection_2024"
      }
    ],
    "content": {
      "type": "CAROUSEL",
      "cardWidth": "MEDIUM",
      "cardContents": [
        {
          "title": "Laptop Pro Series",
          "description": "High-performance laptop for professionals with advanced graphics and all-day battery life.",
          "media": {
            "mediaUrl": "https://cdn.example.com/products/laptop-pro-main.jpg",
            "thumbnailUrl": "https://cdn.example.com/products/laptop-pro-thumb.jpg",
            "height": "MEDIUM"
          },
          "suggestions": [
            {
              "type": "OPEN_URL",
              "text": "From ₹89,999",
              "postbackData": "laptop_pro_configure",
              "url": "https://store.example.com/laptop-pro"
            }
          ]
        },
        {
          "title": "Tablet Ultra",
          "description": "Versatile tablet with premium display, perfect for creativity and productivity tasks.",
          "media": {
            "mediaUrl": "https://cdn.example.com/products/tablet-ultra-demo.mp4", 
            "thumbnailUrl": "https://cdn.example.com/products/tablet-ultra-thumb.jpg",
            "height": "MEDIUM"
          },
          "suggestions": [
            {
              "type": "OPEN_URL",
              "text": "From ₹54,999",
              "postbackData": "tablet_ultra_purchase",
              "url": "https://store.example.com/tablet-ultra"
            }
          ]
        },
        {
          "title": "Smartwatch Elite",
          "description": "Advanced health monitoring, GPS, and smart features in a premium design.",
          "media": {
            "mediaUrl": "https://cdn.example.com/products/smartwatch-elite.jpg",
            "thumbnailUrl": "https://cdn.example.com/products/smartwatch-thumb.jpg", 
            "height": "MEDIUM"
          },
          "suggestions": [
            {
              "type": "OPEN_URL",
              "text": "₹24,999",
              "postbackData": "smartwatch_elite_shop",
              "url": "https://store.example.com/smartwatch-elite"
            }
          ]
        }
      ]
    }
  },
  "smsContent": {
    "senderId": "BRAND001",
    "body": "Featured products: Laptop Pro (₹89,999), Tablet Ultra (₹54,999), Smartwatch Elite (₹24,999). Shop at store.example.com",
    "customParam": [
      {
        "name": "catalog_type",
        "value": "featured_products"
      }
    ]
  }
}

Field Specifications

The following fields are required or optional when constructing a valid RCS payload.

Required Fields

These fields must be included in every request:

FieldTypeDescription
payloadVersionNumberAPI version (currently 0.1)
msgIdStringMessage identifier provided by CleverTap (must be returned in callbacks as a meta field)
toStringRecipient phone number with country code (format: [number])
callbackURLStringEndpoint where CleverTap expects delivery status callbacks
rcsContent.senderIdStringRCS Business Messaging sender ID provided by the messaging provider
rcsContent.content.typeStringMessage type: TEXT, TEMPLATE, CARD, CAROUSEL

Optional Fields

Include these fields to enhance message targeting or provide fallback support:

FieldTypeDescription
rcsContent.customParamArrayCustom key-value pairs configured during provider setup or campaign creation
smsContentObjectFallback SMS content when RCS is unavailable
rcsContent.content.suggestionsArrayInteractive buttons/actions (for TEXT CARD, and CAROUSEL messages)

Supported Values

The following values are supported for specific fields in the payload.

Orientation (CARD only)

ValueDescription
HORIZONTALCard content arranged horizontally with image and text side-by-side
VERTICALCard content arranged vertically with image above text

Alignment (CARD with HORIZONTAL orientation only)

ValueDescription
LEFTMedia content aligned to the left side
RIGHTMedia content aligned to the right side

Card Width (CAROUSEL only)

ValueDescription
SMALLNarrow card width for compact display
MEDIUMStandard card width for optimal readability

Media Height (all media types)

ValueDescription
SHORTCompact media height for minimal visual impact
MEDIUMStandard media height for balanced presentation
TALLExtended media height for prominent visual display

Media Types

ValueDescription
IMAGEStatic image content (JPG, PNG, GIF)
VIDEOVideo content (MP4, MOV, AVI)

Suggestion Types

ValueDescription
REPLYQuick reply button that sends predefined text back to the sender
DIAL_PHONECall action button that initiates a phone call to the specified number
OPEN_URLWebsite/app link button that opens URL in browser or app

Custom Parameters

CleverTap supports metadata insertion using custom key-value pairs at two levels.

Provider Setup (Global Parameters)

Applied to all messages sent through the provider:

  • Tracking identifiers
  • Provider-specific metadata
  • Default campaign attributes

Campaign Creation (Campaign-Specific Parameters)

Set in the CleverTap dashboard for specific campaigns:

  • Campaign tracking codes
  • Customer segments
  • UTM parameters
  • A/B test identifiers
  • Business-specific metadata

Common Use Cases

ParameterDescription
campaign_idCampaign tracking identifier
user_segmentCustomer segment classification
utm_source, utm_medium, utm_campaignMarketing attribution
a_b_test_variantA/B testing group identification
priority_levelMessage priority classification

Callback Specifications

Delivery status and user interaction callbacks must be sent to the callbackURL specified in the original message payload. The meta field in callbacks must contain the original msgId from CleverTap's request.

The following table summarizes all supported callback event types, their trigger conditions, and additional notes to help providers correctly interpret CleverTap’s callback payloads. Each event corresponds to a specific stage in the RCS message lifecycle, from delivery and user engagement to failure reporting.

Event TypeTrigger Condition
deliveredWhen the message is successfully delivered to the user's device.
failedWhen message delivery fails at the provider level. Includes error code and timestamp.
viewedWhen the user views the message.
clickedWhen the user clicks a URL suggestion button. Includes url and userAgent.
repliedWhen the user sends the replies, such as simple text, postback, media, video, PDF, and location, for more information, refer to the Callback Event Payload.

Callback Event Payloads

[
  {
    "event": "delivered", 
    "data": [
      {
        "channel": "RCS",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "failed",
    "data": [
      {
        "ts": 1710504000,
        "code": "2002",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "viewed",
    "data": [
      {
        "channel": "RCS",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "clicked",
    "data": [
      {
        "ts": 1710504000,
        "meta": "CT_TXT_20240315_001_ABC123",
        "userAgent": "Mozilla/5.0 (Android 12; Mobile; rv:91.0)",
        "url": "https://example.com/features",
        "shortUrl": "https://bit.ly/example123"
      }
    ]
  }
]
[
  {
    "event": "replied",
    "data": [
      {
        "channel": "RCS",
        "type": "text", 
        "fromPhone": "+91XXXXXXXXXX",
        "toPhone": "+91XXXXXXXXXX",
        "incomingText": "Thank you for the information",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "replied",
    "data": [
      {
        "channel": "RCS",
        "type": "text",
        "fromPhone": "+91XXXXXXXXXX",
        "toPhone": "+91XXXXXXXXXXX",
        "incomingText": "Yes, show me",
        "postback": "explore_premium",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "replied",
    "data": [
      {
        "channel": "RCS",
        "type": "image/png",
        "mediaUrl": "https://rcs-provider.com/media/user-image-abc123",
        "fromPhone": "+91XXXXXXXXXX",
        "toPhone": "+91XXXXXXXXXXX",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "replied", 
    "data": [
      {
        "channel": "RCS",
        "type": "video/mp4",
        "mediaUrl": "https://rcs-provider.com/media/user-video-def456",
        "fromPhone": "+91XXXXXXXXXXX",
        "toPhone": "+91XXXXXXXXXXX",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "replied",
    "data": [
      {
        "channel": "RCS", 
        "type": "application/pdf",
        "mediaUrl": "https://rcs-provider.com/media/user-document-ghi789",
        "fromPhone": "+91XXXXXXXXXX",
        "toPhone": "+91XXXXXXXXXX", 
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]
[
  {
    "event": "replied",
    "data": [
      {
        "channel": "RCS",
        "type": "location",
        "fromPhone": "+91XXXXXXXXXX",
        "toPhone": "+91XXXXXXXXXX",
        "incomingText": "My current location",
        "latitude": "19.0760",
        "longitude": "72.8777", 
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]

Error Codes and Status Responses

This section lists all possible errors returned either synchronously (API) or asynchronously (callback).

API-Level Errors (Provider Response)

These errors are returned immediately when the provider identifies issues during message processing.

HTTP StatusAPI Error CodeError TitleDescriptionUsage
2002000Invalid credentialsAuthentication failure, API key issuesReturn when the auth credentials are invalid/expired
2002001Invalid template parametersMissing parameters, template mismatch, incorrect template nameReturn when template validation fails
2002002Invalid phone numberPhone number format errors, invalid country codes, malformed numbersReturn when phone number validation fails
2002003Phone number not subscribedUser consent-related errors, opt-out statusReturn when the user has not consented to RCS messages
2002004RCS Disabled for the numberTarget number doesn't support RCSReturn when RCS is not available for the recipient
2002005Messaging Account DisabledProvider account issues, billing problems, service suspensionReturn when the provider account has issues
2002006Invalid MediaMedia file issues: invalid format, size limits, broken URLsReturn when media validation fails
2002007Source IP RestrictedIP whitelisting violationsReturn when the request originates from a non-whitelisted IP
2002008Invalid RCS sender IDRCS Business Messaging sender ID errorsReturn when the sender ID is invalid/unregistered
2002009No Active ConversationLack of an active RCS conversation windowReturn when the RCS conversation has expired
2002011Outside Permitted Time WindowMessage sent outside allowed time constraintsReturn when message timing violates regulations
2002012Content Policy ViolationMessage content blocked due to policy violationsReturn when content filtering detects violations
2002013Promotional Message Limit ExceededDaily/hourly promotional message limits reachedReturn when rate limits are exceeded
2002014OthersAny other provider-specific errorsReturn for unclassified errors

Callback-Level Error Codes (Delivery Failures)

These errors are sent via callback when delivery fails after the initial API acceptance.

Error TitleDescriptionCallback Code
DND FailureNumber registered in the Do Not Disturb registry901
Spam DetectionMessage blocked by carrier spam filters902
Blacklist RejectionNumber blacklisted due to previous opt-outs or complaints903
System ErrorInternal provider system failure during processing904
Subscriber ErrorRecipient issues: insufficient balance, network problems905
DLT Header BlockedSender ID blocked at DLT platform (India-specific)906
DLT Entity BlockedEntity ID issues at DLT platform (India-specific)907
DLT Template BlockedTemplate issues at DLT platform (India-specific)908
DLT Consent ErrorMissing DLT consent registration (India-specific)909
Invalid SubscriberInactive or invalid phone number910
Message Inbox FullRecipient's inbox storage is full912
NDNC RejectedNumber in the National Do Not Call registry913
UndeliveredDelivery failed after multiple retry attempts914
DroppedNumber banned or inactive (no usage for 60+ days)915
ExpiredMessage expired after multiple delivery attempts916
Force ExpiredMessage dropped by provider rules or client request917
Duplicate Message DropSame content sent to the same number within 30 minutes918
DLT Platform FailureDLT platform-level issues (India-specific)919

Error Response Format

API Response (Immediate):

{
  "success": true
}
[
  {
    "event": "failed",
    "data": [
      {
        "ts": 1710504000,
        "code": "2000",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]

Callback Response (Delivery Failure):

[
  {
    "event": "failed",
    "data": [
      {
        "ts": 1710504000,
        "code": "903",
        "meta": "CT_TXT_20240315_001_ABC123"
      }
    ]
  }
]

//kapa search bot