Skip to main content
Connect the ChatbotX CLI to your self-hosted instance using a Workspace token (API Key) and API URL. Save your credentials locally in the CLI configuration file:
chatbotx config set --apiKey "YOUR_WORKSPACE_TOKEN" --apiUrl "https://app.chatbotx.io/api"
  • --apiKey: Your Workspace token (found under Settings → Developer → API Keys or Settings → Integrations → Workspace token).
  • --apiUrl: The API URL of your ChatbotX instance.

Environment Variables

Use environment variables when you do not want secrets stored in shell history or shared scripts. The CLI will automatically detect them:
export CHATBOTX_API_KEY="YOUR_WORKSPACE_TOKEN"
export CHATBOTX_API_URL="https://app.chatbotx.io/api"

Custom API URL (Self-Hosted)

If you are self-hosting ChatbotX, point the CLI configuration or environment variables to your custom domain API endpoint:
chatbotx config set --apiKey "YOUR_WORKSPACE_TOKEN" --apiUrl "https://app.yourdomain.com/api"
Or via environment variables:
export CHATBOTX_API_URL="https://app.yourdomain.com/api"

Override Configuration per Command

You can override the configured Workspace token and API URL for a single command by passing them as options:
chatbotx --apiKey "YOUR_WORKSPACE_TOKEN" --apiUrl "https://app.chatbotx.io/api" workspaces get
If you are running a self-hosted instance:
chatbotx --apiKey "YOUR_WORKSPACE_TOKEN" --apiUrl "https://app.yourdomain.com/api" workspaces get

Self-Signed Certificates

If your self-hosted instance uses a self-signed certificate, configure the CLI to allow secure connections. Using the CLI configuration:
chatbotx config set --allowSelfSignedCert true
Or using an environment variable:
export CHATBOTX_ALLOW_SELF_SIGNED_CERT=true
Do not commit real Workspace tokens to git repositories. Use environment variables or a secret manager for automation scripts and CI/CD workflows.