Referência da API
BotLaunch API
Construa integrações poderosas com a API REST do BotLaunch. Acesso completo a bots, usuários, mensagens e muito mais com documentação abrangente e exemplos.
URL Base
https://api.botlaunch.io
Versão
v1.0
Autenticação
JWT Bearer
Início Rápido
Comece a usar a API do BotLaunch em minutos.
1. Instalar ou Testar
# Install the BotLaunch SDK
npm install @botlaunch/sdk
# Or use the REST API directly
curl -X GET "https://api.botlaunch.io/api/health" \
-H "Content-Type: application/json"bash
2. Autenticar
// Authenticate and get an access token
const response = await fetch("https://api.botlaunch.io/api/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
email: "your@email.com",
password: "your-password"
})
});
const { data } = await response.json();
console.log(data.accessToken);javascript
3. Fazer Chamadas à API
// Make authenticated API calls
const bots = await fetch("https://api.botlaunch.io/api/bots", {
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"x-organization-id": "YOUR_ORG_ID"
}
});
const { data } = await bots.json();
console.log(data); // Array of your botsjavascript
Endpoints da API
Explore os endpoints disponíveis da API organizados por tipo de recurso.
Formato de Resposta
Todas as respostas da API seguem uma estrutura JSON consistente.
Resposta de Sucesso
{
"data": {
"id": "bot_123",
"name": "My Bot",
"status": "active"
},
"message": "Bot retrieved successfully"
}json
Resposta de Erro
{
"error": "Unauthorized",
"statusCode": 401,
"message": "Invalid or expired token"
}json
Resposta Paginada
{
"data": [
{ "id": "bot_1", "name": "Bot 1" },
{ "id": "bot_2", "name": "Bot 2" }
],
"total": 25,
"page": 1,
"limit": 10
}json
Limitação de Taxa
As requisições da API são limitadas para garantir uso justo e estabilidade da plataforma.
| Plano | Requisições/Min | Requisições/Dia | Limite de Rajada |
|---|---|---|---|
| Free | 60 | 1,000 | 10 |
| Starter | 300 | 10,000 | 50 |
| Professional | 1,000 | 50,000 | 100 |
| Business | 5,000 | Unlimited | 500 |
| Enterprise | Custom | Unlimited | Custom |
Cabeçalhos de Limite de Taxa
Check X-RateLimit-Remaining and X-RateLimit-Reset headers in API responses to monitor your usage.