MonCha
Skip to article

REST API reference

Search MonCha documentation

Search the full guides for topics such as renewal, ticket alerts, OAuth or knowledge refresh.

Requests, responses and scopes for the regular workspace /v1 API.

On this page

This reference describes the regular workspace API at https://api.dev-moncha.com/v1. Authenticate with a scoped workspace token. The separate Enterprise Vendor API has different credentials, authorization and capabilities.

Specification version: 1.0.1. Download this documentation release’s OpenAPI. Read the API deployment’s specification.

First request

curl "https://api.dev-moncha.com/v1/bots" \
  -H "Authorization: Bearer $MONCHA_API_TOKEN"

Use API tokens and scopes for setup and API errors and limits for recovery. Lists are bounded; do not send undocumented page or cursor parameters.

GET /bots

List bots. Requires scope `bots:read`.

Responses

200 Bot list

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 30
          },
          "slot_kind": {
            "type": "string",
            "enum": [
              "plan",
              "addon",
              "vendor"
            ]
          },
          "language": {
            "type": "string",
            "example": "en-IN"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

POST /bots

Create a bot. Requires scope `bots:write`. Bot-restricted tokens cannot create bots. Enterprise workspaces must supply `enterprise_plan_tier` and have an available slot in that tier.

Request body

{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 30
    },
    "language": {
      "type": "string",
      "example": "en-IN"
    },
    "enterprise_plan_tier": {
      "type": "string",
      "enum": [
        "starter",
        "growth",
        "scale"
      ],
      "description": "Required for enterprise workspaces"
    }
  }
}

Responses

201 Created bot

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "name",
        "language",
        "created_at"
      ]
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
409 Bot name is already used; inspect suggested_name.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

GET /kb

List knowledge-base documents. Requires scope `kb:read`. Filter with `?chatbotId=`.

ParameterLocationRequiredType / constraints
chatbotIdqueryNo{"type":"string","format":"uuid"}

Responses

200 Document list

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_type": {
            "type": "string",
            "enum": [
              "url",
              "file",
              "qa",
              "snippet"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "ready",
              "failed"
            ]
          },
          "chunk_count": {
            "type": "integer"
          },
          "chatbot_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

POST /kb/ingest

Add knowledge (URL or raw text). Requires scope `kb:write`. Queued for crawling/embedding; poll GET /kb for status.

Request body

{
  "type": "object",
  "required": [
    "title"
  ],
  "anyOf": [
    {
      "required": [
        "url"
      ]
    },
    {
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "minLength": 1
        }
      }
    }
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "text": {
      "type": "string",
      "maxLength": 200000
    },
    "chatbotId": {
      "type": "string",
      "format": "uuid"
    }
  }
}

Responses

202 Queued

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      }
    }
  }
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

POST /chat

Chat with a bot (streaming). Requires scope `chat:invoke`. Returns a Server-Sent Events stream of OpenAI-style chunks (`data: {"choices":[{"delta":{"content":"…"}}]}`). Counts toward your monthly message quota.

Request body

{
  "type": "object",
  "required": [
    "message"
  ],
  "properties": {
    "message": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
    },
    "chatbotId": {
      "type": "string",
      "format": "uuid"
    },
    "sessionId": {
      "type": "string",
      "maxLength": 120,
      "description": "Stable id groups turns into one conversation"
    },
    "language": {
      "type": "string",
      "example": "ja-JP",
      "description": "Reply language. Any supported code, e.g. en-IN, ja-JP, ko-KR, zh-CN, ms-MY, id-ID, th-TH, vi-VN, fil-PH, ar-AE, hi-IN, ta-IN, sw-KE, ha-NG, yo-NG. Omit to use the bot’s default; the bot still matches the language the user writes in."
    }
  }
}

Responses

200 SSE stream

text/event-stream

{
  "type": "string",
  "description": "SSE data frames containing JSON chunks; consume incrementally until the stream closes."
}
data: {"choices":[{"delta":{"content":"Hello"}}]}

400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

GET /conversations

List conversations. Requires scope `conversations:read`. Supports `?q=` search, `?limit=`, `?chatbotId=`. Default limit 50, maximum 200; no page or cursor parameter.

ParameterLocationRequiredType / constraints
qqueryNo{"type":"string","maxLength":200}
limitqueryNo{"type":"integer","minimum":1,"maximum":200,"default":50}
chatbotIdqueryNo{"type":"string","format":"uuid"}

Responses

200 Session list

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string"
          },
          "message_count": {
            "type": "integer"
          },
          "first_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_at": {
            "type": "string",
            "format": "date-time"
          },
          "preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

GET /conversations/{sessionId}

Get a conversation transcript. Requires scope `conversations:read`. Returns an array; a missing session can return an empty array. Restricted tokens may receive 403 for inaccessible sessions.

ParameterLocationRequiredType / constraints
sessionIdpathYes{"type":"string"}

Responses

200 Messages in the session

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "chatbot_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "session_id": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "content": {
            "type": "string"
          },
          "feedback": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "positive",
              "negative",
              null
            ]
          },
          "source_urls": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "channel": {
            "type": "string"
          },
          "provider_message_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

GET /leads

List leads. Requires scope `leads:read`. At most 500 intent-scored leads, newest first; no cursor pagination; optional `?chatbotId=`. Each lead has score/band, an AI summary, contact details, qualification, and `external_user_id` when the visitor was signed in (MonCha.identify).

ParameterLocationRequiredType / constraints
chatbotIdqueryNo{"type":"string","format":"uuid"}

Responses

