How can I have the ProcessInstanceId of the process instance(s) that a sent message has been delivered to?
I'm sending the message through REST API.
You could include some unique identifier just known by the sender in your message as a process variable (see e.g. Camunda BPM REST API 'message' endpoint). Such a process variable is then held by your targeted process instance just after really having received the message.
So, after having sent the message, you can then as a second step query for the receiving process instance (see e.g. Camunda BPM REST API 'get-instances' endpoint) which holds the variable with the expected identifier.