Documentation
Everything you need to integrate and use TeamLead AI.
Getting Started
1. Create your account
Sign up at teamlead.ai/signup and choose between Solo Builder or Team Leader mode. Solo mode gives you a personal AI manager; Team mode adds the leadership dashboard.
2. Connect GitHub
Link your repositories so the AI agent can read your codebase, track commits, monitor PRs, and detect conflicts. Go to Settings and click "Connect" on the GitHub card.
3. Set up your team
Navigate to Team and invite members by email. Assign roles (admin, lead, member), skills, and timezones. The AI uses this context for intelligent task assignment.
4. Create your first goal
Go to Goals and create a high-level objective. The AI can automatically decompose it into sub-goals and assign them to team members based on their skills.
API Reference
All endpoints require a Bearer token in the Authorization header (Supabase JWT).
/api/organizations List user organizations/api/organizations Create a new organization/api/organizations/:orgId Update organization settings/api/organizations/:orgId Delete an organization/api/dashboard/:orgId Get dashboard data/api/goals/:orgId List goals for organization/api/goals/:orgId Create a new goal/api/goals/:goalId Update a goal/api/goals/:goalId Delete a goal/api/goals/:goalId/decompose AI-decompose a goal into sub-goals/api/members/:orgId List team members/api/members/:orgId Add a team member/api/members/:memberId Update member details/api/members/:memberId Remove a member/api/activities/:orgId List activities with filters/api/health/:orgId Get team health score and history/api/conflicts/:orgId List active conflicts/api/chat Send a message to the AI agent (streaming)/api/chat/history Get chat history for an org/api/integrations/:orgId List integrations/api/integrations/:orgId/connect Get OAuth URL for a provider/api/notifications/:orgId List notifications/api/reports/:orgId Get weekly reports/api/contact Submit a contact form messageIntegration Guides
GitHub Webhooks
TeamLead AI listens for push, pull_request, pull_request_review, and issues events. Configure your webhook URL as:
POST https://api.teamlead.ai/webhooks/github Set the webhook secret in your GitHub App settings and configure GITHUB_WEBHOOK_SECRET in your environment.
Slack Bot
The Slack integration provides /teamlead commands (status, blockers, next) and monitors team channels for activity. Configure:
Events URL: https://api.teamlead.ai/webhooks/slack/events Commands URL: https://api.teamlead.ai/webhooks/slack/commandsDiscord
Chat-based team communication. The agent sends task assignments, briefs, and alerts via Discord DMs. Set up your bot:
DISCORD_BOT_TOKEN=your_bot_tokenTelegram
Direct messaging for task updates and daily briefs. Create a bot via @BotFather and configure:
TELEGRAM_BOT_TOKEN=your_bot_tokenSetting up GitHub Integration
To create a GitHub App for TeamLead AI:
- Go to GitHub Settings > Developer Settings > GitHub Apps > New GitHub App
- Set the app name to "TeamLead AI" (or your preferred name)
- Set the Homepage URL to your TeamLead AI instance URL
- Set the Webhook URL to
https://api.teamlead.ai/webhooks/github - Generate a webhook secret and save it as GITHUB_WEBHOOK_SECRET
- Under Permissions, grant: Repository contents (read), Pull requests (read/write), Issues (read), Metadata (read)
- Subscribe to events: Push, Pull request, Pull request review, Issues
- Create the app and install it on your organization's repositories
- Save the App ID and generate a private key for API authentication
Chat API Examples
Send a message (streaming response)
const response = await fetch('https://api.teamlead.ai/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN',
},
body: JSON.stringify({
message: 'What should I work on today?',
org_id: 'your-org-id',
}),
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
// Parse SSE data lines
}
Fetch chat history
const response = await fetch(
'https://api.teamlead.ai/api/chat/history?org_id=your-org-id',
{ headers: { 'Authorization': 'Bearer YOUR_TOKEN' } }
);
const { messages } = await response.json();