API Integration
Use KnowFlow’s API to build custom integrations and applications that leverage your knowledge bases.Getting Started
1
Get API Credentials
- Navigate to your integration settings
- Go to the API tab
- Generate API keys and note your integration ID
2
Test Connection
Make a test API call to verify your setup:
3
Implement in Your Application
Integrate the API calls into your custom application or service.
API Endpoints
Send Message
Send a message to your integration and receive a response.Get Conversation History
Retrieve conversation history for a session.Authentication
All API requests require authentication using an API key:Rate Limiting
API requests are rate limited based on your plan:| Plan | Requests per minute | Requests per day |
|---|---|---|
| Free | 60 | 1,000 |
| Pro | 300 | 10,000 |
| Enterprise | 1,000 | 100,000 |
SDK Examples
JavaScript/Node.js
Python
PHP
Error Handling
The API uses standard HTTP status codes:| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Webhooks
Configure webhooks to receive real-time notifications:Setup
- Configure webhook URL in your integration settings
- Choose which events to receive notifications for
- Verify webhook signature for security
Event Types
conversation.started- New conversation initiatedconversation.ended- Conversation completedmessage.received- New message from usermessage.sent- Response sent to user
Webhook Payload
Best Practices
- Use Session IDs: Maintain conversation context with consistent session identifiers
- Handle Rate Limits: Implement retry logic with exponential backoff
- Secure API Keys: Store API keys securely and rotate them regularly
- Monitor Usage: Track API usage to stay within limits
- Cache Responses: Cache frequently requested information to reduce API calls