botruntime
API ReferenceChat API

Get Or Create Conversation

Retrieves the [Conversation](#schema_conversation) object containing given tags. If the conversation does not exist, it will be created. Tags will be updated if they are set in the request body.

POST
/v1/chat/conversations/get-or-create

Header Parameters

x-bot-id*string

Bot id

x-integration-id?string

Integration id

x-integration-alias?string

Integration alias

Request Body

application/json

Conversation data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/chat/conversations/get-or-create" \  -H "x-bot-id: string" \  -H "Content-Type: application/json" \  -d '{    "channel": "string",    "tags": {      "property1": "string",      "property2": "string"    }  }'
{  "conversation": {    "id": "stringstringstringstringstri",    "currentTaskId": "stringstringstringstringstri",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "channel": "string",    "integration": "string",    "tags": {      "property1": "string",      "property2": "string"    },    "messageCount": 0,    "properties": {      "property1": "string",      "property2": "string"    }  },  "meta": {    "created": true  }}
{  "conversation": {    "id": "stringstringstringstringstri",    "currentTaskId": "stringstringstringstringstri",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "channel": "string",    "integration": "string",    "tags": {      "property1": "string",      "property2": "string"    },    "messageCount": 0,    "properties": {      "property1": "string",      "property2": "string"    }  },  "meta": {    "created": true  }}