If you're using Zendesk's messaging channels and want to send custom CSAT surveys directly in the chat interface instead of via email, you're not alone. Many Zendesk admins face this challenge when trying to integrate third-party survey tools like Qualtrics into their messaging workflow.
While Zendesk offers built-in CSAT surveys for messaging, they come with limitations. The native surveys are triggered automatically when a ticket is solved and offer limited customization options. But what if you need more control over when and how surveys are sent, or you want to use a third-party survey platform?
This guide will walk you through how to embed custom CSAT surveys in Zendesk messaging channels using the Sunshine Conversations API.
Understanding the Default CSAT Behavior in Messaging
Before diving into custom solutions, it's important to understand how Zendesk's native CSAT works in messaging channels.
When you enable CSAT for Zendesk web, mobile, and social messaging, the survey is presented in the messaging interface immediately after the ticket is set to solved. This happens automatically through a system-generated trigger, and the survey appears as a simple "Good" or "Bad" rating option.
However, this default behavior has several limitations:
- The question text is not configurable, agents cannot manually launch a CSAT survey, and CSAT collection is represented by the bot avatar in messaging which cannot be configured
 - You can't use advanced survey platforms like Qualtrics or custom survey tools
 - Limited control over timing and delivery
 - No support for multi-question surveys or complex rating scales
 
"Does anybody know if this is possible? If so, what would be the best way? So far, we only managed to send emails after conversation is closed, but it's impacting our response rate." - Common Zendesk admin concern
The Solution: Using Sunshine Conversations API
To embed custom CSAT surveys in your messaging channels, you'll need to leverage Zendesk's Sunshine Conversations API. This approach gives you programmatic control over messages sent through messaging channels, allowing you to create custom survey experiences.
What You'll Need
Before starting, ensure you have:
- Zendesk Suite Professional plan or above (required for Sunshine Conversations API access)
 - Admin access to your Zendesk account
 - A Sunshine Conversations API key
 - Basic knowledge of APIs and webhooks
 - Your third-party survey platform set up (if using one like Qualtrics)
 
Step 1: Get the Conversation ID Using Ticket Audits API
The first step is to retrieve the conversation ID associated with your ticket. You can use the Ticket Audits API to list all updates to a ticket, which will include the conversation information from Sunshine Conversations.
According to Zendesk's documentation, you can call the List Audits for a Ticket endpoint:
GET /api/v2/tickets/{ticket_id}/audits
This endpoint lists the audits for a specified ticket and returns information about all updates, including conversation-related events.
Source: Zendesk Ticket Audits API Reference
Step 2: Authenticate with Sunshine Conversations API
To send messages through Sunshine Conversations, you need to authenticate your API requests. You'll need to create an API key in Admin Center through the Conversations Integrations page.
To create your API key:
- In Admin Center, click Apps and integrations in the sidebar
 - Select Integrations > Conversations integrations
 - Create a new integration and generate an API key
 - Save your Key ID and Secret Key securely
 
You'll use these credentials as Basic Auth when making API calls to send messages.
Source: Creating Conversations Integrations in Admin Center
Step 3: Create a Webhook to Trigger Your Survey
Webhooks allow you to receive and react to messages and other events in real-time. You'll need to set up a webhook that triggers when a ticket is solved.
To create your webhook:
- In Admin Center, navigate to Apps and integrations > Integrations > Conversations integrations
 - Click Create integration
 - Enter a unique name for your integration
 - In the Webhook section, configure:
- Webhook endpoint URL: Your server URL that will receive the webhook events
 - Webhook subscriptions: Select the events you want to be notified about (e.g., "conversation:message" or custom events)
 
 
When a trigger event occurs, the webhook sees the event and sends the data to your target URL.
Source: Creating Conversations Integrations in Admin Center
Step 4: Send Your Custom Survey Message
Once you have the conversation ID and authentication set up, you can send your custom survey message using the Sunshine Conversations Messages API.
To send a message via the REST API, call the POST Message endpoint using the conversation's and app's ID property from the webhook payload.
The endpoint format is:
POST https://{subdomain}.zendesk.com/sc/v2/apps/{appId}/conversations/{conversationId}/messages
Here's an example using the Sunshine Conversations client for Node.js:
javascript
const SunshineConversationsApi = require("sunshine-conversations-client");
const defaultClient = SunshineConversationsApi.ApiClient.instance;
defaultClient.basePath = "https://{subdomain}.zendesk.com/sc";
const basicAuth = defaultClient.authentications["basicAuth"];
basicAuth.username = "{your_key_id}";
basicAuth.password = "{your_secret_key}";
const apiInstance = new SunshineConversationsApi.MessagesApi();
async function sendSurvey(appId, conversationId) {
  const messagePost = new SunshineConversationsApi.MessagePost();
  messagePost.setAuthor({ type: "business" });
  messagePost.setContent({ 
    type: "text", 
    text: "How satisfied were you with your support experience?",
    actions: [
      {
        type: "link",
        text: "Take Survey",
        uri: "https://your-survey-url.com?ticketId={{ticket.id}}"
      }
    ]
  });
  const response = await apiInstance.postMessage(
    appId,
    conversationId,
    messagePost
  );
  
  return response;
}
Source: Sunshine Conversations API Quickstart
Step 5: Use Postback Buttons for In-Chat Surveys
For a more integrated experience, you can use postback buttons to collect survey responses directly in the chat without redirecting users to external links.
Postback buttons allow you to attach a payload, and when the user clicks the button, it triggers webhooks listening to the postback trigger. The payload associated with the action clicked by the user will be included in the webhook body.
Here's how to send a message with postback buttons:
javascript
const data = new SunshineConversationsApi.MessagePost();
data.author = { type: 'business' };
data.content = { 
  type: 'text', 
  text: 'How was your support experience?',
  actions: [
    {
      type: 'postback',
      text: 'Good',
      payload: 'CSAT_GOOD'
    },
    {
      type: 'postback',
      text: 'Bad',
      payload: 'CSAT_BAD'
    }
  ]
};
apiInstance.postMessage(appId, conversationId, data)
  .then(response => console.log('Survey sent'))
  .catch(error => console.error('Error:', error));
