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

# Edit chatbots



## OpenAPI

````yaml POST /purchases/{orderId}/edit-chatbot
openapi: 3.0.0
info:
  title: StreamSkill - OpenApi 3.0
  description: ''
  termsOfService: https://streamskill.pro/en/privacy_policy
  version: 1.0.0
  contact:
    email: streamskillpro@gmail.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.streamskill.pro/v1
    description: Production server - v1
security:
  - bearerAuth: []
paths:
  /purchases/{orderId}/edit-chatbot:
    parameters:
      - $ref: '#/components/parameters/orderId'
      - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Edit Chatbot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditChatbotObject'
      responses:
        '200':
          $ref: '#/components/responses/ActionSuccess'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/NotAllowed'
        '409':
          $ref: '#/components/responses/PurchaseDone'
        '422':
          $ref: '#/components/responses/validationError'
        '500':
          $ref: '#/components/responses/ApiError'
components:
  parameters:
    orderId:
      name: orderId
      in: path
      required: true
      description: The ID of the order
      schema:
        type: integer
    Accept-Language:
      name: Accept-Language
      in: header
      required: false
      description: The language of the response
      schema:
        $ref: '#/components/schemas/LanguageObject'
  schemas:
    EditChatbotObject:
      type: object
      properties:
        interval:
          type: integer
          description: The interval of the chatbot
          example: 10
          minimum: 1
        mode:
          type: integer
          enum:
            - 0
            - 1
          description: The mode of the chatbot (0 - random, 1 - sequential)
          example: 1
        phrases:
          type: array
          description: The phrases of the chatbot
          items:
            type: string
          example:
            - test1
            - test2
    LanguageObject:
      type: string
      enum:
        - en
        - ru
      default: en
    ErrorObject:
      type: object
      required:
        - error_code
        - name
        - message
        - code
        - status
        - type
      properties:
        error_code:
          type: string
          description: Error identifier for handling the response in your application.
        name:
          type: string
          description: Localized error message; equal to message.
        message:
          type: string
          description: Localized explanation of the error.
        code:
          type: integer
          description: Error code, usually 0.
        status:
          type: integer
          description: HTTP status code.
        type:
          type: string
          description: Error type.
    ValidationErrorObject:
      allOf:
        - $ref: '#/components/schemas/ErrorObject'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: object
              description: >-
                Validation messages grouped by field name. Nested fields may use
                dot notation, such as ids.0.
              additionalProperties:
                type: array
                items:
                  type: string
  responses:
    ActionSuccess:
      description: Action Success
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: ok
                description: The status of the action
    Unauthorized:
      description: A valid API key is required.
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorObject'
          example:
            error_code: unauthorized
            name: Your request was made with invalid credentials.
            message: Your request was made with invalid credentials.
            code: 0
            status: 401
            type: unauthorized_http_exception
    NotFound:
      description: The requested resource was not found or is not accessible.
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorObject'
          example:
            error_code: not_found
            name: Record not found.
            message: Record not found.
            code: 0
            status: 404
            type: record_not_found_exception
    NotAllowed:
      description: This action is unavailable for the order.
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorObject'
          example:
            error_code: not_supported
            name: Action is not available for this order
            message: Action is not available for this order
            code: 0
            status: 405
            type: action_unavailable
    PurchaseDone:
      description: The order is already completed.
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorObject'
          example:
            error_code: already_done
            name: Order already completed
            message: Order already completed
            code: 0
            status: 409
            type: purchase_done
    validationError:
      description: Validation Error
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorObject'
          example:
            error_code: validation_error
            name: The Channel field is required.
            message: The Channel field is required.
            code: 0
            status: 422
            type: validate_exception
            errors:
              channel:
                - The Channel field is required.
    ApiError:
      description: An unexpected error occurred.
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorObject'
          example:
            error_code: server_error
            name: An unexpected error occurred.
            message: An unexpected error occurred.
            code: 0
            status: 500
            type: action_failed
  headers:
    Date:
      schema:
        type: string
        example: Sat, 25 May 2024 23:59:59 GMT
    Server:
      schema:
        type: string
        example: Apache/2.4.38 (Debian)
    Content-Length:
      schema:
        type: integer
        example: '100'
    Keep-Alive:
      schema:
        type: string
        example: timeout=5, max=100
    Connection:
      schema:
        type: string
        example: Keep-Alive
    Content-Type:
      schema:
        type: string
      example: application/json; charset=UTF-8
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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