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

# Create or Continue Conversation



## OpenAPI

````yaml POST /conversations
openapi: 3.1.0
info:
  title: HeyPal API
  version: '1.0'
  description: >-
    The HeyPal API makes it easy to add A.I. powered semantic-search & other
    A.I. functionality to your product & content.
servers:
  - url: https://api.pal.ai/v1
security:
  - API Key: []
paths:
  /conversations:
    post:
      summary: Create or Continue Conversation
      operationId: post-conversations
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                applicationId:
                  type: string
                  x-stoplight:
                    id: k09jn8mzdeo5s
                parentMessageId:
                  type:
                    - string
                    - 'null'
                  x-stoplight:
                    id: ggbwaa2f8zjqu
                conversationId:
                  type:
                    - string
                    - 'null'
                  x-stoplight:
                    id: 5qt3dwvunzl83
                isStreaming:
                  type: boolean
                  x-stoplight:
                    id: jzje08yjwc9wm
                messageContent:
                  type: string
                  x-stoplight:
                    id: oug4h0yyi0fuf
                contact:
                  type: object
                  x-stoplight:
                    id: cy0574ui3sze0
                  description: At least one of externalId or email must be provided.
                  properties:
                    name:
                      type: string
                      x-stoplight:
                        id: w1e0a7fqd0cmz
                      description: Optional.
                    externalId:
                      type: string
                      x-stoplight:
                        id: 6xjd6gks6xzp2
                    email:
                      type: string
                      x-stoplight:
                        id: 03ffe7vfsy85n
                organization:
                  type: object
                  x-stoplight:
                    id: ufc2fpi2tc5rf
                  properties:
                    externalId:
                      type: string
                      x-stoplight:
                        id: o76xzzu8of74d
                    name:
                      type: string
                      x-stoplight:
                        id: ycww5dyoyvyav
                      description: |
                        Optional.
                  required:
                    - externalId
                metadata:
                  type: object
                  x-stoplight:
                    id: is38sm7xbhqz6
                  description: >-
                    Any key-value pair is allowed.


                    Some keys are recognized by Pal and displayed separately in
                    the UI.

                    For now, the only recognized key is `sourceUrl`, which Pal
                    expects to be a URL string.
          application/xml:
            schema:
              type: object
              properties: {}
          multipart/form-data:
            schema:
              type: object
              properties:
                conversationId:
                  type:
                    - string
                    - 'null'
                  x-stoplight:
                    id: xumsumvng6by6
                parentMessageId:
                  x-stoplight:
                    id: 5s7k3m2cxm343
                  type:
                    - string
                    - 'null'
                applicationId:
                  type: string
                  x-stoplight:
                    id: c374rze2fpuxe
                isStreaming:
                  type: string
                  x-stoplight:
                    id: hn3rhdszv92tp
                messageContent:
                  type: string
                  x-stoplight:
                    id: 6aca4yumen9yh
        description: >-
          If you're sending in the first message of a conversation, you should
          send in a null conversationId and a null parentMessageId. This first
          call will generate a new conversation, and you will receive an id for
          the conversation in the response body.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  conversationId:
                    type: string
                    x-stoplight:
                      id: 8mk8adbqp34ct
                  messages:
                    type: array
                    x-stoplight:
                      id: fxv9twjlf2893
                    items:
                      $ref: '#/components/schemas/ConversationMessage'
                      x-stoplight:
                        id: jq28l9s4e6u18
                  contact:
                    type: object
                    x-stoplight:
                      id: nj8egw5mr5uci
                    properties:
                      id:
                        type: string
                        x-stoplight:
                          id: 3imwbtc71eajr
                      externalId:
                        type:
                          - string
                          - 'null'
                        x-stoplight:
                          id: wcuig73ao5ass
                      email:
                        type:
                          - string
                          - 'null'
                        x-stoplight:
                          id: qtfloczssckup
                      name:
                        type:
                          - string
                          - 'null'
                        x-stoplight:
                          id: 8533l08jkwpfj
                      organization:
                        type:
                          - object
                          - 'null'
                        x-stoplight:
                          id: h9qvq4ejzluea
                        properties:
                          id:
                            type: string
                            x-stoplight:
                              id: r6rpvf8brkzko
                          name:
                            type:
                              - string
                              - 'null'
                            x-stoplight:
                              id: lrt4dbdjm1aur
                        required:
                          - id
                    required:
                      - id