200 Lead list

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "chatbot_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "session_id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "intent_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "intent_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": "integer"
          },
          "score_band": {
            "type": "string",
            "enum": [
              "hot",
              "warm",
              "cold"
            ]
          },
          "sentiment": {
            "type": [
              "string",
              "null"
            ]
          },
          "qualification": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "contacted",
              "qualified",
              "won",
              "lost"
            ]
          },
          "captured_via": {
            "type": "string",
            "enum": [
              "conversational",
              "form",
              "inferred"
            ]
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ]
          },
          "notified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "asked_contact_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

GET /analytics

Analytics summary (30 days). Requires scope `analytics:read`. Daily volumes, top questions, unanswered rate, feedback, sessions.

ParameterLocationRequiredType / constraints
chatbotIdqueryNo{"type":"string","format":"uuid"}

Responses

200 Analytics summary

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "daily": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date"
              },
              "user_messages": {
                "type": "integer"
              },
              "assistant_messages": {
                "type": "integer"
              }
            }
          }
        },
        "top_questions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "question": {
                "type": "string"
              },
              "times": {
                "type": "integer"
              }
            }
          }
        },
        "unanswered": {
          "type": "object",
          "properties": {
            "count": {
              "type": "integer"
            },
            "total": {
              "type": "integer"
            },
            "rate": {
              "type": "number",
              "description": "Percentage from 0 to 100, rounded to one decimal place."
            }
          }
        },
        "feedback": {
          "type": "object",
          "properties": {
            "positive": {
              "type": "integer"
            },
            "negative": {
              "type": "integer"
            }
          }
        },
        "sessions": {
          "type": "object",
          "properties": {
            "total": {
              "type": "integer"
            },
            "avg_messages": {
              "type": "number"
            }
          }
        }
      },
      "required": [
        "daily",
        "top_questions",
        "unanswered",
        "feedback",
        "sessions"
      ]
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

GET /bookings

List bookings. Requires scope `bookings:read`. Appointment requests newest first. Filter with `?status=pending|confirmed|rejected|cancelled`, `?chatbotId=`, `?limit=`.

ParameterLocationRequiredType / constraints
statusqueryNo{"type":"string","enum":["pending","confirmed","rejected","cancelled"]}
chatbotIdqueryNo{"type":"string","format":"uuid"}
limitqueryNo{"type":"integer","minimum":1,"maximum":200,"default":200}

Responses

200 Booking list

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "chatbot_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "requested_slot": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "time_zone": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_fields": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "rejected",
              "cancelled"
            ]
          },
          "rejection_comment": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "rejected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

GET /bookings/{id}

Get a booking. Requires scope `bookings:read`.

ParameterLocationRequiredType / constraints
idpathYes{"type":"string","format":"uuid"}

Responses

200 Booking

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "tenant_id": {
          "type": "string",
          "format": "uuid"
        },
        "chatbot_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "requested_slot": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "time_zone": {
          "type": [
            "string",
            "null"
          ]
        },
        "custom_fields": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "string"
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "confirmed",
            "rejected",
            "cancelled"
          ]
        },
        "rejection_comment": {
          "type": [
            "string",
            "null"
          ]
        },
        "confirmed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "rejected_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "cancelled_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

PATCH /bookings/{id}

Update a booking. Requires scope `bookings:write`. `action` is `confirm`, `reject`, `reschedule`, or `cancel`. Confirm/reject apply to pending requests. Reschedule and cancel apply to pending or confirmed bookings and email the visitor. Reschedule requires `requestedSlot`. Optional `cancelComment` / `rejectionComment` is included in the visitor email.

ParameterLocationRequiredType / constraints
idpathYes{"type":"string","format":"uuid"}

Request body

{
  "type": "object",
  "required": [
    "action"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "action": {
            "const": "reschedule"
          }
        }
      },
      "then": {
        "required": [
          "requestedSlot"
        ]
      }
    }
  ],
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "confirm",
        "reject",
        "reschedule",
        "cancel"
      ]
    },
    "requestedSlot": {
      "type": "string",
      "format": "date-time"
    },
    "rejectionComment": {
      "type": "string",
      "maxLength": 500
    },
    "cancelComment": {
      "type": "string",
      "maxLength": 500
    }
  }
}

Responses

200 Updated booking

application/json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "tenant_id": {
          "type": "string",
          "format": "uuid"
        },
        "chatbot_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "requested_slot": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "time_zone": {
          "type": [
            "string",
            "null"
          ]
        },
        "custom_fields": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "string"
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "confirmed",
            "rejected",
            "cancelled"
          ]
        },
        "rejection_comment": {
          "type": [
            "string",
            "null"
          ]
        },
        "confirmed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "rejected_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "cancelled_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  },
  "required": [
    "data"
  ]
}
400 Invalid input or operation requirements. Validation can return a structured error.

application/json

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retry_after": {
          "type": "integer"
        },
        "suggested_name": {
          "type": "string"
        },
        "available_slots": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured validation error; inspect its issues."
        }
      }
    }
  ]
}
401 Missing, invalid, expired or revoked API token.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
402 API/live service unavailable (api_locked), plan capacity or quota exhausted.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
403 Required scope or bot access is missing, or enterprise tier capacity is unavailable.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
404 Record or account not found in the accessible context.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
409 Slot taken, already decided or booking no longer active.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
429 Rate limit exceeded. Wait before retrying.

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "integer"
    },
    "suggested_name": {
      "type": "string"
    },
    "available_slots": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}
{
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying.",
      "schema": {
        "type": "integer"
      }
    }
  }
}

Related guides

Something unclear? Tell us.

Start free trial