Rancher API for disaster recovery

Is there anyway Rancher APIs(v3) can be used to dump the secrets in a namespace to a file and restore back if needed.

Through the APIs, I am looking for is to backup the selected resource( for example: secrets, config, ingress…etc.) in a file and restore it later if needed.

I am able to authenticate using the API key but looking for possibilities and any sample requests.