Authentication
Learn how to authenticate your requests to the Filtyr API.
API Keys
All requests to the Filtyr API must include an API key in the Authorization header. You can obtain an API key from your Filtyr dashboard under Settings.
Example Requests
cURL
1curl -X POST https://filtyr.ai/api/data/{organizationId}/{dataSourceId} \2 -H "Authorization: Bearer your-api-key" \3 -H "Content-Type: application/json" \4 -d '{"data": {"content": "Hello, world!"}}'
Node.js
1const response = await fetch('https://filtyr.ai/api/data/{organizationId}/{dataSourceId}', {2 method: 'POST',3 headers: {4 'Authorization': 'Bearer your-api-key',5 'Content-Type': 'application/json',6 },7 body: JSON.stringify({8 data: {9 content: 'Hello, world!'10 }11 })12});13
14const result = await response.json();
Security Best Practices
- Keep your API keys secure and never expose them in client-side code
- Use different API keys for development and production environments
- Rotate your API keys periodically
- Restrict API key access to specific IP addresses when possible
Response Codes
401
Invalid or missing API key403
Valid API key but insufficient permissions