Winlogbeat unable to connect to elasticsearch

fail to import the dashboards in Kibana: Error importing directory C:\Program Files\winlogbeat-8.9.1-windows-x86_64\kibana: failed to import Kibana index pattern: 1 error: error loading index pattern: returned 403 to import file: Unable to bulk_create index-pattern. Response: {"statusCode":403,"error":"Forbidden","message":"Unable to bulk_create index-pattern"}

i got struct in this error winlogbeat gives this error i tried using api key


Ensure that the API key you're using has the necessary permissions to create index patterns. This typically requires the kibana_user role or a custom role with equivalent permissions.