What are the possible Key/Values for Audit Logs Metadata

Hello, I am looking to map out the possible key/values that the Metadata object could return.

I am using this API end point https://api.cloudflare.com/client/v4/user/audit_logs

Resource for the API: Cloudflare API v4 Documentation

Example object it can return…

{

        "action": {

            "result": true,

            "type": "token_create"

        },

        "actor": {

            "email": "",

            "id": "",

            "ip": "",

            "type": "user"

        },

        "id": "",

        "interface": "",

        "metadata": {

            "token_name": "Read all resources",

            "token_tag": "ndkon2409ngvrio40hina1246"

        },

        "newValue": "",

        "oldValue": "",

        "owner": {

            "id": ""

        },

        "resource": {

            "id": "",

            "type": "account"

        },

        "when": "2022-04-25T21:53:32Z"

    },

Here are the field names I have found so far under the metadata object.

token_name
token_tag
new_token_status
old_token_status

Question - Is there documentation that shows the possible key values for the metadata object that can have different key values?

I don’t think there’s a list of all possible keys. You could fetch all the audit logs of your own account and then extract all the unique keys. That should give you a pretty good idea of what keys to expect - but it won’t guarantee you have them all.

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