You can't make API calls within condition gateway expressions. However, you can execute the condition before the gateway and then use its result in the gateway.
Can you explain bit more on what you are trying to do ?
I think the condition on the flow here should be adjusted slightly. Conditional flows are best used for flows coming from a gateway, not from an activity. Otherwise, there could be cases where the workflow does not end properly by reaching an end task.