Automation API
OAuth 2.0 PKCE, REST-hook triggers, and Automation actions for Zapier, Make, n8n, and custom backends
Connect the platform to Zapier, Make, n8n, or your own workers using two auth modes:
1. Automation connection key (UGAU_live_... / UGAU_test_...) - a bearer token scoped to one user's Automation connection.
2. OAuth 2.0 with PKCE - "Connect" for no-code platforms (/api/automation/oauth/*).
Either credential authenticates the same endpoints below; AutomationAuthGuard accepts a JWT, an Automation connection key, or an OAuth access token interchangeably.
What you get
| Capability | Detail |
|---|---|
| Triggers | 31 REST-hook names in AUTOMATION_TRIGGER_LIST (subscribe via POST /automation/webhooks/subscribe) - campaign/slot/earnings/withdrawals/AI/storage plus billing/username rails. The Developer Console webhook picker shows the 19-event UGC subset (campaign, slot, earnings, withdrawals). |
| Actions | 7 HTTPS endpoints under /api/automation/actions/* - campaign CRUD/funding/slots, username check, crypto deposit address |
| Delivery | Outbound trigger POSTs are signed with `X-UGC-Signature` (hex HMAC-SHA256 of the raw JSON body using hookSecret); each delivery also carries X-UGC-Event-Id |
Quick links
Subscribe to a trigger
POST https://api.ugc.africa/automation/webhooks/subscribe
Authorization: Bearer <connection_key_or_oauth_access_token>
Content-Type: application/json
{
"trigger": "campaign_funded",
"targetUrl": "https://hooks.yourapp.com/webhook"
}Response includes a generated hookSecret (whsec_...) - store it; it's used to verify delivery signatures and is not shown again.
Recommended: subscribe one URL to many triggers in one call (shared hookSecret per URL):
POST https://api.ugc.africa/automation/webhooks/subscribe-batch
Authorization: Bearer <token>
Content-Type: application/json
{
"targetUrl": "https://hooks.yourapp.com/webhook",
"triggers": ["campaign_created", "campaign_funded", "slot_approved"]
}Update the event set for a URL: POST /automation/webhooks/sync-endpoint with { targetUrl, triggers }. Remove an entire URL: POST /automation/webhooks/unsubscribe-endpoint.
Unsubscribe one row: POST /automation/webhooks/unsubscribe with subscriptionId. List: GET /automation/webhooks/subscriptions.
Manage connections
| Method & path | Purpose | |
|---|---|---|
GET /automation/connections | List your Automation connections (API keys + OAuth status) | |
POST /automation/connections/api-key | Generate a new connection key (`{ "environment": "live" \ | "test" }`) |
DELETE /automation/connections/:id | Revoke a connection key | |
POST /automation/connections/oauth/revoke | Revoke OAuth tokens (all or one clientId) |
Generate and revoke connection keys, and connect Zapier/Make/n8n via OAuth, from Automation in the main app.
Account availability
Some Automation features - and some individual actions - may not be enabled on every account yet. A disabled feature returns a 403 Forbidden response; if you hit one, contact support to have it enabled for your account.
Did this solve your problem?