How to pass ID via shortcode

I’m loading some bricksbuilder template via ajax, however it doesn’t seem to be possible to pass the template ID directly:

$template_content = do_shortcode("[bricks_template id='{$template_id}'

My workaround is to use global post (which i don’t like)
Is there a way to pass the Id directly in the short code?

This is not working:

$post_id = intval($_POST['post_id']);
$template_id = '1073'; // Template ID
$template_content = do_shortcode("[bricks_template id='{$template_id}' post_id='{$post_id}']");

I need to temporarily set a global post variable

$post_id = intval($_POST['post_id']);

// Save the current post object
global $post;
$original_post = $post;

// Set the global post to the requested post ID
$post = get_post($post_id);
setup_postdata($post);

// Render the BricksBuilder template
$template_id = '1073';  // Template ID
$template_content = do_shortcode("[bricks_template id='{$template_id}']");

  // Restore the original post object
  wp_reset_postdata();

maybe this helps:
https://webcare.co/pass-variable-through-bricks-shortcode/#step-1-creating-the-shortcode

// Add custom bricks template for Post to render Bricks Section
function custom_bricks_template_shortcode($atts) {
    // Extract the attributes
    $atts = shortcode_atts(
        array(
            'id' => '',
            'state' => '',
        ), 
        $atts, 
        'bricks_template'
    );

    // Pass the attributes to the template
    ob_start();
    set_query_var('bricks_template_state', $atts['state']);
    echo do_shortcode(' . '"]');
    return ob_get_clean();
}
add_shortcode('custom_bricks_template', 'custom_bricks_template_shortcode');

then do:

[custom_bricks_template id="1706" state="kelantan"]