Add existing cluster to rancher using api

I have a cluster creation pipeline using terraform that creates 5 GKE clusters. One cluster is for rancher, and the other 4 are for the application itself ( dev, qa, stg and prod ). I need to add these 4 clusters to rancher programmatically using the api because I need to do that on a pipeline step.
On rancher docs I only found how to do that using the web UI.
Can you please help me ? Thank you.

Hello Gabriel,

This article could help you

I used it as a reference to create a cluster with ansible.

Thank you,
Yes I already saw this article but didn’t have a chance to test yet. But what surprise me most is that there’s no documentation at all, no examples, etc.

Anyway, thanks