diff --git a/lib/api/project_members.rb b/lib/api/project_members.rb
index c0e532f41376be9d76c89b4ae16bb524124c3ff2..1595ed0bc3653dc068a8cd7fc318eace0be245de 100644
--- a/lib/api/project_members.rb
+++ b/lib/api/project_members.rb
@@ -6,8 +6,8 @@ module API
     resource :projects do
       helpers do
         def handle_project_member_errors(errors)
-          if errors[:project_access].any?
-            error!(errors[:project_access], 422)
+          if errors[:access_level].any?
+            error!(errors[:access_level], 422)
           end
           not_found!
         end