Using cyberpanel user creation API I cannot create a user using wordpress

I have written a wordpress plugin, but it does not seem to be sending the data to cyberpanel. Can anyone help me out?

Plugin Name: CyberPanel User Creation
Description: Creates a CyberPanel user when a new WordPress user is registered.
Version: 1.0
Author: Secret

function cyberpanel_create_user($user_id) {
    // Get the user data
    $user = get_userdata($user_id);
    $username = $user->user_login;
    $password = $user->user_pass;
    $email = $user->user_email;
    // $domainName = "";
    $packageType = "Default";

    // CyberPanel API endpoint
    $url = "";

    // API credentials
    $api_token = "secret";

    // Request payload
    $data = array(
        "username" => $username,
        "password" => $password,
        "email" => $email,
        "domainName" => $domainName,
        "packageType" => $packageType

    // HTTP headers
    $headers = array(
        "Content-Type: application/json",
        "Authorization: Bearer " . $api_token

    // Initialize a new cURL session
    $curl = curl_init();

    // Set the cURL options
    curl_setopt_array($curl, array(
        CURLOPT_URL => $url,
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => json_encode($data),
        CURLOPT_HTTPHEADER => $headers

    // Execute the cURL request
    $response = curl_exec($curl);

    // Get the HTTP status code
    $status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);

    // Close the cURL session

    // Check if the request was successful
    if ($status_code == 200) {
        error_log("CyberPanel user created successfully.");
    } else {
        error_log("Error creating CyberPanel user: $response");

add_action('user_register', 'cyberpanel_create_user', 10, 1);

What does the response says? Did you enable api access from users menu?

I did yes. There is not response from what I can tell. I create a new user in wordpress, and nothing happened in the cyberpanel users tab.

Can you tell me what response did you get? Also Did you enable api access from users menu?