> For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.ereemby.com/llms.txt. For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mcp.ereemby.com/mcp. # Bots ## API Docs - [Listar bots](https://docs.ereemby.com/developers/api-v2/chats-and-bots/bots/list-bots.md): Bots - [Criar um bot](https://docs.ereemby.com/developers/api-v2/chats-and-bots/bots/create-bot.md): Bots - [Ver um bot](https://docs.ereemby.com/developers/api-v2/chats-and-bots/bots/get-bot.md): Bots - [Excluir um bot](https://docs.ereemby.com/developers/api-v2/chats-and-bots/bots/delete-bot.md): Bots - [Atualizar um bot](https://docs.ereemby.com/developers/api-v2/chats-and-bots/bots/update-bot.md): Bots ## OpenAPI Specification - [OpenAPI JSON](https://docs.ereemby.com/openapi.json): raw OpenAPI 3.1 specification for this API, JSON format - [OpenAPI YAML](https://docs.ereemby.com/openapi.yaml): raw OpenAPI 3.1 specification for this API, YAML format > **Note:** This page contains both a page directory (above) and the landing page content (below). The page directory is generated for agent use and does not appear on the landing page. > For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.ereemby.com/llms.txt. For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mcp.ereemby.com/mcp. # Gerenciar bots Um bot é o nome e o ícone que o comprador vê como autor de uma mensagem enviada pela API. Crie um bot e passe o id dele em `bot_id` ao [enviar uma mensagem](/developers/api-v2/chats-and-bots/chats-and-messages#responda-o-comprador-pelo-bot). Você pode criar um bot para cada tipo de mensagem, como um para avisos de pedido e outro para tutoriais. A loja pode ter quantos bots precisar. Para ler bots, a chave precisa do escopo `bots:read`. Para criar, editar e apagar, de `bots:write`. ```json { "object": "bot", "id": "bot_4b1e9c1a-7a2f-4d1e-9c55-2f6b8a3d7e10", "name": "Example bot", "icon": "https://example.com/images/bot-icon.png", "created_at": "2026-11-06T14:10:00.000Z", "updated_at": "2026-11-06T14:10:00.000Z" } ``` ## Crie um bot Envie `POST /bots` com o `name` (de 1 a 100 caracteres) e, se quiser, o `icon`. O ícone pode ser uma URL de imagem, um emoji ou um texto curto, com até 255 caracteres. * A API tira os espaços das pontas do nome. Um nome só com espaços é recusado. * Para ficar sem ícone, omita o `icon` ou envie `null`. Texto vazio é recusado. **`Criar um bot`** ```bash title="Criar um bot" curl -X POST "https://api.ereemby.app/api/v2/bots" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: example-bot-001" \ -d '{ "name": "Example bot", "icon": "https://example.com/images/bot-icon.png" }' ``` A resposta é `201`, com o bot no corpo e o caminho dele no header `Location`. Os detalhes estão em [Criar um bot](/developers/api-v2/chats-and-bots/bots/create-bot). ## Liste os bots `GET /bots` devolve `items` e `next_cursor`, com os bots mais novos primeiro. Para ver um só, use `GET /bots/{id}`. Veja [Listar bots](/developers/api-v2/chats-and-bots/bots/list-bots) e [Ver um bot](/developers/api-v2/chats-and-bots/bots/get-bot). **`Listar bots`** ```bash title="Listar bots" curl "https://api.ereemby.app/api/v2/bots?page_size=50" \ -H "x-api-key: YOUR_API_KEY" ``` ## Renomeie um bot ou troque o ícone Envie `PATCH /bots/{id}` só com os campos que mudam. Um corpo vazio responde `400`. Para remover o ícone, envie `"icon": null`. O nome e o ícone novos também aparecem nas mensagens que o bot já enviou, porque o chat lê esses dados do bot. **`Renomear um bot e remover o ícone`** ```bash title="Renomear um bot e remover o ícone" curl -X PATCH "https://api.ereemby.app/api/v2/bots/bot_4b1e9c1a-7a2f-4d1e-9c55-2f6b8a3d7e10" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "New bot name", "icon": null }' ``` Veja [Atualizar um bot](/developers/api-v2/chats-and-bots/bots/update-bot). ## Apague um bot `DELETE /bots/{id}` responde `200` com `object`, `id` e `deleted: true`. As mensagens que o bot já enviou continuam nos chats. Veja [Excluir um bot](/developers/api-v2/chats-and-bots/bots/delete-bot). > **Warning** > > Depois de apagar um bot, enviar uma mensagem com o `bot_id` dele responde `422` `resource_missing`. Troque o id em todo lugar da sua integração que ainda o usa. ## Se algo der errado * `400` `validation_error`: o `name` está vazio ou passa de 100 caracteres, o `icon` passa de 255, há um campo desconhecido ou o `PATCH` veio sem nenhum campo. O campo vem em `param`. * `400` `invalid_id`: o id do caminho não é um id `bot_`. * `404` `not_found`: o bot não existe na loja. Os outros códigos estão em [Erros](/developers/api-v2/errors). ## Páginas relacionadas * [Chats e mensagens](/developers/api-v2/chats-and-bots/chats-and-messages): envie mensagens com o bot. * [Visão geral](/developers/api-v2/chats-and-bots): escopos e rotas de chats e bots.