components:
  schemas:
    ConversationMessage:
      title: ConversationMessage
      x-stoplight:
        id: l2qqhd6oifjdu
      type: object
      properties:
        id:
          type: string
        content:
          type: string
          x-stoplight:
            id: 0325wkuxemfth
        role:
          type: string
          x-stoplight:
            id: euesva5i3tl80
          enum:
            - user
            - system
            - assistant
        type:
          type: string
          x-stoplight:
            id: bw5mg5q3el291
        parentMessageId:
          type:
            - string
            - 'null'
          x-stoplight:
            id: z00179zainrrd
        searchResultSet:
          $ref: '#/components/schemas/SearchResults'
          x-stoplight:
            id: 3wpyew8z68z1h
        createdAt:
          type: string
          x-stoplight:
            id: 05mk48gpinyjc
        updatedAt:
          type: string
          x-stoplight:
            id: sov24wo1hayg8
        deletedAt:
          type:
            - string
            - 'null'
          x-stoplight:
            id: s0o6yevj5brge
        conversationId:
          type: string
          x-stoplight:
            id: 73fbvgg6mhsid
        feedback:
          $ref: '#/components/schemas/MessageFeedback'
          x-stoplight:
            id: tzhy6jped1zuj
        '':
          type: string
          x-stoplight:
            id: 4d3ehxm7xkhho
    SearchResults:
      title: SearchResults
      x-stoplight:
        id: 8ru9mlevhbb5a
      type: object
      properties:
        documents:
          x-stoplight:
            id: a6hm8esk8vbu6
          type: array
          items:
            $ref: '#/components/schemas/SearchResultDocument'
            x-stoplight:
              id: q7awucxjehpxc
        sections:
          x-stoplight:
            id: djy5szi7gar58
          type: array
          items:
            $ref: '#/components/schemas/SearchResultSection'
            x-stoplight:
              id: 8epjxbwwli6c0
    MessageFeedback:
      title: MessageFeedback
      x-stoplight:
        id: 2gbm38i8m4l54
      type: object
      enum:
        - thumbsUp
        - thumbsDown
      properties:
        rating:
          type: string
          x-stoplight:
            id: 0jwprr47l1ni0
          enum:
            - thumbsUp
            - thumbsDown
        content:
          type: object
          x-stoplight:
            id: setrdq09uj9s9
          properties:
            text:
              type: string
              x-stoplight:
                id: gbsjuy09ewr0y
              description: Textual feedback. May be empty.
          required:
            - text
      required:
        - rating
      x-internal: false
    SearchResultDocument:
      title: SearchResultDocument
      x-stoplight:
        id: tedvaboygvsz3
      type: object
      properties:
        id:
          type: string
        title:
          type: string
          x-stoplight:
            id: szfb41o346s8j
        url:
          type: string
          x-stoplight:
            id: twz4ofljy43vm
        contentPreview:
          type: string
          x-stoplight:
            id: smvofz5kercly
      required:
        - id
        - title
        - contentPreview
    SearchResultSection:
      title: SearchResultSection
      x-stoplight:
        id: 40kaw83usyn3x
      type: object
      properties:
        id:
          type: string
        applicationId:
          type: string
          x-stoplight:
            id: 1hf86daam0v0v
        heading:
          type: string
          x-stoplight:
            id: yocswro10mueg
        text:
          type: string
          x-stoplight:
            id: k0xka7fthms8p
        documentId:
          type: string
          x-stoplight:
            id: libpxrvo8dr98
        indexOrder:
          type: string
          x-stoplight:
            id: unc8se3x8631p
        indexId:
          type: string
          x-stoplight:
            id: nmb2ghiaab592
        indexName:
          type: string
          x-stoplight:
            id: 7ut3j1bx5d29i
        indexInfo:
          type: string
          x-stoplight:
            id: s3mpr2hvaopm3
        deletedAt:
          type: string
          x-stoplight:
            id: amaxct5n3t92s
        updatedAt:
          type: string
          x-stoplight:
            id: bbef3z6fhqekq
        createdAt:
          type: string
          x-stoplight:
            id: rc91811wlffd7

````