> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/tech/en/api-integration.md).

# API Integration

- [Quick Start](https://docs.maiagent.ai/tech/en/api-integration/quickstart.md)
- [AI Assistant List](https://docs.maiagent.ai/tech/en/api-integration/qu-de-ji-qi-ren-lie-biao-bing-dui-hua.md)
- [Conversations and Message Replies (Streaming/Synchronous)](https://docs.maiagent.ai/tech/en/api-integration/dui-hua-yu-xun-xi-hui-fu-chuan-liu-tong-bu.md): Conversations and Synchronization
- [Create Conversations and Messages](https://docs.maiagent.ai/tech/en/api-integration/dui-hua-yu-xun-xi.md)
- [Webhook](https://docs.maiagent.ai/tech/en/api-integration/webhook.md): Conversation platform Webhooks: Push visitor messages and AI/human agent replies to your system in real time, with support for the MaiAgent standard format, Genesys Cloud, and custom Jinja2 templates
- [Third-Party Customer Service System Integration (Including Human Handoff)](https://docs.maiagent.ai/tech/en/api-integration/customer-service-system-integration.md): End-to-end spec for connecting a customer service system or chat platform to MaiAgent as the AI engine via API — message in/out, handoff to your human agents when the AI decides it's needed, and retur
- [Presigned File Upload Mode](https://docs.maiagent.ai/tech/en/api-integration/api_knowledge.md): Upload Files via File Integration
- [Using the Knowledge Base—Creation and Interaction](https://docs.maiagent.ai/tech/en/api-integration/shi-yong-zhi-shi-ku-jian-li-yu-hu-dong.md): This guide explains how to use the public REST API to manage knowledge base files, along with integration examples.
- [Web Chat Embedding and SDK](https://docs.maiagent.ai/tech/en/api-integration/web-chat-sdk.md): Embed MaiAgent Web Chat into any website: embed code, window modes, user identification, full configuration reference, and the JavaScript SDK API
- [MaiGPT Mode Embedding](https://docs.maiagent.ai/tech/en/api-integration/web-chat-sdk/web-chat-maigpt-mode.md): Embed a full ChatGPT-like MaiGPT conversation interface into your website or product, supporting both designated container and floating fullscreen layouts
- [Injecting Page Context](https://docs.maiagent.ai/tech/en/api-integration/web-chat-sdk/web-chat-context-data.md): Inject page context (such as product IDs, ticket numbers, or user identifiers) into the AI assistant's LLM System Prompt via the embed SDK's auth.contextData
- [API Tool Engineering Guide](https://docs.maiagent.ai/tech/en/api-integration/api-tool-engineering-guide.md): Wire your REST API to the MaiAgent AI assistant as a tool - how requests are assembled, how auth is passed, timeouts and retries, how errors are returned to the model, and how to inspect logs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/tech/en/api-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
