An Activity Log of Email Routing using an API

I’m new to Cloudflare. I need an activity log of email routing using an API. I’ve attached a screenshot of what I can see on the web-console at => Domain => Email.

This query returns no data:

curl -H "X-Auth-Email: " -H "X-Auth-Key: " -H “Content-Type: application/json”
-X GET “”

How can I get the activity log of email routing that you can see on the dashboard?


Officially, there is no API for email routing yet. However, you can do it with the GraphQL. The endpoint is and a request with curl looks like

curl --location --request POST '' \
--header 'X-AUTH-KEY: X-AUTH-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"{\n    viewer {\n        zones(filter: {zoneTag: $zoneTag}) \n        {\n            emailRoutingAdaptive(limit: 1000, filter: $filter, orderBy: [datetime_DESC, from_ASC, to_ASC, status_ASC]){        datetime        id: sessionId        from        to       status        spf        dkim        dmarc        errorDetail        __typename      }      __typename    }    __typename  }\r\n}","variables":{"zoneTag":"<Zone ID>","filter":{"datetime_geq":<Start Date>"","datetime_leq":"<End Date>"}}}'

Example Start Date: 2022-05-12T19:45:00.000Z
Example End Date: 2022-05-13T19:45:00.000Z

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.