> ## Documentation Index
> Fetch the complete documentation index at: https://www.krea.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop Bot Chat

> Stop the bots working in a chat, or one of them with `bot_id`, and their helpers. Open to a workspace that fell below the plan Bots needs, so running work can always be stopped.



## OpenAPI

````yaml https://api.krea.ai/openapi.json post /bots/chats/{chat_id}/stop
openapi: 3.1.0
info:
  title: Krea API
  version: v1
servers:
  - url: https://api.krea.ai
    description: Krea API
security:
  - bearerAuth: []
tags:
  - name: General
    description: Core API operations including job management and billing information
  - name: Krea
    description: Krea-owned generation models including Krea 2
  - name: Assets
    description: >-
      Asset management endpoints for uploading and managing images, videos,
      audio files, and 3D models
  - name: Styles
    description: Style (LoRA) generation and management endpoints
  - name: Node Apps
    description: Executing custom node apps built in our nodes tool
  - name: Image
    description: Image generation endpoints
  - name: Image Enhance
    description: Image enhance endpoints
  - name: Video
    description: Video generation endpoints
  - name: Video Enhance
    description: Video enhance and upscale endpoints
  - name: 3D
    description: 3D model generation endpoints
  - name: Audio
    description: Speech and audio generation endpoints
  - name: Usage
    description: Workspace usage reporting
  - name: Agent
    description: Krea Agent sessions
  - name: Bots
    description: 'Krea Bots: chats with the bots in a workspace'
  - name: Utilities
    description: Miscellaneous utility endpoints
paths:
  /bots/chats/{chat_id}/stop:
    post:
      tags:
        - Bots
      summary: Stop Bot Chat
      description: >-
        Stop the bots working in a chat, or one of them with `bot_id`, and their
        helpers. Open to a workspace that fell below the plan Bots needs, so
        running work can always be stopped.
      parameters:
        - in: path
          name: chat_id
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bot_id:
                  description: >-
                    Stop only this bot. Without it, every bot working in the
                    chat stops.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                cursor:
                  description: >-
                    The `cursor` of the previous response, so only what happened
                    since is returned. Without one, the read starts after your
                    own newest message.
                  type: string
                  minLength: 1
                  maxLength: 2000
              additionalProperties: false
      responses:
        '200':
          description: The state of the chat after stopping.
          content:
            application/json:
              schema:
                type: object
                properties:
                  chat_id:
                    type: string
                  title:
                    type: string
                  status:
                    type: string
                    enum:
                      - working
                      - needs_input
                      - done
                      - failed
                      - stopped
                    description: >-
                      `working` while a bot is mid-turn, `needs_input` when a
                      bot waits on `question`, then `done`, `failed` or
                      `stopped`.
                  finished:
                    type: boolean
                    description: True once status is done, failed or stopped.
                  bots:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        role:
                          type: string
                          description: What it does, in a few words.
                        description:
                          type: string
                        color:
                          type: string
                          description: Its body color as a hex string.
                        owner:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                          required:
                            - id
                            - name
                          additionalProperties: false
                        is_owner:
                          type: boolean
                        shared:
                          type: boolean
                          description: Shared with everyone in the workspace.
                        status:
                          type: string
                          enum:
                            - idle
                            - working
                      required:
                        - id
                        - name
                        - role
                        - description
                        - color
                        - owner
                        - is_owner
                        - shared
                        - status
                      additionalProperties: false
                  working:
                    type: array
                    items:
                      type: object
                      properties:
                        bot_id:
                          type: string
                        run_id:
                          type: string
                        started_at:
                          type: string
                        headline:
                          type: string
                        eta_minutes:
                          type: number
                      required:
                        - bot_id
                        - run_id
                      additionalProperties: false
                  progress:
                    type: array
                    items:
                      type: string
                    description: New steps of the working bots' turns.
                  messages:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: Its position in the chat. Later messages are higher.
                        created_at:
                          type: string
                        author:
                          type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - person
                                - bot
                                - system
                            id:
                              type: string
                            name:
                              type: string
                          required:
                            - kind
                          additionalProperties: false
                        via:
                          description: >-
                            Where a message not written in Krea came from, such
                            as `API`.
                          type: string
                        text:
                          type: string
                        attachments:
                          type: array
                          items:
                            type: object
                            properties:
                              url:
                                type: string
                                description: Absolute. Krea files come as a signed link.
                              uri:
                                type: string
                              name:
                                type: string
                              mime_type:
                                type: string
                              width:
                                type: number
                              height:
                                type: number
                            required:
                              - url
                            additionalProperties: false
                      required:
                        - id
                        - created_at
                        - author
                        - text
                        - attachments
                      additionalProperties: false
                    description: New visible messages since `cursor`, oldest first.
                  text:
                    type: string
                    description: The bots' new message text, joined.
                  media:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          description: Absolute. Krea files come as a signed link.
                        uri:
                          type: string
                        name:
                          type: string
                        mime_type:
                          type: string
                        width:
                          type: number
                        height:
                          type: number
                      required:
                        - url
                      additionalProperties: false
                    description: Images, video and audio the bots posted since `cursor`.
                  files:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          description: Absolute. Krea files come as a signed link.
                        uri:
                          type: string
                        name:
                          type: string
                        mime_type:
                          type: string
                        width:
                          type: number
                        height:
                          type: number
                      required:
                        - url
                      additionalProperties: false
                  question:
                    type: object
                    properties:
                      id:
                        type: string
                      bot_id:
                        type: string
                      kind:
                        type: string
                        enum:
                          - question
                          - approval
                          - permission
                          - cost_confirm
                          - file_upload
                          - image_select
                          - moodboard_select
                          - connect_integration
                      text:
                        type: string
                      options:
                        type: array
                        items:
                          type: string
                        description: Answers to offer. Empty for free text.
                      answerable:
                        type: boolean
                        description: >-
                          False for requests only the chat in Krea can answer.
                          Open the chat's `url`.
                    required:
                      - id
                      - bot_id
                      - kind
                      - text
                      - options
                      - answerable
                    additionalProperties: false
                  error:
                    description: >-
                      Present when status is failed. `out_of_compute`,
                      `bot_usage_limit` and `chat_usage_limit` are billing
                      holds, not faults.
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - out_of_compute
                          - bot_usage_limit
                          - chat_usage_limit
                          - refused
                          - busy
                          - timeout
                          - provider
                          - server
                          - context
                          - claude_billing
                          - unknown
                      message:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                  out_of_compute_bot_ids:
                    type: array
                    items:
                      type: string
                    description: >-
                      Bots held in this chat because the workspace ran out of
                      compute units. Add units, then call `retry` or send a
                      message.
                  timed_out:
                    type: boolean
                    description: >-
                      True when `wait` ran out while a bot was still working, or
                      more is unread than one response carries. Read again with
                      `cursor`.
                  cursor:
                    type: string
                  url:
                    type: string
                required:
                  - chat_id
                  - title
                  - status
                  - finished
                  - bots
                  - working
                  - progress
                  - messages
                  - text
                  - media
                  - files
                  - out_of_compute_bot_ids
                  - timed_out
                  - cursor
                  - url
                additionalProperties: false
        '400':
          description: Invalid JSON body, or a request the chat refuses.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: >-
            Bots is not included in the workspace plan, not open to this
            account, or the caller may not make this change to the chat.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Bot, chat, question or attachment not found or not accessible.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: The chat changed under the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '422':
          description: Invalid input.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  required_plan:
                    type: string
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      bearerFormat: Bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.