To integrate Lovable with Agorapulse, create a Supabase Edge Function that proxies Agorapulse API calls using an OAuth2 access token stored in Cloud → Secrets. The API provides access to social inbox items, publishing queues, and performance reports. Use Lovable's chat to build unified social inbox dashboards, response tracking tools, and multi-network publishing interfaces.
Build unified social inbox and engagement dashboards with the Agorapulse API
Agorapulse's platform sits at the intersection of social media monitoring and publishing — its primary differentiator is the unified inbox, which aggregates all incoming social messages (comments, mentions, direct messages, reviews) across connected accounts into a single queue. The API exposes this inbox alongside publishing, analytics, and profile management endpoints, making it possible to build custom social engagement dashboards in Lovable.
The unified inbox use case is particularly valuable for customer-facing teams: support representatives, community managers, and social media managers who need to respond to inbound messages without switching between multiple social network apps. Building a Lovable interface on top of Agorapulse's inbox API lets you customize the workflow — adding internal notes, CRM lookups, response templates, and routing rules that the native Agorapulse interface does not support.
Agorapulse is meaningfully different from Buffer in scope. Buffer focuses on outbound publishing — scheduling posts to go out across platforms. Agorapulse covers both outbound publishing and inbound engagement — the inbox, response tracking, conversation history, and social listening. If your Lovable app needs to help a team respond to incoming social messages and track response times, Agorapulse is the right API. If you only need to schedule outbound posts, Buffer is simpler.
Integration method
Agorapulse uses OAuth2 for API authentication and provides REST endpoints for inbox items, publishing, reports, and profile management. Because OAuth tokens authorize access to connected social accounts and customer message data, all Agorapulse API calls must be proxied through a Supabase Edge Function with credentials stored in Cloud → Secrets.
Prerequisites
- A Lovable account with a project that has Lovable Cloud enabled
- An Agorapulse account — a paid plan is required for API access (Standard plan or above)
- An Agorapulse developer application registered at developers.agorapulse.com
- OAuth2 client credentials (client ID and client secret) from the Agorapulse developer portal
- An OAuth2 access token with access to the inbox and publishing endpoints
Step-by-step guide
Register an Agorapulse application and obtain OAuth credentials
Register an Agorapulse application and obtain OAuth credentials
Navigate to developers.agorapulse.com and sign in with your Agorapulse account. Go to the Applications section and click 'Create Application'. Fill in the application name, description, and redirect URI. Use your deployed Lovable app URL followed by /auth/agorapulse/callback. Agorapulse will create the application and provide a Client ID and Client Secret. Note both values. Agorapulse's API uses OAuth2 with the authorization code flow for user-level access — you will need to go through the authorization flow to get an access token for your Agorapulse account. To generate an access token, construct the authorization URL using your client ID and redirect URI: https://app.agorapulse.com/auth/authorize?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&response_type=code&scope=read write Visit this URL in your browser while logged into Agorapulse. Authorize the application. Agorapulse will redirect to your callback URL with a code parameter. Exchange this code for an access token by making a POST request to https://app.agorapulse.com/auth/token with your client ID, client secret, code, and redirect URI. Agorapulse access tokens have a configurable expiry — check the expires_in field in the token response. Store the refresh token if provided so the Edge Function can renew credentials automatically. Note that API access requires a paid Agorapulse plan (Standard or above) — free or trial accounts do not have API access.
Pro tip: Agorapulse API documentation is at developers.agorapulse.com. The inbox endpoints use a different URL structure than the publishing endpoints — review the API reference before building the Edge Function to understand the endpoint paths.
Expected result: You have an Agorapulse Client ID, Client Secret, and an OAuth2 access token. The access token is associated with your Agorapulse account and has access to inbox and publishing endpoints.
Store Agorapulse credentials in Cloud → Secrets
Store Agorapulse credentials in Cloud → Secrets
Open your Lovable project and navigate to the Cloud panel via the '+' icon next to Preview. Click the Secrets tab and add the following: - Name: AGORAPULSE_ACCESS_TOKEN — Value: your OAuth2 access token - Name: AGORAPULSE_REFRESH_TOKEN — Value: your refresh token (if provided) - Name: AGORAPULSE_CLIENT_ID — Value: your application Client ID - Name: AGORAPULSE_CLIENT_SECRET — Value: your application Client Secret The access token is the primary credential used for API calls. The client credentials and refresh token enable automatic token renewal. Agorapulse inbox data includes social media messages from your customers — this is personal communication data that deserves strong security handling. Never paste these credentials into Lovable's chat or into source code. Lovable's security system blocks approximately 1,200 hardcoded API keys daily, but the correct pattern is always to use Cloud → Secrets.
Expected result: AGORAPULSE_ACCESS_TOKEN, AGORAPULSE_REFRESH_TOKEN, AGORAPULSE_CLIENT_ID, and AGORAPULSE_CLIENT_SECRET appear in Cloud → Secrets with masked values.
Create the Agorapulse API proxy Edge Function
Create the Agorapulse API proxy Edge Function
Create a Supabase Edge Function that proxies Agorapulse API requests. Agorapulse's API base URL is https://app.agorapulse.com/api/v1/ and uses Authorization: Bearer {token} on all requests. The Edge Function handles four core actions: profiles (list connected social accounts), inbox (retrieve inbox items with optional filters for status and profile), publish (create a scheduled or immediate post), and report (fetch analytics for a profile and date range). Agorapulse returns inbox items with a status field: pending (not yet handled), in_progress (being handled), or done (resolved). Your dashboard can filter by status to show only pending items, helping teams focus on unanswered messages.
Create a Supabase Edge Function at supabase/functions/agorapulse-api/index.ts. Accept POST requests with 'action' (profiles | inbox | inbox_item | publish | report) and 'params'. Use AGORAPULSE_ACCESS_TOKEN as Bearer auth for https://app.agorapulse.com/api/v1/. For 'profiles': GET /organizations/me/socialAccounts. For 'inbox': GET /organizations/me/messages?status={status}&socialAccountId={id}. For 'publish': POST /organizations/me/publications with profile_id, content, scheduled_at. For 'report': GET /organizations/me/reports/profiles/{profile_id} with date params. Include CORS headers.
Paste this in Lovable chat
1// supabase/functions/agorapulse-api/index.ts2const AGORAPULSE_BASE = 'https://app.agorapulse.com/api/v1';34Deno.serve(async (req) => {5 if (req.method === 'OPTIONS') {6 return new Response(null, {7 headers: {8 'Access-Control-Allow-Origin': '*',9 'Access-Control-Allow-Methods': 'POST, OPTIONS',10 'Access-Control-Allow-Headers': 'Content-Type, Authorization',11 },12 });13 }1415 const accessToken = Deno.env.get('AGORAPULSE_ACCESS_TOKEN');16 if (!accessToken) {17 return new Response(JSON.stringify({ error: 'Agorapulse token not configured' }), {18 status: 500,19 headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' },20 });21 }2223 const headers = {24 'Authorization': `Bearer ${accessToken}`,25 'Content-Type': 'application/json',26 };2728 const { action, params } = await req.json();29 let url: string;30 let fetchOptions: RequestInit = { method: 'GET', headers };3132 if (action === 'profiles') {33 url = `${AGORAPULSE_BASE}/organizations/me/socialAccounts`;34 } else if (action === 'inbox') {35 const q = new URLSearchParams({36 ...(params?.status && { status: params.status }),37 ...(params?.profile_id && { socialAccountId: params.profile_id }),38 perPage: '50',39 });40 url = `${AGORAPULSE_BASE}/organizations/me/messages?${q}`;41 } else if (action === 'publish') {42 url = `${AGORAPULSE_BASE}/organizations/me/publications`;43 fetchOptions = {44 method: 'POST',45 headers,46 body: JSON.stringify({47 socialAccountIds: params.profile_ids,48 text: params.text,49 publishAt: params.scheduled_at || null,50 }),51 };52 } else if (action === 'report') {53 url = `${AGORAPULSE_BASE}/organizations/me/reports/profiles/${params.profile_id}?dateStart=${params.date_start}&dateEnd=${params.date_end}`;54 } else {55 return new Response(JSON.stringify({ error: 'Invalid action' }), {56 status: 400,57 headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' },58 });59 }6061 const response = await fetch(url, fetchOptions);62 const data = await response.json();6364 return new Response(JSON.stringify(data), {65 status: response.ok ? 200 : response.status,66 headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' },67 });68});Pro tip: Agorapulse's inbox API supports filtering by message type (comment, mention, direct_message, review) using the messageType query parameter. Add this filter to your inbox view so users can focus on specific message types without seeing all notifications at once.
Expected result: The agorapulse-api Edge Function is deployed. Calling it with { action: 'profiles' } returns the list of connected social accounts with their names and network types.
Build the unified social inbox and response UI
Build the unified social inbox and response UI
With the Edge Function in place, use Lovable's chat to build the inbox interface. The unified inbox is the core value of the Agorapulse integration — a feed that shows all incoming social messages across all connected profiles, prioritized by recency and filtered by status. The inbox should show each message with: the author's name and profile picture (from Agorapulse's message objects), the message text, the social network it came from, the time received, the current status (pending, in_progress, done), and any assigned team member. Add action buttons for Reply (opens a compose modal), Assign (dropdown of team members), and Resolve (marks done via the API). For response tracking, store all actions taken on inbox items in a Supabase table: item_id, action_type, action_by (user_id), action_at (timestamp), and notes. This creates an audit trail beyond what Agorapulse tracks natively, which is valuable for SLA reporting. For the publishing component, build a simplified post composer that calls the publish action on the Edge Function. Show a profile selector (populated from the profiles action), a text input with character count, an optional image upload, and a schedule picker. Posts can go to Agorapulse's queue for immediate or scheduled publishing. For complex enterprise workflows with Salesforce or Zendesk integration, custom SLA routing, and multi-brand management, RapidDev's team can help design the full architecture.
Create a social inbox dashboard with two panels: (1) on the left, a list of inbox items fetched from the agorapulse-api Edge Function showing author, message preview, social network icon, time, and status badge — with tabs for Pending, In Progress, and Done; (2) on the right, a detail view when an item is selected showing the full message, author details, a reply text area, and Assign/Resolve buttons. Clicking Resolve calls the agorapulse-api Edge Function to update the item status and saves the action to a Supabase 'inbox_actions' table.
Paste this in Lovable chat
Expected result: A two-panel inbox UI shows social messages from all connected Agorapulse profiles on the left, with message detail and action controls on the right. Resolving an item updates its status in Agorapulse and logs the action in Supabase.
Common use cases
Unified social inbox with response tracking
Build a custom social inbox that pulls all incoming messages, comments, and mentions from Agorapulse across all connected social profiles. Team members can assign inbox items, track response times, add internal notes, and mark items as resolved — all synced back to Agorapulse via the API.
Create a social inbox page that fetches inbox items from the agorapulse Edge Function for all connected profiles. Show items in a feed with the author's name, profile picture, message text, social network icon, and time received. Add 'Assign', 'Reply', and 'Resolve' buttons. Store assignment and resolution data in Supabase 'inbox_actions' table. Show unread count badges by profile.
Copy this prompt to try it in Lovable
Response time and team performance analytics
Build an analytics dashboard that tracks social media response times and team performance using data from Agorapulse's inbox and reporting APIs. The dashboard shows average response time by team member, resolution rate, and first-response-time SLA compliance.
Build a team performance dashboard that reads inbox item data from the agorapulse Edge Function and calculates: average first response time per team member, number of items resolved today, and SLA compliance rate (percentage of items responded to within 4 hours). Display as metric cards with trend arrows. Store daily snapshots in Supabase for historical comparison.
Copy this prompt to try it in Lovable
Content publishing calendar with approval workflow
Create a content calendar that integrates with Agorapulse's publishing API to schedule social posts with a manager approval step. Writers draft content, managers approve it, and approved posts are queued to Agorapulse's publishing scheduler via the API.
Build a publishing workflow with a draft post creator and an approvals queue. Writers create posts with text, image, profile selection, and scheduled time. Approved posts are sent to the agorapulse Edge Function to create a scheduled publication. Show the content calendar with posts in their approved status. Store draft and approval history in Supabase.
Copy this prompt to try it in Lovable
Troubleshooting
API returns 401 Unauthorized or 'Token expired'
Cause: The Agorapulse access token in AGORAPULSE_ACCESS_TOKEN has expired. Agorapulse tokens have a configurable expiry and may expire sooner than expected.
Solution: Check when the token was generated and compare to the expires_in value returned when you created it. If expired, use the refresh token flow to obtain a new access token: POST to https://app.agorapulse.com/auth/token with grant_type=refresh_token, your refresh_token, client_id, and client_secret. Update AGORAPULSE_ACCESS_TOKEN in Cloud → Secrets with the new token.
Inbox endpoint returns empty array despite active social accounts being connected in Agorapulse
Cause: The inbox items may be filtered by a status that has no items, or the connected social accounts have not received any messages in the default time window.
Solution: Remove the status filter to retrieve all inbox items regardless of status. Also check the date range parameter — Agorapulse may default to a limited time window. If the profiles endpoint returns connected accounts but inbox is still empty, log into Agorapulse directly and confirm there are inbox items visible in the native UI before debugging the API call.
Publishing action returns 403 Forbidden
Cause: Your Agorapulse plan does not include API access, or your OAuth token was generated without the write scope required for publishing.
Solution: Confirm your Agorapulse plan includes API access — this requires Standard plan or above. Then verify your OAuth token was generated with write scope included in the authorization request. If you only requested read scope, regenerate the token with both read and write scopes by going through the OAuth authorization flow again.
Best practices
- Store all Agorapulse OAuth credentials in Cloud → Secrets — inbox data contains customer social messages that require careful access control
- Implement token refresh logic in the Edge Function using the stored refresh token so expired tokens do not cause user-facing errors in your inbox dashboard
- Cache the social profiles list in Supabase with a 6-hour TTL — profile lists rarely change and fetching them on every inbox load adds unnecessary latency
- Store inbox action history in Supabase alongside Agorapulse's own tracking — this gives you independent SLA reporting data and historical records beyond Agorapulse's retention window
- Add message type filtering (comment, mention, direct_message, review) to the inbox UI so teams can focus on the message types most relevant to their workflow
- Track response time from item creation to first reply and store it in Supabase — this enables SLA compliance reporting that Agorapulse's native reports do not provide at the granularity needed for support teams
- Use Agorapulse's assignment feature via API to route inbox items to team members and track assignment history in Supabase for workload balancing analysis
Alternatives
Choose Buffer if you only need outbound post scheduling without inbox management — Buffer's simpler API is sufficient for publishing-only workflows and lacks the inbox and engagement features that make Agorapulse useful.
Choose Hootsuite if you need enterprise-level social management with team workflows, brand keyword monitoring, and deeper analytics than Agorapulse provides.
Choose Sprout Social if you need advanced CRM integration, social listening with sentiment analysis, and enterprise reporting dashboards that connect social data to business outcomes.
Frequently asked questions
Does Agorapulse API require a specific plan level?
Yes — Agorapulse API access is available on Standard plan and above. Free trial accounts and the basic plan do not include API access. If you are building with the API, confirm your team's Agorapulse subscription includes API access before starting development. Contact Agorapulse's support team if you are unsure whether your plan level includes API capabilities.
Can I reply to social messages directly through the Agorapulse API?
Agorapulse's API supports creating publications (scheduled or immediate posts) but direct replies to specific inbox items may require using the platform's native reply functionality or the social network's own API. The API's primary use case for inbox management is reading messages, updating their status (pending, in_progress, done), and assigning them to team members — not sending replies through Agorapulse's API. Check the current Agorapulse API documentation at developers.agorapulse.com for the latest inbox reply capabilities.
How does the unified inbox work across different social networks?
Agorapulse aggregates messages from all connected social accounts — Twitter/X, Facebook, Instagram, LinkedIn, YouTube, Google Business Profile, and TikTok — into a single inbox feed. Each inbox item includes the source network, the author's profile, the message text, and any attachments. The API returns all items in a unified format regardless of source network, so your Lovable dashboard does not need to handle different data structures per network.
What is the difference between Agorapulse inbox items and published posts in the API?
Inbox items are inbound messages — comments, mentions, DMs, and reviews that other people sent to your connected social accounts. Published posts are outbound content — scheduled or published posts that you sent from your social accounts. The API has separate endpoints for each: /messages for inbox items and /publications for scheduling and managing outbound content. Your Lovable dashboard should treat them as separate workflows, not as a single content feed.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation