Prepare your API Key
Create a SendGrid API Key with permission to read and write Marketing data. Grant only the permissions ChatbotX needs to access Lists, Contacts, and Custom Fields.1
Sign in to SendGrid
Sign in to the Twilio SendGrid account that you want to connect to ChatbotX.
2
Open API Keys
From the left menu, select Settings > API Keys.
3
Create an API Key
Select Create API Key, enter a name that identifies the key, and select Custom Access.
4
Grant Marketing access
Set Marketing to Full Access so the key can read and write Marketing Contacts, Lists, and Custom Fields.
5
Copy the API Key
Select Create & View, then copy the key and store it securely. SendGrid displays the complete API Key only once.See the official API Keys guide.

Connect SendGrid to ChatbotX
1
Open Settings
In your ChatbotX workspace, select Settings from the left menu.
2
Select Integrations
Select the Integrations tab, then open SendGrid.
3
Open the connection window
Select Connect to open the Connect SendGrid window.
4
Enter the API Key
Paste the key into the API Key field, then select Confirm.

Add SendGrid to a Flow
Place the SendGrid action after collecting the email address and other data that you want to sync. The email address must be valid so SendGrid can identify the Marketing Contact.1
Open the Flow
Select Flows, then open the Flow that you want to use to collect contacts.
2
Add Actions
In the Send Message node, select + Create, then select Actions.
3
Select Email Actions
Open Email Actions and select Add Contact to SendGrid.

4
Open the configuration
Select Edit on the action to choose a List and sync contact data.
Configure Add Contact to SendGrid
Configure the fields in the SendGrid window, then select Save.
- Success: SendGrid accepted and queued the request to create or update the contact.
- Error: SendGrid rejected the request because the email address, API Key, permissions, or synced data is invalid.
SendGrid processes contact creation and updates asynchronously. A contact might not appear immediately in Marketing > Contacts even after the Flow follows the Success branch.
Sync Custom Fields
Custom Fields store additional data for contact segmentation and email personalization. Before configuring the action, create the required Custom Fields in Marketing > Contacts in SendGrid. Then select a ChatbotX field with a compatible data type for each SendGrid Custom Field. For example:Example: Collect customers for product updates
A fashion retailer wants to add chatbot subscribers to a List for new collection announcements.1
Collect customer information
Use Get User Data to ask for the customer’s email address, phone number, and product interest.
2
Add the contact to SendGrid
Run Add Contact to SendGrid, then select the destination List and the Email field.
3
Sync additional data
Select the Phone field and sync the product interest to its corresponding Custom Field.
4
Handle the result
Connect Success to a confirmation message. Connect Error to a branch that asks the customer to check their information or transfers the conversation to a team member.
Test the integration
Before you Publish the Flow, test it with an email address that you can access.- Open Marketing > Contacts in SendGrid and wait for the contact to appear.
- Confirm that the contact belongs to the correct List if you selected one.
- Confirm that the email address, phone number, and Custom Fields contain the correct data.
- Confirm that the Flow follows the Success branch for a valid email address.
- Enter an invalid email address to test the Error branch.
- If Lists or Custom Fields do not appear, review the API Key’s Marketing permissions and reconnect the integration.