Block pipeline if tests are failed

My application and tests are placed in the different repositories. In the CircleCI there are different project and even different organizations (i dont know why)
In the app pipelint I created workflow which trigger tests pipeline using api

It works well, I can see the report in slack channel, however if tests failed I can see that in the slack channel or tests CircleCi project, in the app’s pipeline everything green. Is there any way mark job failed if tests pipeline failed

Hello!
To ensure your app’s pipeline reflects the test pipeline failures, you can use the CircleCI API to check the status of the test pipeline and fail the app’s pipeline if the tests fail. In your app’s pipeline, add a step to check the test pipeline status using a shell script. If the test pipeline status indicates failure, use a command to fail the app’s pipeline. This way, if the test pipeline fails, the app’s pipeline will also be marked as failed, ensuring consistency across your workflows. Does this help with your setup?

Could you please provide some documentation about that api