[Endpoint SmartApp] Help executing commands based on subscriptions

I have an app that stores the installedAppId, and gets the list of all devices for my location. i authorize my app to read and excecute those devices, and the api returns the list of deviceObjects including their deviceIds, and sends me back to my app. my app, then, presents a window with all of the devices stylized and selectable. as the user selects them, the app builds the array of devices, and sends them to my smartapp web hook server /subscriptions endpoint. but I have not been able to successfully create the subscription at this point, since my app is not the smartthings app it won’t automatically initiate an update lifecycle and I dont know how to manually initiate it. but I want o be able to use the context.api.subscriptions.subscribeToDevices() call and subscribe to all capabilities for those deviceId’s. how do I accomplish this? erver.post(‘/setup-subcriptions’, async (req, res) => {
try {
const deviceIdsString = req.body.deviceIDs;
const installedAppId = req.header(‘installed-App-Id’);

    if (!deviceIdsString || !installedAppId) {
      print('Invalid request: Missing deviceIDs or installedAppId: ${deviceIds}')
        return res.status(400).send('Invalid request: Missing deviceIDs or installedAppId: ${deviceIds}');
    }
    
    const deviceIds = deviceIdsString.split(',').map(id => id.trim()); // Split and trim device IDs
    
    if (!Array.isArray(deviceIds) || deviceIds.length === 0) {
      console.log("DeviceIds: ${deviceIds}")
        return res.status(400).send('Invalid device IDs provided');
      
    }

    // Store the deviceIds for the installedAppId
    deviceIdCache[installedAppId] = deviceIds;
    
    // Create subscriptions for each device ID
    await Promise.all(deviceIds.map(deviceId => createSubscription(deviceId, installedAppId)));
    
    res.sendStatus(200); // Send success response
} catch (error) {
    console.error('Error setting up subscriptions:', error);
    res.sendStatus(500); // Send error response
}

});