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

# Create a conversation



## OpenAPI

````yaml https://dev.flextell.ai/docs/api.json post /v1/conversations
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: '## Flextell API'
servers:
  - url: https://dev.flextell.ai/api
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/conversations:
    post:
      tags:
        - Conversation
      summary: Create a conversation
      operationId: conversation.store
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversationStoreRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/ConversationResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        const: Channel not found
                    required:
                      - message
                required:
                  - success
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ConversationStoreRequest:
      type: object
      properties:
        channel_id:
          type: integer
          description: The channel ID.
          minimum: 1
        address:
          type: string
          description: The street address.
          maxLength: 255
        first_name:
          type:
            - string
            - 'null'
          description: The first name.
          maxLength: 255
        last_name:
          type:
            - string
            - 'null'
          description: The last name.
          maxLength: 255
      required:
        - channel_id
        - address
      title: ConversationStoreRequest
    ConversationResource:
      type: object
      properties:
        id:
          type: integer
        display_name:
          type: string
        address:
          type: string
        customer:
          type: object
          properties:
            id:
              type: integer
            first_name:
              type:
                - string
                - 'null'
            last_name:
              type:
                - string
                - 'null'
            phone_number:
              type:
                - string
                - 'null'
            avatar_url:
              type:
                - string
                - 'null'
          required:
            - id
            - first_name
            - last_name
            - phone_number
            - avatar_url
        channel:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            type:
              type: string
            address:
              type: string
          required:
            - id
            - name
            - type
            - address
        last_message_id:
          type: string
        last_message:
          type:
            - string
            - 'null'
        last_message_at:
          type: string
        last_message_type:
          type: string
        last_message_is_customer:
          type:
            - boolean
            - 'null'
        unread_count:
          anyOf:
            - type: string
            - type: integer
              enum:
                - 0
        agent_disabled:
          type: boolean
        agent_expires_at:
          type:
            - string
            - 'null'
          format: date-time
        agent_disabled_by_user_name:
          type:
            - string
            - 'null'
        blacklist:
          anyOf:
            - $ref: '#/components/schemas/ChannelBlacklistResource'
            - type: 'null'
      required:
        - id
        - display_name
        - address
        - last_message_id
        - last_message
        - last_message_at
        - last_message_type
        - last_message_is_customer
        - unread_count
        - agent_disabled
        - agent_expires_at
        - agent_disabled_by_user_name
      title: ConversationResource
    ChannelBlacklistResource:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type: integer
        reason:
          type: string
        reason_label:
          type: string
        note:
          type:
            - string
            - 'null'
        blocked_at:
          type: string
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        is_active:
          type: boolean
        is_permanent:
          type: boolean
        is_expired:
          type: boolean
        remaining_time:
          type: string
        metadata:
          type:
            - array
            - 'null'
          items: {}
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
        channel:
          $ref: '#/components/schemas/RelatedChannelResource'
        customer:
          $ref: '#/components/schemas/RelatedCustomerResource'
      required:
        - id
        - tenant_id
        - reason
        - reason_label
        - note
        - blocked_at
        - expires_at
        - is_active
        - is_permanent
        - is_expired
        - remaining_time
        - metadata
        - created_at
        - updated_at
        - deleted_at
      title: ChannelBlacklistResource
    RelatedChannelResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          $ref: '#/components/schemas/ChannelType'
        address:
          type: string
      required:
        - id
        - name
        - type
        - address
      title: RelatedChannelResource
    RelatedCustomerResource:
      type: object
      properties:
        id:
          type: integer
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        phone_number:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
      required:
        - id
        - first_name
        - last_name
        - phone_number
        - email
      title: RelatedCustomerResource
    ChannelType:
      type: string
      enum:
        - whatsapp
        - instagram
        - website
        - telegram
      title: ChannelType
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````