Skip to Content

Webhooks

QiQ Social uses Supabase Edge Functions as HTTP endpoints for handling external events and integrations.

Available Endpoints

Content Generation

Trigger AI content generation for an automation.

POST /functions/v1/generate-content Authorization: Bearer <access-token> Content-Type: application/json { "automation_id": 1 }

Response: Returns the created run with generated posts.

OAuth Connect

Handle OAuth callbacks from platform authorization flows.

POST /functions/v1/connect Content-Type: application/json { "platform": "instagram", "code": "<oauth-authorization-code>", "workspace_id": "uuid" }

Sync

Refresh OAuth tokens and synchronize connection data.

POST /functions/v1/sync Authorization: Bearer <access-token> Content-Type: application/json { "connection_id": 1 }

Import Channels

Fetch and import channels from a connected platform.

POST /functions/v1/import-channels Authorization: Bearer <access-token> Content-Type: application/json { "connection_id": 1 }

Text Assist

AI-powered text enhancement for editing post content.

POST /functions/v1/text-assist Authorization: Bearer <access-token> Content-Type: application/json { "text": "Original text to enhance", "action": "improve" }

Media Assist

AI-powered image generation.

POST /functions/v1/media-assist Authorization: Bearer <access-token> Content-Type: application/json { "prompt": "A professional marketing image for social media" }

Cron-Triggered Functions

These functions run on a schedule and are not called directly via HTTP:

FunctionSchedulePurpose
process-queuePeriodicMain orchestrator — fetches RSS sources, processes entries, runs scheduled automations, publishes posts
sync-post-metricsPeriodicFetches engagement metrics (views, likes, comments) from platforms for published posts

Error Handling

Edge Functions return standard HTTP status codes:

CodeDescription
200Success
400Bad request (invalid parameters)
401Unauthorized (missing or invalid token)
403Forbidden (insufficient permissions)
404Resource not found
500Internal server error

Error responses include a JSON body with details:

{ "error": "Description of what went wrong" }
Last updated on