Updating DNS TXT records

I am trying to create some DNS TXT records for one of my domains and I cannot seem to be able to even login. I use the following request to see if I can even login and I get an authentication error message (code 10000).

curl --request GET
–url https://api.cloudflare.com/client/v4/zones/MYZONEIDGOESHERE/dns_records/export
–header ‘Content-Type: application/json’
–header ‘X-Auth-Email: MYEMAILHERE’
–header ‘X-Auth-Key: MYAPITOKENHERE’

is this correct? If I cannot authenticate moving forward with creating requests in python would be a mute point. thanks for any pointers

The X-Auth-Key method expects a global API key, not an API token.

If you want to use an API token (and you should), lose the X-Auth-Email header, and instead of X-Auth-Key, use Authorization: Bearer MYAPITOKENHERE.