Skip to main content
Version: v1

Introduction

📄PDF

YuChat provides a REST API for integrating with external systems and building chatbots.

📄 Download OpenAPI Specification


Creating a Bot

  1. Add the Bot Assistant (aibot@yuchat.ai) to your workspace. This assistant is required for creating and managing bots.

    • Go to Workspace SettingsInvite to TeamInvite by Email → enter aibot@yuchat.ai

    • Once added, the assistant will appear in the AI Agents and Bots section below your channels list


      note
      You can also interact with the Bot Assistant via direct messages using these commands:
      CommandDescription
      /helpShow available commands
      /smartSmart search across YuChat. Ask a question and the bot will search all accessible messages and meetings
      /unreadGet a summary of unread messages. Optionally specify days: /unread 3 (1-7 or 14 days)
      /descGet a summary of all messages. Specify days: /desc 3 (1-7 or 14 days)
      /botcreateCreate a new bot: /botcreate MyBot
      /botlistList all active bots in the workspace
      /botdeleteDelete a bot by ID: /botdelete avfANxAcG8
      /botnewtokenGenerate a new token for a bot (invalidates the old one): /botnewtoken avfANxAcG8
  2. Send a direct message to the Bot Assistant with /botcreate <bot_name>

  3. You'll receive a token to use for API authentication

    Example:

    Command:

    /botcreate TestBot

    Response:

    Bot TestBot created
    Token: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJDbzVsR3ItZU51WnU0TjdUSEd2TGVHRGNWVk1oR1JXWlVLTmc0cFBxa2hBIn0.eyJleHAicJ1In0.Cncyq8zILO81Bv_wbNk5b5OuHLP76Vf94TRs2gUAq-Mvq3Qc4ZFNE_eMcpsvYr0q4DOAffpQ

  4. Save your token securely


info

Bots can only send messages and perform actions in channels where they are members.

Adding a Bot to a Channel

  1. Open the target channel
  2. Open the Members list
  3. Click Add People
  4. Select the bot from the list
  5. Click Invite

You can also download the OpenAPI specification here.

💡 Use the sidebar to browse available API methods, request/response schemas, and examples.

info

Base URL

  • Cloud: https://yuchat.ai/

  • On-Premises: Use your corporate API endpoint, e.g., https://api.company.com

    Note: Use the API domain, not the web client URL, or requests will fail.

Authentication

Include this header in every request:

Authorization: Bearer <your_token>

🔑 Some endpoints (e.g., sending messages or files) require workspaceId and chatId in the request body.

Finding Your workspaceId

  1. Open YuChat in your browser and navigate to the target workspace

  2. Open Developer Tools (F12)

  3. Go to the Elements tab

  4. Look for an element with the data-workspace-id attribute

    Example: <div data-workspace-id="RRvYqDwAvk">

    info

    If you have multiple workspaces, ensure you're inspecting the correct one.

  5. Alternatively, open the Console tab and switch workspaces—you'll see: go to workspaceId: <ID>

Finding Your chatId

Check the browser URL when viewing a channel:

Example: https://web.yuchat.ai/testws/channels/w:eXtXOs0sT2

The chatId is w:eXtXOs0sT2.