Integrations · API
API & Webhooks
Integrate Airpost with external tools via webhooks and API.
Webhook Endpoint
POST https://airpost.agency/api/webhooks
Send your Gemini API key as X-API-Key header for authentication.
Actions
Create a draft post for a client.
{
"action": "create_post",
"client_id": 1,
"topic": "Text on design",
"caption": "Instagram caption",
"post_type": "post",
"platforms": "instagram"
}
Get recent posts for a client.
{
"action": "list_posts",
"client_id": 1
}
Push engagement metrics for a post (from Meta API, etc.).
{
"action": "update_engagement",
"post_id": 42,
"likes": 150,
"comments": 23,
"saves": 45,
"shares": 12,
"reach": 5000
}
CSV Export
GET /api/export/posts?client_id=1
Downloads all posts as CSV with ID, topic, caption, type, status, score, engagement, dates.
Client Portal
POST /api/client-portal/create-token
{
"client_id": 1,
"permissions": "approve" // "view", "approve", or "comment"
}
Returns a unique URL your client can use to view posts, stats, and approve/reject content — no login needed.
Intelligence APIs
/api/intelligence/memory?client_id=1
Brand memory
/api/intelligence/hooks?client_id=1
Top hooks
/api/intelligence/score
Content scoring
/api/intelligence/top-patterns?client_id=1
Winning patterns
/api/intelligence/analyze-performance
Full audit
/api/intelligence/export?client_id=1
Full report JSON
/api/intelligence/populate-hooks
AI-generate 20+ hooks
/api/intelligence/analyze-competitor
Scrape + analyze competitor
/api/intelligence/engagement
Track post engagement
/api/intelligence/engagement/batch
Bulk engagement update
/api/ai-design/generate-template
Auto-template from logo
/api/campaigns
Create campaign
Authentication
API Key Auth: X-API-Key header. Get your key from Settings.
Session Auth: All dashboard endpoints use session cookies. Login via POST /api/login first.
Rate Limits
| Endpoint | Limit |
|---|---|
| All API endpoints | 200 requests/minute |
| Login | 10 requests/minute |
| AI Generation | Based on plan (Free: 50/mo, Pro: 500/mo) |
| File Uploads | 50MB max per file |
Additional Endpoints
/api/plan
Current plan + usage
/api/workspace/health
Workspace health score
/api/analytics/ai-usage
AI generation analytics
/api/analytics/export?period=30
Export analytics CSV
/api/account/export
GDPR data export
/api/clients/{id}/health
Client health score
/api/clients/{id}/export
Client data export JSON
/api/posts/{id}/versions
Post edit history
/health
Service health check
Zapier / Make.com Integration
Connect Airpost to 5,000+ apps using Zapier or Make.com webhooks.
Example: Create post from Google Sheets
1. In Zapier, trigger: "New Row in Google Sheets"
2. Action: "Webhooks by Zapier" → POST
3. URL: https://airpost.agency/api/webhooks
4. Headers: X-API-Key: your_api_key
5. Body:
{
"action": "create_post",
"client_id": 1,
"topic": "{{Column A}}",
"caption": "{{Column B}}",
"platforms": "instagram"
}
Example: Push engagement data from Meta API
1. Use a scheduled Zap or Make scenario
2. Fetch post insights from Facebook/Instagram Graph API
3. Send to Airpost:
{
"action": "update_engagement",
"post_id": 42,
"likes": 150,
"comments": 23,
"saves": 45,
"reach": 5000
}
Airpost's AI will learn from high-performing content automatically.
Example: Notify Slack when post is published
1. In Zapier, trigger: "Catch Hook" (webhook)
2. In Airpost, set up a webhook to POST to your Zapier URL on publish events
3. Action: "Send Slack Message" with post details
Coming soon: native webhook events for post status changes
Outgoing Webhooks
Receive real-time notifications when events happen in Airpost.
Loading...
Recent Deliveries
Loading...
Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Not authenticated — login or add X-API-Key header |
| 403 | Access denied — wrong workspace or insufficient role |
| 404 | Resource not found |
| 429 | Rate limited — slow down (see limits above) |
| 500 | Server error — try again or contact support |
| NO_API_KEY | AI features need an API key — add in Settings |
| PLAN_LIMIT | Plan limit reached — upgrade for more |