Data transfer between two DW3001

Is it possible to transfer custom data between two DW3001 boards while performing ranging? If so, is there an API function available for this purpose?

Yes. And not directly.

The nature of the ranging process requires you to send radio packets between the two devices. Those packets contain the information required to calculate the range.
There is nothing to prevent you from taking the packets defined in the ranging example code and expanding them to include space for extra data.

However this has some drawbacks:
The time taken to send the extra data needs to be taken into account when calculating timeouts and range measurement rates.
Only the ranging initiator can start a transfer, depending on your data requirements this could be an issue.
There is no inherent verification of data being received correctly, if you require reliable data transfer you would need to implement your own acknowledgment/re-transmission protocol on top of the basic ranging mechanism.
The packets are limited to fairly small sizes and so data transfer is not particularly fast.

So yes, you can send data. The existing API gives you a framework that can be used to transmit data. However the API is lacking features that you would normally expect for a data transfer system and so requires you to do more in your own code than most other radio data transfer methods.
Basically you can do it, but for anything other than small amounts of ranging system related data (e.g. including battery status in a reply) I wouldn’t recommend it unless you have no other option.

I’m trying to send data through the payload from a Python script, but it stops at one board. How can I ensure it reaches the receiver? Is there a specific part of the SDK where I need to make changes to address this? If so, could you please provide guidance on that?

No, as I indicated there is no support in the SDK for ensuring a transmission is received.

You will need to make the receiver send an acknowledgment back to the transmitter indicating reception. If the transmitter doesn’t receive this within a certain time period it then resends the data.
The receiver needs to also cope with receiving the same data twice (discard the repeat and send a second acknowledgment) to cover the situation where the acknowledgment message was lost.

Is there a specific API in the DWM3001CDK-DW3_QM33_SDK_UCI-FreeRTOS for handling acknowledgements? If not, is there an updated version of the SDK that includes support for this feature? Could you please provide the API used for data transmission and sending received data used in the SDK.

No, yet again, there is no support in the SDK for ensuring a transmission is received.

All the SKD / API gives you is a way to blindly broadcast packets and to receive packets that may or may not be intended for you.
Everything else you need to do yourself. To send an acknowledgment you would need to send a transmission back with a packet structure that you have defined as being an acknowledgment.
You need to track which transmissions have been acknowledged and which haven’t. You need to verify that the acknowledgment was from the correct receiving device.

Can you provide me an example of how the data transmission work as you have mentioned before?

Look at any of the supplied ranging examples, they all transmit and receive packets.
Everything else you need to do yourself.