Problem
API requests to Kaptio endpoints are failing with timeout errors. Users may see messages like “Connection timed out”, “Request timeout”, or “504 Gateway Timeout”.
Symptoms
- API calls taking longer than 30 seconds before failing
- Intermittent timeout errors during peak hours
- Specific endpoints timing out while others work fine
- Bulk operations failing mid-process
Solution
-
Check endpoint URL - Verify you’re using the correct API endpoint for your environment:
- Production:
https://api.kaptio.com - Sandbox:
https://api-sandbox.kaptio.com
- Production:
-
Review request payload size - Large payloads can cause timeouts:
- Limit batch operations to 100 records
- Use pagination for list endpoints
- Compress large data payloads
-
Implement retry logic - Add exponential backoff:
async function apiCallWithRetry(fn, maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { return await fn(); } catch (error) { if (i === maxRetries - 1) throw error; await new Promise(r => setTimeout(r, Math.pow(2, i) * 1000)); } } } -
Increase client timeout - Adjust your HTTP client timeout:
- Set timeout to at least 60 seconds for complex operations
- Use longer timeouts for bulk/batch operations
-
Check network connectivity - Verify network path:
- Ensure firewall allows outbound HTTPS (443)
- Test from different network locations
- Check for proxy interference
Tip: Monitor API response times using the X-Response-Time header returned by Kaptio endpoints.
FAQ
What is the default API timeout?
Kaptio’s API has a default timeout of 30 seconds. For operations expected to take longer, ensure your client is configured appropriately.
How can I monitor API performance?
Use the Kaptio Developer Dashboard to view API metrics, or implement client-side logging with response times from the X-Response-Time header.
Are there rate limits that could cause timeouts?
Yes, exceeding rate limits (100 requests/minute) may result in 429 errors. Implement rate limiting on your client side to avoid this.