KODA.AI API (1.2.3)

Download OpenAPI specification:Download

Authentication

OAuth

Security Scheme Type OAuth2
clientCredentials OAuth Flow
Token URL: https://api.eu-pl.koda.ai/oauth/token
Scopes:
  • inbox:read -

    get available conversations

  • inbox:modify -

    enable/disable moderator mode and send block/attachment/reply

  • knowledge_base:read -

    search and retrieve knowledge base documents

  • knowledge_base:modify -

    create, update, and delete knowledge base documents

Inbox API

List of chats

Returns a list of chats

Authorizations:
OAuth (inbox:read)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
query Parameters
page
number
Default: 1
Example: page=3
on_page
number
Default: 20
Example: on_page=3
header Parameters
Authorization
required
string <bearer>
Example: Bearer <Access Token>

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": [
    ]
}

Get single chat

Get single chat

Authorizations:
OAuth (inbox:read)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
platformUserId
required
string
query Parameters
page
number
Default: 1
Example: page=3
on_page
number
Default: 20
Example: on_page=3
from
number <timestamp>
to
number <timestamp>
header Parameters
Authorization
required
string <bearer>
Example: Bearer <Access Token>

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": [
    ]
}

Enable moderator mode

Enable moderator mode

Authorizations:
OAuth (inbox:readinbox:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
platformUserId
required
string

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": true
}

Sent moderator message

Sent moderator message

Authorizations:
OAuth (inbox:readinbox:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
platformUserId
required
string
Request Body schema: application/json
moderator_message
required
string <= 1000 characters

Responses

Request samples

Content type
application/json
{
  • "moderator_message": "string"
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": true
}

Disable moderator mode (mark done)

Disable moderator mode (mark done)

Authorizations:
OAuth (inbox:readinbox:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
platformUserId
required
string
Request Body schema: application/json
quiet
boolean

Don`t send the block configured in the chatbot`s settings (dashboard)

message
string <= 1000 characters

Overwrite message set in the dashboard. A Message will be sent to the user

Responses

Request samples

Content type
application/json
{
  • "quiet": false,
  • "message": "From now on, you talk to the chatbot"
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": true
}

Send file attachment

Send file attachment

Authorizations:
OAuth (inbox:readinbox:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
platformUserId
required
string
Request Body schema: multipart/form-data
audio
string <binary>
image
string <binary>
file
string <binary>
video
string <binary>

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": true
}

Send block

Send a content block as a bot response to a user, with optionally update user variables

Authorizations:
OAuth (inbox:readinbox:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
platformUserId
required
string
Request Body schema: application/json
block_id
required
string

Block id

object

Optional user variables

Responses

Request samples

Content type
application/json
{
  • "block_id": "f60ea240-4cda-d1f9-032f-05eba5794058",
  • "user_variables": {
    }
}

Response samples

Content type
application/json
{ }

Knowledge Base API

API to manage knowledge base documents for generative AI capabilities.

Search knowledge base documents

Search for relevant documents in the knowledge base

Authorizations:
OAuth (knowledge_base:read)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
header Parameters
Authorization
required
string <bearer>
Example: Bearer <Access Token>
Request Body schema: application/json
search
string

Search query text

object

Responses

Request samples

Content type
application/json
{
  • "search": "password reset",
  • "metadata_filter": {
    }
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": [
    ]
}

Create knowledge base document

Create a new document in the knowledge base

Authorizations:
OAuth (knowledge_base:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
header Parameters
Authorization
required
string <bearer>
Example: Bearer <Access Token>
Request Body schema: application/json
title
required
string <= 120 characters
content
required
string
object
auto_publish
boolean
Default: false

Automatically publish new version with changes. Otherwise, it will added to draft and user new approve changes in the dashboard.

chunk_size
integer [ 100 .. 1000 ]

Chunk size for splitting the document into smaller parts. This is useful for large documents to improve searchability.

Responses

Request samples

Content type
application/json
{
  • "title": "Product Documentation",
  • "content": "This is the content of the knowledge base document.",
  • "metadata": {
    },
  • "auto_publish": true,
  • "chunk_size": 500
}

Response samples

Content type
application/json
{
  • "doc_id": "3337eb37-9c70-4e88-a173-21372501d7ee",
  • "title": "Product Documentation",
  • "content": "This is the content of the knowledge base document.",
  • "meta": {
    },
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Get knowledge base document

Retrieve a specific document from the knowledge base

Authorizations:
OAuth (knowledge_base:read)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
doc_id
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
header Parameters
Authorization
required
string <bearer>
Example: Bearer <Access Token>

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": {
    }
}

Update knowledge base document

Update an existing document in the knowledge base

Authorizations:
OAuth (knowledge_base:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
doc_id
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
header Parameters
Authorization
required
string <bearer>
Example: Bearer <Access Token>
Request Body schema: application/json
title
required
string <= 120 characters
content
required
string
object
auto_publish
boolean
Default: false

Automatically publish new version with changes. Otherwise, it will added to draft and user new approve changes in the dashboard.

chunk_size
integer [ 100 .. 1000 ]

Chunk size for splitting the document into smaller parts. This is useful for large documents to improve searchability.

Responses

Request samples

Content type
application/json
{
  • "title": "Product Documentation",
  • "content": "This is the content of the knowledge base document.",
  • "metadata": {
    },
  • "auto_publish": true,
  • "chunk_size": 500
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": {
    }
}

Delete knowledge base document

Remove a document from the knowledge base

Authorizations:
OAuth (knowledge_base:modify)
path Parameters
botId
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
doc_id
required
string <uuid>
Example: 3337eb37-9c70-4e88-a173-21372501d7ee
header Parameters
Authorization
required
string <bearer>
Example: Bearer <Access Token>

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "response": {
    }
}