U

User

Member

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

POST create_post

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"
}
POST list_posts

Get recent posts for a client.

{
  "action": "list_posts",
  "client_id": 1
}
POST update_engagement

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

GET /api/intelligence/memory?client_id=1 Brand memory
GET /api/intelligence/hooks?client_id=1 Top hooks
POST /api/intelligence/score Content scoring
GET /api/intelligence/top-patterns?client_id=1 Winning patterns
POST /api/intelligence/analyze-performance Full audit
GET /api/intelligence/export?client_id=1 Full report JSON
POST /api/intelligence/populate-hooks AI-generate 20+ hooks
POST /api/intelligence/analyze-competitor Scrape + analyze competitor
POST /api/intelligence/engagement Track post engagement
POST /api/intelligence/engagement/batch Bulk engagement update
POST /api/ai-design/generate-template Auto-template from logo
POST /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

EndpointLimit
All API endpoints200 requests/minute
Login10 requests/minute
AI GenerationBased on plan (Free: 50/mo, Pro: 500/mo)
File Uploads50MB max per file

Additional Endpoints

GET /api/plan Current plan + usage
GET /api/workspace/health Workspace health score
GET /api/analytics/ai-usage AI generation analytics
GET /api/analytics/export?period=30 Export analytics CSV
GET /api/account/export GDPR data export
GET /api/clients/{id}/health Client health score
GET /api/clients/{id}/export Client data export JSON
GET /api/posts/{id}/versions Post edit history
GET /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

CodeMeaning
400Bad request — missing or invalid parameters
401Not authenticated — login or add X-API-Key header
403Access denied — wrong workspace or insufficient role
404Resource not found
429Rate limited — slow down (see limits above)
500Server error — try again or contact support
NO_API_KEYAI features need an API key — add in Settings
PLAN_LIMITPlan limit reached — upgrade for more