diff --git a/include/caosdb/entity.h b/include/caosdb/entity.h
index 37a1797c586fb4234e8c385a5d0a1b89c2589ce7..bbccf1197ae3a13500f3c8b500c615ced7da5a83 100644
--- a/include/caosdb/entity.h
+++ b/include/caosdb/entity.h
@@ -40,6 +40,18 @@ using ProtoParent = caosdb::entity::v1alpha1::Parent;
 using ProtoProperty = caosdb::entity::v1alpha1::Property;
 using ProtoEntity = caosdb::entity::v1alpha1::Entity;
 using ProtoMessage = caosdb::entity::v1alpha1::Message;
+using caosdb::entity::v1alpha1::EntityRole;
+
+/**
+ * The entity role.
+ */
+enum Role {
+  NONE = EntityRole::ENTITY_ROLE_UNSPECIFIED,        ///< Unset/None
+  RECORD_TYPE = EntityRole::ENTITY_ROLE_RECORD_TYPE, ///< RecordType
+  RECORD = EntityRole::ENTITY_ROLE_RECORD,           ///< Record
+  PROPERTY = EntityRole::ENTITY_ROLE_PROPERTY,       ///< Property
+  FILE = EntityRole::ENTITY_ROLE_FILE,               ///< File
+};
 
 /**
  * Messages convey information about the state and result of transactions.
@@ -374,7 +386,7 @@ public:
   inline Entity(const Entity &original) : Entity(CreateProtoEntity()) {
     this->wrapped->CopyFrom(*original.wrapped);
   };
-  explicit Entity(IdResponse *idResponse);
+  explicit Entity(IdResponse *id_response);
   explicit inline Entity(ProtoEntity *wrapped) : wrapped(wrapped) {
     errors.wrapped = this->wrapped->mutable_errors();
     warnings.wrapped = this->wrapped->mutable_warnings();
@@ -393,7 +405,7 @@ public:
     return wrapped->version().id();
   };
 
-  [[nodiscard]] inline auto GetRole() const -> const std::string & {
+  [[nodiscard]] inline auto GetRole() const -> Role & {
     return wrapped->role();
   };
   [[nodiscard]] inline auto GetName() const -> const std::string & {
@@ -437,7 +449,7 @@ public:
     return out;
   }
 
-  auto SetRole(const std::string &role) -> void;
+  auto SetRole(Role role) -> void;
   auto SetName(const std::string &name) -> void;
   /**
    * Set the description of this entity.
diff --git a/proto b/proto
index 36d7956b6eca506fb87096d8d50b6f4b820778b8..4ce7460ff869422c419623c8d0cee0459ce6d6dc 160000
--- a/proto
+++ b/proto
@@ -1 +1 @@
-Subproject commit 36d7956b6eca506fb87096d8d50b6f4b820778b8
+Subproject commit 4ce7460ff869422c419623c8d0cee0459ce6d6dc
diff --git a/src/caosdb/entity.cpp b/src/caosdb/entity.cpp
index 03a234be80e9a965170ce35240e6c838c62cba6f..67eade24bb4f1ee16c84f3c78342e5434aea8301 100644
--- a/src/caosdb/entity.cpp
+++ b/src/caosdb/entity.cpp
@@ -171,12 +171,13 @@ Entity::Entity() : wrapped(Entity::CreateProtoEntity()) {
   infos.wrapped = this->wrapped->mutable_infos();
 }
 
-Entity::Entity(IdResponse *idResponse) : Entity() {
-  this->wrapped->set_id(idResponse->id());
-  this->wrapped->mutable_errors()->Swap(idResponse->mutable_entity_errors());
+Entity::Entity(IdResponse *id_response) : Entity() {
+  this->wrapped->set_id(id_response->id());
+  this->wrapped->mutable_version()->Swap(id_response->mutable_version());
+  this->wrapped->mutable_errors()->Swap(id_response->mutable_entity_errors());
   this->wrapped->mutable_warnings()->Swap(
-    idResponse->mutable_entity_warnings());
-  this->wrapped->mutable_infos()->Swap(idResponse->mutable_entity_infos());
+    id_response->mutable_entity_warnings());
+  this->wrapped->mutable_infos()->Swap(id_response->mutable_entity_infos());
 }
 
 auto Entity::SetId(const std::string &id) -> void { this->wrapped->set_id(id); }
@@ -189,7 +190,7 @@ auto Entity::CopyTo(ProtoEntity *target) -> void {
   target->CopyFrom(*(this->wrapped));
 }
 
-auto Entity::SetRole(const std::string &role) -> void {
+auto Entity::SetRole(Role role) -> void {
   this->wrapped->set_role(role);
 }