code: public void destroy(long disconnectRequestTimeout) throws WorkspaceApiException {
          try {
              if (this.workspaceInitialized) {
                  notifications.disconnect(disconnectRequestTimeout);
                  sessionApi.logout();
              }
          } catch (Exception e) {
              throw new WorkspaceApiException("destroy failed.", e);
          } finally {
              this.workspaceInitialized = false;
          }
      }
docs: Ends the current agent's session. This request logs out the agent on all activated channels, ends the HTTP session,
  and cleans up related resources. After you end the session, you'll need to make a login request before making any
  new calls to the API.
  @param disconnectRequestTimeout The timeout in ms to wait for the disconnect to complete