May I ask if you’ve already went to the Zero Trust dashboard, under the Devices and checked the Warp Client Settings to Manage keys?
Maybe you don’t see the license key in the dashboard?
Is the Zero Trust setup is complete and that the Warp service enabled for your Zero Trust CF account?
Are you using a paid plan type?
Before using the API, did you tried to do it manually following the instructions from article below?