openapi: 3.0.1
info:
  title: "YuChat Bot API"
  version: 1.1.3
  description: "Public API for working with YuChat."
  contact:
    name: "YuChat Team"
    url: "https://www.yuchat.ai"
    email: "support@yuchat.ai"
servers:
  - url: "https://yuchat.ai"
tags:
  - name: message
    description: Sending/editing/deleting messages
  - name: chat
    description: Creating chats, viewing/inviting chat members
  - name: member
    description: Viewing workspace members
  - name: updates
    description: Receiving all events addressed to the bot
  - name: webhook
    description: Creating, viewing, and deleting webhooks
  - name: file
    description: Getting a link for uploading files
paths:
  /public/v1/chat.message.send:
    post:
      description: Send a message on behalf of the bot
      tags:
        - message
      operationId: sendChatMessage
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SendChatMessagePublicV1Request"
        required: true
      responses:
        "200":
          description: Message sent successfully; the response body contains the ID of this message
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SendChatMessagePublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.message.edit:
    post:
      description: Edit a message
      tags:
        - message
      operationId: editChatMessage
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EditChatMessagePublicV1Request"
        required: true
      responses:
        "200":
          description: Message edited successfully; the response body contains the time of the last update, the message ID stays the same
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EditChatMessagePublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.message.delete:
    post:
      description: Delete a message
      tags:
        - message
      operationId: deleteChatMessage
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeleteChatMessagePublicV1Request"
        required: true
      responses:
        "200":
          description: Message deleted successfully; the response body contains the deletion time
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteChatMessagePublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.message.forward:
    post:
      description: Forward a message to another chat
      tags:
        - message
      operationId: forwardChatMessage
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ForwardChatMessagePublicV1Request"
        required: true
      responses:
        "200":
          description: Message forwarded successfully; the response body contains the ID of the forwarded message
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForwardChatMessagePublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.workspace.create:
    post:
      description: Create a public/private chat within a workspace
      tags:
        - chat
      operationId: createWorkspaceChat
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateWorkspaceChatPublicV1Request"
        required: true
      responses:
        "200":
          description: Chat created successfully; the response body contains the chat ID
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateWorkspaceChatPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.personal.create:
    post:
      description: Create a personal chat (direct messages)
      tags:
        - chat
      operationId: createPersonalChat
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreatePersonalChatPublicV1Request"
        required: true
      responses:
        "200":
          description: Personal chat created successfully; the response body contains the chat ID
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreatePersonalChatPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.thread.create:
    post:
      description: Create a thread within a chat
      tags:
        - chat
      operationId: createThreadChat
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateThreadChatPublicV1Request"
        required: true
      responses:
        "200":
          description: Thread created successfully; the response body contains the chat ID
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateThreadChatPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.workspace.list:
    post:
      description: Get the list of chats within a workspace
      tags:
        - chat
      operationId: listWorkspaceChats
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ListWorkspaceChatsPublicV1Request"
        required: true
      responses:
        "200":
          description: List of chats
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListWorkspaceChatsPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.invite:
    post:
      description: Invite members to a chat
      tags:
        - chat
      operationId: inviteToChat
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InviteToChatPublicV1Request"
        required: true
      responses:
        "200":
          description: Members invited successfully; the response body contains chat information, including member IDs
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InviteToChatPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/chat.kick:
    post:
      description: Remove a member from a chat
      tags:
        - chat
      operationId: kickFromChat
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KickFromChatPublicV1Request"
        required: true
      responses:
        "200":
          description: Members removed successfully; the response body contains chat information, including the IDs of the remaining members
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KickFromChatPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/member.list:
    post:
      description: Get the list of workspace members
      tags:
        - member
      operationId: listMembers
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MemberListPublicV1Request"
        required: true
      responses:
        "200":
          description: List of members
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MemberListPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/file.getPreSignedUrl:
    post:
      description: Get a link for uploading a file to the server
      tags:
        - file
      operationId: getPreSignedUrl
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetFilePreSignedUrlPublicV1Request"
        required: true
      responses:
        "200":
          description: Link for uploading a file and the file ID
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetFilePreSignedUrlPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/file.getDownloadUrl:
    post:
      description: Get a download link for a file
      tags:
        - file
      operationId: getDownloadUrl
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetFileDownloadUrlPublicV1Request"
        required: true
      responses:
        "200":
          description: Link for downloading the file
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetFileDownloadUrlPublicV1Response"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
  /public/v1/bot.getUpdates:
    get:
      description: Get all events addressed to the bot (direct messages, mentions in chats, chat invitations, etc.)
      operationId: getUpdates
      tags:
        - updates
      parameters:
        - name: offset
          in: query
          description: ID of the last processed event. If not specified, all events are returned.
          required: false
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: Maximum number of events to return. Default is 100.
          required: false
          schema:
            type: integer
            default: 100
      responses:
        "200":
          description: List of events addressed to the bot
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Update"
  /public/v1/bot.setWebhook:
    post:
      operationId: setWebhook
      tags:
        - webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SetWebhookPublicV1Request"
      responses:
        "200":
          description: setWebhook 200 response
          content:
            application/json:
              schema:
                type: object
                nullable: true
  /public/v1/bot.deleteWebhook:
    delete:
      operationId: deleteWebhook
      tags:
        - webhook
      responses:
        "200":
          description: deleteWebhook 200 response
          content:
            application/json:
              schema:
                type: object
                nullable: true
  /public/v1/bot.getWebhookInfo:
    get:
      operationId: getWebhookInfo
      tags:
        - webhook
      responses:
        "200":
          description: getWebhookInfo 200 response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetWebhookInfoPublicV1Response"
        "404":
          description: getWebhookInfo 404 response
          content:
            application/json:
              schema:
                type: object
                nullable: true