To receive postback button clicks, you'll need to set up conversation integrations and subscribe to postback events.
Source: Advanced Integration - Postback Buttons
Alternative Approach: Third-Party Survey Integration
If you're using a third-party survey platform like Qualtrics, you can integrate it with this workflow:
Using Qualtrics with Zendesk Messaging
Qualtrics has an out-of-the-box integration with Zendesk that allows you to create workflows triggered by Zendesk events, such as when a ticket is marked as solved. However, for messaging-specific workflows, you'll need to combine this with the Sunshine Conversations API approach described above.
- Set up the Zendesk-Qualtrics integration in your Qualtrics account
 - Create a workflow that triggers on ticket status changes
 - Use the Sunshine Conversations API to send a message with a link to your Qualtrics survey
 - Pass relevant ticket data to the survey URL as query parameters
 
Example survey link with ticket data:
https://your-qualtrics-survey.com?ticketId={{ticket.id}}&requesterId={{ticket.requester.id}}&agentId={{ticket.assignee.id}}
Source: Qualtrics Zendesk Integration
Important Considerations and Limitations
While this approach provides flexibility, there are some important factors to keep in mind:
API Rate Limits
Be aware of Zendesk's API rate limits when implementing this solution. If you're sending surveys for high-volume messaging, ensure your implementation handles rate limiting gracefully.
Conversation Context
Messaging conversations that end without creating a ticket do not trigger a CSAT survey. If you're using this custom approach, make sure your logic accounts for this scenario.
Authentication Scope
There are three authorization scopes available for the Sunshine Conversations API: integration, app, and account. The integration scope is sufficient for working with users, conversations, and messages.
User Experience
Consider the user experience when designing your survey flow. Keep surveys short and mobile-friendly since many users access messaging on mobile devices.
Testing Your Implementation
Before rolling out your custom CSAT survey to all customers, thoroughly test the implementation:
- Create a test ticket through a messaging channel
 - Verify the webhook triggers correctly when the ticket is solved
 - Confirm the survey message appears in the conversation
 - Test clicking buttons or links to ensure they work as expected
 - Verify that survey responses are captured correctly
 
"This is very valuable! Are you a user or part of Zendesk Team?" - Community feedback on custom CSAT solutions
Troubleshooting Common Issues
Webhook Not Firing
If your webhook isn't triggering, check:
- The webhook URL is accessible from Zendesk's servers
 - You've subscribed to the correct events
 - The integration is properly authenticated
 
Message Not Appearing
If messages aren't showing in the conversation:
- Verify you're using the correct conversation ID
 - Check that your API credentials have the right scope
 - Ensure the conversation is still active
 
Survey Link Not Working
If survey links aren't functioning:
- Test the URL independently
 - Verify query parameters are properly formatted
 - Check that the survey platform is configured to accept incoming data
 
Best Practices
To get the most out of your custom CSAT implementation:
- Time it right: Send surveys immediately after resolution while the experience is fresh, but not so quickly that it interrupts the conversation flow
 - Keep it simple: Limit surveys to 1-3 questions to maximize completion rates
 - Make it mobile-friendly: Design with mobile users in mind since messaging is often accessed on phones
 - Follow up on negative feedback: Use the data to trigger workflows for low ratings that need immediate attention
 - Track and analyze: Monitor response rates and satisfaction scores over time to measure improvement
 
Conclusion
While Zendesk's native CSAT for messaging works well for basic needs, integrating custom surveys through the Sunshine Conversations API gives you much more flexibility and control. This approach allows you to use sophisticated survey platforms, collect richer feedback, and create a more tailored experience for your customers.
The implementation requires some technical expertise and development resources, but the payoff in terms of better feedback quality and customer experience can be significant.
Note: This solution is not officially documented as a standard Zendesk feature. The approach described here is based on capabilities discovered and implemented by Zendesk users leveraging the Sunshine Conversations API platform. Always refer to the latest Zendesk documentation for the most current API capabilities and best practices.
About Macha AI
Macha AI builds purpose-built AI apps for Zendesk — including Copilot, Auto Reply, and Translations — designed to help agents work faster and smarter. And this is just the beginning. Many more apps are on the way. Learn more →

