How can I find the rule created via http api?

Hi,all:
My alert history exists, but cannot view the alter rule added via http provisioning API . The rule can also be found via http API, but how can the alert rule be found via UI?
version: grafana-10.0.3




The alert rule had been added successfully by the curl command. The request body refer to one rule yaml exported.

curl localhost:3000/api/v1/provisioning/alert-rules  -X POST --insecure -H "X-Disable-Provenance:true" -H "Authorization: Bearer eyJrIjoiUWkzWmdOU05FSDhPbmc3SUFDVnZOMjdlanpmNWd1QkoiLCJuIjoiYXBpa2V5Y3VybCIsImlkIjoyfQ==" -H "Content-Type: application/json" -d '{
    "title": "alert_test0904_01",
    "orgID":1,
    "condition": "A",
    "folderUID": "alter_rule_test_folder",
    "ruleGroup": "alter_rule_test_group",
    "data": [
        {
            "refId": "A",
            "relativeTimeRange": {
                "from": 1800,
                "to": 0
            },
            "datasourceUid": "f3349557-2edd-4c21-8c5e-27bde72dca0c",
            "model": {
                "datasource": {
                    "type": "prometheus",
                    "uid": "f3349557-2edd-4c21-8c5e-27bde72dca0c"
                },
                "editorMode": "builder",
                "expr": "prometheus_http_requests_total{job=\"prometheus\"}",
                "hide": false,
                "instant": true,
                "intervalMs": 1000,
                "maxDataPoints": 43200,
                "range": false,
                "refId": "A"
            }
        },
        {
            "refId": "B",
            "relativeTimeRange": {
                "from": 600,
                "to": 0
            },
            "datasourceUid": "__expr__",
            "model": {
                "conditions": [
                    {
                        "evaluator": {
                            "params": [
                                0,
                                0
                            ],
                            "type": "gt"
                        },
                        "operator": {
                            "type": "and"
                        },
                        "query": {
                            "params": []
                        },
                        "reducer": {
                            "params": [],
                            "type": "avg"
                        },
                        "type": "query"
                    }
                ],
                "datasource": {
                    "name": "Expression",
                    "type": "__expr__",
                    "uid": "__expr__"
                },
                "expression": "A",
                "intervalMs": 1000,
                "maxDataPoints": 43200,
                "reducer": "max",
                "refId": "B",
                "type": "reduce"
            }
        },
        {
            "refId": "C",
            "relativeTimeRange": {
                "from": 600,
                "to": 0
            },
            "datasourceUid": "__expr__",
            "model": {
                "conditions": [
                    {
                        "evaluator": {
                            "params": [
                                3
                            ],
                            "type": "gt"
                        },
                        "operator": {
                            "type": "and"
                        },
                        "query": {
                            "params": [
                                "C"
                            ]
                        },
                        "reducer": {
                            "params": [],
                            "type": "last"
                        },
                        "type": "query"
                    }
                ],
                "datasource": {
                    "type": "__expr__",
                    "uid": "__expr__"
                },
                "expression": "B",
                "hide": false,
                "intervalMs": 1000,
                "maxDataPoints": 43200,
                "refId": "C",
                "type": "threshold"
            }
        }
    ],
    "noDataState": "NoData",
    "execErrState": "Error",
    "for": "1m",
    "isPaused": false
}'

Hey, I was confused by this too.

In my case, what solved it was setting the “id” field of alert to “null”. This let Grafana create the alert with its own random id field (if you want to make sure you can find it, you can always use “uid” instead of “id”.

Grafana docs sorts of mention it, but it is a bit hidden:

Give it a shot and let’s see if it works.

Yes, it seems that grafana use “uid” as the identifier, it is uuid but not name. My error occured because I set the folder uid as the folder name.
You can first add items via UI, then query the results via api as the example.