TL:DR Key (in the world) should be an actor but once the player picks it up, it should be added to the player “inventory”. Other systems should look at the player’s “item list” to figure out if the player has the given key.
The issue with questions like these is that it’s too broad. There is no definitive “this is how to do it”. It can be done in a million ways and it can be as simple or complex as you want/need.
Is the key something you find in the level? Then it should be an actor. I’m not sure what “assigning an ID” means though. A control panel or something has to know if the player got the required card? That should be done through some form of a player inventory. Don’t overthink it. A list of names is already an inventory. The control panel can check if the item list contains the given name. The inventory itself can be an actor component, a subsystem, part of the character/player state logic, etc. You can have a variable “ItemName” on the key actor, when the player picks up the key, you can add this name to the player inventory. After that the key actor can be destroyed.