private async Task <int> ApiCreate()
 {
     using (IAgentManager agentManager = _helper.GetServicesManager().CreateProxy <IAgentManager>(ExecutionIdentity.CurrentUser))
     {
         Relativity.Services.Agent.Agent newAgent = new Relativity.Services.Agent.Agent
         {
             AgentType    = new AgentTypeRef(_agentTypeArtifactId),
             Enabled      = true,
             Interval     = _runInterval,
             Name         = CreateAgentName(),
             LoggingLevel = Relativity.Services.Agent.Agent.LoggingLevelEnum.Critical,
             Server       = new ResourceServerRef
             {
                 ArtifactID = _agentServerArtifactId
             }
         };
         return(await agentManager.CreateSingleAsync(newAgent));
     }
 }