Skip to main content
POST
/
conversations
Create or Continue Conversation
curl --request POST \
  --url https://api.pal.ai/v1/conversations \
  --header 'Content-Type: application/json' \
  --data '
{
  "applicationId": "<string>",
  "parentMessageId": "<string>",
  "conversationId": "<string>",
  "isStreaming": true,
  "messageContent": "<string>",
  "contact": {
    "name": "<string>",
    "externalId": "<string>",
    "email": "<string>"
  },
  "organization": {
    "externalId": "<string>",
    "name": "<string>"
  },
  "metadata": {}
}
'
{
  "conversationId": "<string>",
  "messages": [
    {
      "id": "<string>",
      "content": "<string>",
      "role": "user",
      "type": "<string>",
      "parentMessageId": "<string>",
      "searchResultSet": {
        "documents": [
          {
            "id": "<string>",
            "title": "<string>",
            "contentPreview": "<string>",
            "url": "<string>"
          }
        ],
        "sections": [
          {
            "id": "<string>",
            "applicationId": "<string>",
            "heading": "<string>",
            "text": "<string>",
            "documentId": "<string>",
            "indexOrder": "<string>",
            "indexId": "<string>",
            "indexName": "<string>",
            "indexInfo": "<string>",
            "deletedAt": "<string>",
            "updatedAt": "<string>",
            "createdAt": "<string>"
          }
        ]
      },
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "deletedAt": "<string>",
      "conversationId": "<string>",
      "feedback": "thumbsUp",
      "": "<string>"
    }
  ],
  "contact": {
    "id": "<string>",
    "externalId": "<string>",
    "email": "<string>",
    "name": "<string>",
    "organization": {
      "id": "<string>",
      "name": "<string>"
    }
  }
}

Body

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.

applicationId
string
parentMessageId
string | null
conversationId
string | null
isStreaming
boolean
messageContent
string
contact
object

At least one of externalId or email must be provided.

organization
object
metadata
object

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.

Response

200 - application/json

OK

conversationId
string
messages
ConversationMessage · object[]
contact
object