components:
  schemas:
    WorkspaceId:
      description: Workspace ID
      example: w67Y89gu
      type: string
      format: flake-id
    ChatId:
      description: Chat ID, unique within a workspace
      example: c56Y0kgi
      type: string
      format: string-id
    ChatMessageId:
      description: Message ID, unique within a workspace and chat
      example: m56Y0kgi
      type: string
      format: flake-id
    AccountId:
      description: User account ID
      example: a56Y0kgi
      type: string
      format: flake-id
    MembershipId:
      description: User ID within a specific workspace
      example: a56Y0kgi
      type: string
      format: flake-id
    NewChatMessage:
      description: A message visible to the bot
      example:
        workspaceId: w67Y89gu
        chatId: c56Y0kgi
        messageId: m56Y0kgi
        author: a56Y0kgi
        markdown: "Reminder: the company party is today at 19:00 (bots are invited too)"
      required:
        - workspaceId
        - chatId
        - messageId
        - markdown
        - author
        - createdAt
      type: object
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        chatId:
          $ref: "#/components/schemas/ChatId"
        messageId:
          $ref: "#/components/schemas/ChatMessageId"
        author:
          $ref: "#/components/schemas/AccountId"
        parentMessageId:
          $ref: "#/components/schemas/ChatMessageId"
        parentMessageAuthor:
          $ref: "#/components/schemas/AccountId"
        markdown:
          type: string
        fileIds:
          type: array
          items:
            type: string
        createdAt:
          description: Date and time the message was sent
          example: "2023-02-26T18:58:36.154+03:00"
          type: string
          format: date-time
    InviteToChat:
      description: Bot invitation to a chat
      example:
        workspaceId: w67Y89gu
        chatId: c56Y0kgi
        inviter: a56Y0kgi
      required:
        - workspaceId
        - chatId
        - inviter
      type: object
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        chatId:
          $ref: "#/components/schemas/ChatId"
        inviter:
          $ref: "#/components/schemas/AccountId"
    JoinedToChat:
      required:
        - workspaceId
        - chatId
        - joined
      type: object
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        chatId:
          $ref: "#/components/schemas/ChatId"
        inviter:
          $ref: "#/components/schemas/MembershipId"
        joined:
          type: array
          items:
            $ref: "#/components/schemas/MembershipId"
    LeftFromChat:
      required:
        - workspaceId
        - chatId
        - left
      type: object
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        chatId:
          $ref: "#/components/schemas/ChatId"
        kicker:
          $ref: "#/components/schemas/MembershipId"
        left:
          type: array
          items:
            $ref: "#/components/schemas/MembershipId"
    WorkspaceChat:
      description: Chat information
      example:
        chatId: c56Y0kgi
        membershipIds:
          - a56Y0kgi
          - a56Y0kgi
        workspaceId: w67Y89gu
        name: Off-topic
        type: PUBLIC
        announceChannel: true
        description: Conversations on any topics except work
      type: object
      properties:
        chatId:
          type: string
        membershipIds:
          type: array
          items:
            type: string
        workspaceId:
          type: string
        name:
          type: string
        type:
          $ref: "#/components/schemas/WorkspaceChatType"
        announceChannel:
          type: boolean
        description:
          type: string
    WorkspaceChatType:
      description: Chat type (public, private, common, breakout)
      example: PUBLIC
      type: string
      enum:
        - PRIVATE
        - PUBLIC
        - GENERAL
        - BREAKOUT
    ChatMemberRoleType:
      description: Member role in a chat (member, admin, owner)
      example: CHAT_MEMBER
      type: string
      enum:
        - CHAT_MEMBER
        - CHAT_ADMIN
        - CHAT_OWNER
    ChatPermission:
      description: Member permissions in a chat
      example: RENAME_CHAT
      type: string
      enum:
        - CHANGE_ROLE
        - ARCHIVE_CHAT
        - RENAME_CHAT
        - UPDATE_CONFIG
        - KICK_FROM_CHAT
        - SEND_MESSAGES_TO_ANNOUNCE_CHANNEL
        - PIN_CHAT_MESSAGE
        - SCHEDULE_CONFERENCE
        - DELETE_CHAT_MESSAGE
        - UPDATE_PERMISSIONS
        - FORWARD_MESSAGES
    Member:
      description: Workspace member information
      type: object
      properties:
        memberId:
          type: string
        profile:
          $ref: "#/components/schemas/Profile"
        roleType:
          $ref: "#/components/schemas/MemberRoleType"
        presence:
          type: object
          properties:
            isOnline:
              type: boolean
            isOnCall:
              type: boolean
            lastSeenAt:
              type: string
              format: date-time
        status:
          $ref: "#/components/schemas/MemberStatus"
    Profile:
      description: Member profile information
      type: object
      properties:
        profileId:
          type: string
        primaryEmail:
          type: string
        fullName:
          type: string
        type:
          $ref: "#/components/schemas/AccountType"
        details:
          $ref: "#/components/schemas/AccountDetails"
    AccountDetails:
      description: Additional information about the user
      type: object
      properties:
        position:
          type: string
        department:
          type: string
        phoneNumber:
          type: string
        location:
          $ref: "#/components/schemas/AccountLocation"
    AccountLocation:
      description: Member status
      type: string
      enum:
        - LOCATION_NOT_SET
        - OFFICE
        - HOME
        - VACATION
    MemberRoleType:
      description: Workspace member role
      type: string
      enum:
        - MEMBER
        - ADMIN
        - OWNER
        - GUEST
        - GUEST_CALLER
    MemberStatus:
      description: Account status
      type: string
      enum:
        - PENDING
        - ACTIVE
        - SUSPENDED
    AccountType:
      description: Account type
      example: REGULAR
      type: string
      enum:
        - REGULAR
        - BOT
        - VOICE_BOT
        - INTEGRATION_BOT
        - GUEST_ACCOUNT
    Update:
      description: An event addressed to the bot
      type: object
      required:
        - updateId
      properties:
        updateId:
          type: integer
          format: int64
        newChatMessage:
          $ref: "#/components/schemas/NewChatMessage"
        inviteToChat:
          $ref: "#/components/schemas/InviteToChat"
        joinedToChat:
          $ref: "#/components/schemas/JoinedToChat"
        leftFromChat:
          $ref: "#/components/schemas/LeftFromChat"
    UpdateType:
      description: Update type
      example: MESSAGE
      type: string
      enum:
        - MESSAGE
        - CHAT_MEMBER
    WebhookInfo:
      type: object
      required:
        - url
        - hasCustomCertificate
      properties:
        url:
          type: string
        hasCustomCertificate:
          type: boolean
        pendingUpdateCount:
          type: integer
        lastErrorDate:
          type: string
          format: date-time
        lastErrorMessage:
          type: string
        updateTypes:
          type: array
          items:
            $ref: "#/components/schemas/UpdateType"
    WorkspaceChatMembership:
      description: Information about a chat and its members
      type: object
      properties:
        chat:
          $ref: "#/components/schemas/WorkspaceChat"
        role:
          $ref: "#/components/schemas/ChatMemberRoleType"
        permissions:
          type: array
          items:
            $ref: "#/components/schemas/ChatPermission"
    SendChatMessagePublicV1Request:
      description: Send a message
      example:
        workspaceId: w67Y89gu
        chatId: c56Y0kgi
        markdown: "**Colleagues**, when will the task be ready?"
      type: object
      required:
        - workspaceId
        - chatId
        - markdown
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        chatId:
          $ref: "#/components/schemas/ChatId"
        markdown:
          description: Message text
          type: string
        fileIds:
          description: IDs of files attached to the message
          example:
            - f56Y0kgi
            - f56Y0kgi
          type: array
          items:
            type: string
          nullable: true
        replyTo:
          $ref: "#/components/schemas/ChatMessageId"
    SendChatMessagePublicV1Response:
      type: object
      required:
        - messageId
      properties:
        messageId:
          $ref: "#/components/schemas/ChatMessageId"
    EditChatMessagePublicV1Request:
      description: Edit a message
      example:
        workspaceId: w67Y89gu
        chatId: c56Y0kgi
        chatMessageId: m56Y0kgi
        newMarkdown: Sorry, I was wrong, it wasn't like that
      type: object
      required:
        - workspaceId
        - chatId
        - chatMessageId
        - newMarkdown
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        chatMessageId:
          $ref: "#/components/schemas/ChatMessageId"
        chatId:
          $ref: "#/components/schemas/ChatId"
        newMarkdown:
          description: New message text
          type: string
    EditChatMessagePublicV1Response:
      type: object
      required:
        - updatedAt
      properties:
        updatedAt:
          type: string
          format: date-time
    DeleteChatMessagePublicV1Request:
      type: object
      required:
        - workspaceId
        - chatId
        - chatMessageId
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        chatId:
          $ref: "#/components/schemas/ChatId"
        chatMessageId:
          $ref: "#/components/schemas/ChatMessageId"
    DeleteChatMessagePublicV1Response:
      type: object
      required:
        - updatedAt
      properties:
        updatedAt:
          type: string
          format: date-time
    ForwardChatMessagePublicV1Request:
      description: Forward a message
      example:
        workspaceId: w67Y89gu
        sourceChatId: c56Y0kgi
        sourceChatMessageId: m56Y0kgi
        targetChatId: c56Y0kgi
        markdown: Look what was posted in another chat...
      type: object
      required:
        - workspaceId
        - sourceChatId
        - sourceChatMessageId
        - targetChatId
        - markdown
      properties:
        workspaceId:
          $ref: "#/components/schemas/WorkspaceId"
        sourceChatId:
          $ref: "#/components/schemas/ChatId"
        sourceChatMessageId:
          $ref: "#/components/schemas/ChatMessageId"
        targetChatId:
          $ref: "#/components/schemas/ChatId"
        markdown:
          description: Caption text for the forwarded message
          type: string
    ForwardChatMessagePublicV1Response:
      type: object
      required:
        - forwardedMessageId
      properties:
        messageId:
          $ref: "#/components/schemas/ChatMessageId"
    CreateWorkspaceChatPublicV1Request:
      description: Request to create a public/private chat within a workspace
      example:
        workspaceId: w67Y89gu
        participants:
          - a56Y0kgi
          - a56Y0kgi
        name: B2B Chat
        type: PRIVATE
        announceChannel: false
        description: For discussing B2B orders
      type: object
      required:
        - workspaceId
      properties:
        workspaceId:
          description: ID of the workspace in which the chat is created
          type: string
        participants:
          description: List of MembershipIds of chat members
          type: array
          items:
            type: string
        name:
          description: Chat name
          type: string
        type:
          $ref: "#/components/schemas/WorkspaceChatType"
        announceChannel:
          description: false - everyone can post, true - only admins
          type: boolean
        description:
          type: string
    CreateWorkspaceChatPublicV1Response:
      example:
        chatId: c56Y0kgi
      type: object
      properties:
        chatId:
          type: string
    CreatePersonalChatPublicV1Request:
      description: Request to create a personal chat
      example:
        workspaceId: w67Y89gu
        participant: a56Y0kgi
      type: object
      required:
        - workspaceId
        - participant
      properties:
        workspaceId:
          description: ID of the workspace in which the chat is created
          type: string
        participant:
          description: MembershipId of the chat member
          type: string
    CreatePersonalChatPublicV1Response:
      type: object
      properties:
        chatId:
          type: string
    CreateThreadChatPublicV1Request:
      description: Request to create a thread within a chat
      example:
        workspaceId: w67Y89gu
        chatId: c56Y0kgi
        parentMessageId: m56Y0kgi
      type: object
      required:
        - workspaceId
        - chatId
        - parentMessageId
      properties:
        workspaceId:
          description: Workspace ID
          type: string
        chatId:
          description: Chat ID
          type: string
        parentMessageId:
          description: ID of the message within which the thread is created
          type: string
    CreateThreadChatPublicV1Response:
      type: object
      properties:
        chatId:
          type: string
    ListWorkspaceChatsPublicV1Request:
      description: Request to get the list of chats within a workspace
      example:
        maxCount: 100
        workspaceId: w67Y89gu
      type: object
      properties:
        chatIds:
          description: IDs of the chats to get information about. If not specified, all chats in the workspace are returned
          type: array
          items:
            type: string
        maxCount:
          description: Maximum number of chats to return. Default is 100
          type: integer
        workspaceId:
          description: Workspace ID
          type: string
    ListWorkspaceChatsPublicV1Response:
      type: object
      properties:
        workspaceChats:
          type: array
          items:
            $ref: "#/components/schemas/WorkspaceChatMembership"
    InviteToChatPublicV1Request:
      description: Request to invite members to a chat
      example:
        chatId: c56Y0kgi
        workspaceId: w67Y89gu
        memberId:
          - a56Y0kgi
          - a77Y0kgi
      type: object
      required:
        - chatId
        - workspaceId
        - memberId
      properties:
        chatId:
          description: Chat ID
          type: string
        workspaceId:
          description: Workspace ID
          type: string
        memberId:
          description: IDs of the members to invite to the chat
          type: array
          items:
            type: string
    InviteToChatPublicV1Response:
      type: object
      properties:
        chat:
          $ref: "#/components/schemas/WorkspaceChat"
    KickFromChatPublicV1Request:
      description: Request to remove members from a chat
      example:
        chatId: c56Y0kgi
        workspaceId: w67Y89gu
        memberId:
          - a56Y0kgi
          - a77Y0kgi
      type: object
      required:
        - chatId
        - workspaceId
        - memberId
      properties:
        chatId:
          description: Chat ID
          type: string
        workspaceId:
          description: Workspace ID
          type: string
        memberId:
          description: IDs of the members to remove from the chat
          type: array
          items:
            type: string
    KickFromChatPublicV1Response:
      type: object
      properties:
        chat:
          $ref: "#/components/schemas/WorkspaceChat"
    MemberListPublicV1Request:
      description: Request to get the list of workspace members
      example:
        workspaceId: w67Y89gu
      type: object
      required:
        - workspaceId
      properties:
        workspaceId:
          description: Workspace ID
          type: string
    MemberListPublicV1Response:
      description: List of workspace members
      type: object
      properties:
        members:
          type: array
          items:
            $ref: "#/components/schemas/Member"
    MediaType:
      description: File type
      example: IMAGE
      type: string
      enum:
        - RAW
        - IMAGE
        - AUDIO
        - VIDEO
        - PDF
        - DOC
        - XLS
        - PPT
    GetFilePreSignedUrlPublicV1Request:
      description: Request to get a link for uploading a file
      example:
        fileName: file.txt
        mediaType: RAW
        workspaceId: w67Y89gu
        accessChatId: c56Y0kgi
      type: object
      required:
        - fileName
        - mediaType
        - workspaceId
      properties:
        fileName:
          type: string
          description: File name
        mediaType:
          $ref: "#/components/schemas/MediaType"
        workspaceId:
          type: string
          description: Workspace ID
        accessChatId:
          type: string
          nullable: true
          description: ID of the chat in which the file will be accessible
    GetFilePreSignedUrlPublicV1Response:
      description: Link for uploading a file and the file ID
      example:
        url: "https://yuchat-files-presigned.storage.net/d2f19302"
        fileId: f56Y0kgi
      type: object
      required:
        - url
        - fileId
      properties:
        url:
          type: string
          description: Link for uploading the file
        fileId:
          type: string
          description: File ID
    GetFileDownloadUrlPublicV1Request:
      description: Request to get a download link for a file
      example:
        fileId: c56Y0kgi
      type: object
      required:
        - fileId
      properties:
        fileId:
          type: string
          description: File ID
    GetFileDownloadUrlPublicV1Response:
      description: Link for downloading the file
      example:
        url: "https://yuchat-files-presigned.storage.net/d2f19302"
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: Link for downloading the file
    SetWebhookPublicV1Request:
      type: object
      required:
        - url
      properties:
        url:
          type: string
        certificate:
          type: string
          description: Full contents of the .pem certificate, Base64-encoded (including BEGIN/END CERTIFICATE). Set if a self-signed certificate is used for the webhook
        updateTypes:
          type: array
          items:
            $ref: "#/components/schemas/UpdateType"
        secretToken:
          description: If set, it will be included in the "X-YuChat-Bot-Api-Secret-Token" header
          type: string
    GetWebhookInfoPublicV1Response:
      type: object
      required:
        - webhookInfo
      properties:
        webhookInfo:
          $ref: "#/components/schemas/WebhookInfo"
  responses:
    UnauthorizedError:
      description: "Authorization error: token not provided or invalid"
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: "A token that can be obtained from aibot@yuchat.ai using the /botcreate command."
security:
  - bearerAuth: []
