diff --git a/Changes b/Changes
index cf11729..2bda9a9 100644
--- a/Changes
+++ b/Changes
@@ -17,6 +17,7 @@
 - Remove unsubscribe member (#764)
 - Added deprecation messages to deprecated services
 - Removed mail configuration (#764)
+- Deprecate VC access deletion.
 
 # version 0.74
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java b/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
index cb1ceda..27aff66 100644
--- a/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
+++ b/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
@@ -392,16 +392,10 @@
     public Response deleteAccessById (
             @Context SecurityContext securityContext,
             @PathParam("accessId") int accessId) {
-        TokenContext context = (TokenContext) securityContext
-                .getUserPrincipal();
-        try {
-            scopeService.verifyScope(context, OAuth2Scope.DELETE_VC_ACCESS);
-            service.deleteRoleById(accessId, context.getUsername());
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok().build();
+        throw kustvaktResponseHandler.throwit(new KustvaktException(
+                StatusCodes.DEPRECATED,
+                "This web-service is deprecated and will be completely removed "
+                + "in API v1.1."));
     }
     
     /**
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusAccessTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusAccessTest.java
deleted file mode 100644
index 8eca508..0000000
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusAccessTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package de.ids_mannheim.korap.web.controller.vc;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-import org.apache.http.HttpStatus;
-import org.junit.jupiter.api.Test;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-import de.ids_mannheim.korap.constant.PredefinedRole;
-import de.ids_mannheim.korap.constant.ResourceType;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import jakarta.ws.rs.ProcessingException;
-import jakarta.ws.rs.core.Form;
-import jakarta.ws.rs.core.Response;
-import jakarta.ws.rs.core.Response.Status;
-
-public class VirtualCorpusAccessTest extends VirtualCorpusTestBase {
-
-    private String testUser = "VirtualCorpusAccessTest";
-
-
-
-    private void testShareVC_nonUniqueAccess (String vcCreator, String vcName,
-            String groupName) throws ProcessingException, KustvaktException {
-        Response response = shareVCByCreator(vcCreator, vcName, groupName);
-        JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatus());
-        assertEquals(StatusCodes.DB_INSERT_FAILED,
-                node.at("/errors/0/0").asInt());
-        // EM: message differs depending on the database used
-        // for testing. The message below is from sqlite.
-        // assertTrue(node.at("/errors/0/1").asText()
-        // .startsWith("[SQLITE_CONSTRAINT_UNIQUE]"));
-    }
-
-    @Test
-    public void testDeleteNonExistingAccess ()
-            throws ProcessingException, KustvaktException {
-        Response response = deleteAccess("dory", "100");
-        assertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());
-        JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
-        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
-                node.at("/errors/0/0").asInt());
-    }
-}
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java
index 08ca16e..6678ca1 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java
@@ -177,13 +177,13 @@
         
         JsonNode node = listRolesByGroup("admin",groupName);
         assertEquals(1, node.size());
-        String roleId = node.at("/0/roleId").asText();
+        
         node2 = testAdminListVC_UsingAdminToken(vcCreator,
                 ResourceType.PROJECT);
         assertEquals(1, node2.size());
         
-        Response response = deleteAccess("admin",roleId);
-        assertEquals(Status.OK.getStatusCode(), response.getStatus());
+        // delete role
+        deleteRoleByGroupAndQuery(vcCreator, vcName, groupName, "admin");
         node = listRolesByGroup("admin",groupName);
         assertEquals(0, node.size());
         
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java
index d9604fb..4babd96 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java
@@ -244,17 +244,6 @@
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
     }
     
-    @Deprecated
-    protected Response deleteAccess (String username, String accessId)
-            throws ProcessingException, KustvaktException {
-        Response response = target().path(API_VERSION).path("vc").path("access")
-                .path(accessId).request()
-                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
-                        .createBasicAuthorizationHeaderValue(username, "pass"))
-                .delete();
-        return response;
-    }
-    
     protected Response deleteRoleByGroupAndQuery (String vcCreator, String vcName,
             String groupName, String deleteBy)
             throws ProcessingException, KustvaktException {
