public async Task <IActionResult> AddAgentCredential([FromBody] AgentCredentialViewModel request) { try { Credential credential = _credentialManager.CreateAgentCredential(request); var result = await base.PostEntity(credential); await _webhookPublisher.PublishAsync("Credentials.NewCredentialCreated", credential.Id.ToString(), credential.Name).ConfigureAwait(false); return(result); } catch (Exception ex) { return(ex.GetActionResult()); } }