code: @POST
      @Path("{id}/migrate")
      public CreateEmoApiKeyResponse migrateApiKey(@PathParam("id") String id, @QueryParam("key") String key,
                                                   @Authenticated Subject subject) {
          MigrateEmoApiKeyRequest request = new MigrateEmoApiKeyRequest(id);
          if (key != null) {
              request.setCustomRequestParameter("key", key);
          }
          String newKey = _uac.migrateApiKey(subject, request);
          // Even though we're technically not creating a new API key the response object is the same
          return new CreateEmoApiKeyResponse(newKey, id);
      }
docs: Migrates an API key to a new private key.