To use a Bash variable for the text value in your curl command, you need to ensure the variable is expanded correctly and that the content is properly formatted, especially since you're including a multi-line string (like a Python code block).
Option 1: Single Quotes (Recommended)
Wrap the entire text field in single quotes and use double quotes inside the variable for the Python code block: