Skip to main content
RapidDev - Software Development Agency
v0-integrationsNext.js API Route

How to Integrate Agorapulse with V0

To use Agorapulse with V0 by Vercel, call the Agorapulse REST API from Next.js API routes using your API key. Store credentials as server-only Vercel environment variables. V0 generates your social media inbox and publishing dashboard UI; API routes handle fetching conversations, scheduling posts, and managing social profiles securely.

What you'll learn

  • How to obtain an Agorapulse API key and authenticate via Bearer token
  • How to fetch inbox conversations and social media messages from Next.js API routes
  • How to build a unified social media inbox dashboard with V0-generated components
  • How to schedule and publish social media posts from a V0 app via the Agorapulse API
  • How to configure Agorapulse credentials as server-only Vercel environment variables
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate16 min read20 minutesMarketingApril 2026RapidDev Engineering Team
TL;DR

To use Agorapulse with V0 by Vercel, call the Agorapulse REST API from Next.js API routes using your API key. Store credentials as server-only Vercel environment variables. V0 generates your social media inbox and publishing dashboard UI; API routes handle fetching conversations, scheduling posts, and managing social profiles securely.

Building a Unified Social Inbox with Agorapulse and V0

Agorapulse's strongest feature is its social inbox — a unified view of all mentions, comments, messages, and reviews from every connected social profile. For agencies managing multiple brand accounts or founders who want a custom social monitoring interface, the Agorapulse API exposes this inbox data programmatically, letting you build purpose-built dashboards that surface exactly the engagement signals your team needs to act on.

The integration architecture places all Agorapulse API calls inside Next.js API routes deployed as Vercel serverless functions. Your React components — generated by V0 — fetch from these routes to display inbox conversations, social profile stats, and publishing calendars. This server-side proxy pattern is essential because your Agorapulse API key must never appear in client-side code where users could inspect it.

V0 is excellent at generating social media dashboard layouts: conversation thread lists, message cards with avatar and timestamp, engagement metric tiles, and content calendar grids. This tutorial walks you through authenticating with the Agorapulse API, fetching inbox conversations across all connected profiles, scheduling posts from a form, and deploying the whole stack to Vercel.

Integration method

Next.js API Route

V0 generates React components for your social media dashboard — inbox views, message cards, and publishing calendars. Next.js API routes in your Vercel deployment call the Agorapulse REST API using your API key to fetch inbox conversations, scheduled posts, and profile metrics. Credentials stay server-side in Vercel environment variables; your React components only talk to your own API routes.

Prerequisites

  • A V0 account at v0.dev and a Next.js project to work with
  • An Agorapulse account with at least one social profile connected
  • An Agorapulse API key from your account's Developer Settings (available on Medium plan and above)
  • A Vercel account for deployment and environment variable management
  • Basic familiarity with your connected social profiles' names and IDs in Agorapulse

Step-by-step guide

1

Generate Your Agorapulse API Key

Agorapulse's REST API uses Bearer token authentication. Your API key acts as both the identifier and the secret — it must be kept server-side at all times. To generate an API key, log in to Agorapulse at app.agorapulse.com. Click your profile avatar in the top-right corner, then go to Account Settings. Look for the Developer Settings or API section in the sidebar. If you don't see an API section, check whether your Agorapulse plan supports API access — API access is available on Medium plan and above. In the API settings page, click Generate New Token or Create API Key. Give it a descriptive name like 'V0 Dashboard' so you can identify and revoke it later. Copy the API key immediately — it may not be shown again in full. Also note your Agorapulse workspace's profile IDs — you can find these by browsing the Agorapulse API documentation or by making a test request to the /social-profiles endpoint after setup. The API base URL is https://api.agorapulse.com. Your API key goes in the Authorization header as 'Bearer YOUR_API_KEY' on every request. Keep this key private and never include it in client-side code or commit it to your repository.

Pro tip: Agorapulse API keys don't expire by default, but you should rotate them periodically. Create a dedicated key per integration so you can revoke just the V0 dashboard key without affecting other API integrations your team uses.

Expected result: An Agorapulse API key has been generated and stored securely. You have your API key ready to add as a Vercel environment variable.

2

Generate the Social Inbox UI in V0

Open V0 at v0.dev and describe the social media dashboard you want to build. Social inbox UIs share a common pattern — a three-panel layout: a left sidebar for social profiles and filter categories, a center panel listing conversation items, and a right panel showing the selected conversation thread. Describe this layout in detail and ask V0 to generate it with mock data. The mock data should mirror the structure you'll receive from the Agorapulse API: each inbox item has a platform name (facebook/instagram/twitter/linkedin), an author with a name and avatar URL, a message preview, a timestamp, and a status. Each conversation thread has an array of messages with author, content, and timestamp. Using these field names in mock data means wiring up real API data later is straightforward. Use V0's Design Mode to apply brand colors, adjust spacing, and refine the conversation list styling. The platform icons (Facebook's blue, Instagram's gradient, LinkedIn's blue, Twitter/X's black) add important visual context — ask V0 to include them as colored dots or emoji indicators in the mock data view.

V0 Prompt

Create a three-panel social inbox layout. Left sidebar: list of social profiles with platform icon (use colored dots: 🔵 Facebook, 🟣 Instagram, 🔷 LinkedIn, ⚫ Twitter), profile name, follower count, and unread message count badge. Center panel: conversation list showing author avatar (initials placeholder), author name, message excerpt (max 80 chars), platform icon, and time ago (e.g. '2h ago'). Right panel: conversation thread view with messages shown as a chat-style feed. Mock 6-8 inbox items and one selected conversation thread.

Paste this in V0 chat

Pro tip: Ask V0 to include a filter tab row above the conversation list with 'All', 'Unanswered', 'Assigned to me', and 'Archived' tabs. This filter pattern is common in Agorapulse users' workflows and maps directly to the status filter parameters in the API.

Expected result: A fully styled three-panel social inbox UI renders in V0's preview with realistic mock social media data. The layout, conversation list, and thread view are visually polished and ready for API integration.

3

Create API Routes for Inbox and Social Profiles

Build the Next.js API routes that call the Agorapulse REST API. Start by creating a utility at lib/agorapulse.ts that provides an authenticated fetch wrapper — it adds the Authorization: Bearer header on every request to the Agorapulse API base URL (https://api.agorapulse.com). The Agorapulse API is organized around social profiles. Most inbox operations require a profileId parameter. Your first route should be GET /api/agorapulse/profiles — this returns all social profiles connected to your Agorapulse account with their IDs, names, and platforms. Your frontend can use these IDs for subsequent inbox and metrics requests. The main inbox route GET /api/agorapulse/inbox takes optional query parameters for profileId, status (inbox/done/assigned), and cursor for pagination. It returns an array of conversation items. Each item includes the author details, message content, platform, timestamp, and current status. For posting, create POST /api/agorapulse/posts to schedule content to a social profile. The request body should include the profileId, message text, scheduled time (ISO 8601 format), and optionally media URLs. Agorapulse's API uses cursor-based pagination for inbox results — the response includes a nextCursor value you pass as a query parameter to fetch the next page. Handle this in your API route by forwarding the cursor parameter from your frontend query string.

V0 Prompt

Create a Next.js API route at app/api/agorapulse/inbox/route.ts. Use Bearer token auth with AGORAPULSE_API_KEY env var to call the Agorapulse API. Accept query params: profileId (optional), status (optional, default 'inbox'), cursor (optional for pagination). Return an array of inbox items with: id, authorName, authorAvatar, message, platform, timestamp, status. Return 200 with the items array and a nextCursor for pagination. Handle 401 and 500 errors.

Paste this in V0 chat

lib/agorapulse.ts
1// lib/agorapulse.ts
2const AGORAPULSE_BASE_URL = 'https://api.agorapulse.com';
3
4export async function agorapulseFetch(path: string, options?: RequestInit) {
5 const res = await fetch(`${AGORAPULSE_BASE_URL}${path}`, {
6 ...options,
7 headers: {
8 Authorization: `Bearer ${process.env.AGORAPULSE_API_KEY}`,
9 'Content-Type': 'application/json',
10 Accept: 'application/json',
11 ...options?.headers,
12 },
13 });
14 if (!res.ok) {
15 throw new Error(`Agorapulse API error: ${res.status} ${res.statusText}`);
16 }
17 return res.json();
18}
19
20// app/api/agorapulse/profiles/route.ts
21import { NextResponse } from 'next/server';
22import { agorapulseFetch } from '@/lib/agorapulse';
23
24export async function GET() {
25 try {
26 const data = await agorapulseFetch('/social-profiles');
27 return NextResponse.json({ profiles: data.data || data });
28 } catch (error) {
29 return NextResponse.json({ error: 'Failed to fetch profiles' }, { status: 500 });
30 }
31}
32
33// app/api/agorapulse/inbox/route.ts
34import { NextRequest, NextResponse } from 'next/server';
35import { agorapulseFetch } from '@/lib/agorapulse';
36
37export async function GET(req: NextRequest) {
38 const profileId = req.nextUrl.searchParams.get('profileId');
39 const status = req.nextUrl.searchParams.get('status') || 'inbox';
40 const cursor = req.nextUrl.searchParams.get('cursor');
41
42 try {
43 const queryParts = [`status=${status}`, 'limit=20'];
44 if (profileId) queryParts.push(`profile_id=${profileId}`);
45 if (cursor) queryParts.push(`cursor=${cursor}`);
46
47 const data = await agorapulseFetch(`/inbox?${queryParts.join('&')}`);
48 return NextResponse.json({
49 items: data.data || [],
50 nextCursor: data.meta?.next_cursor || null,
51 });
52 } catch (error) {
53 return NextResponse.json({ error: 'Failed to fetch inbox' }, { status: 500 });
54 }
55}
56
57// app/api/agorapulse/posts/route.ts
58import { NextRequest, NextResponse } from 'next/server';
59import { agorapulseFetch } from '@/lib/agorapulse';
60
61export async function POST(req: NextRequest) {
62 try {
63 const body = await req.json();
64 const post = await agorapulseFetch('/publications', {
65 method: 'POST',
66 body: JSON.stringify({
67 profile_id: body.profileId,
68 text: body.message,
69 scheduled_at: body.scheduledAt, // ISO 8601
70 type: 'scheduled',
71 }),
72 });
73 return NextResponse.json({ id: post.data?.id }, { status: 201 });
74 } catch (error) {
75 return NextResponse.json({ error: 'Failed to schedule post' }, { status: 500 });
76 }
77}

Pro tip: The Agorapulse API uses snake_case for field names (profile_id, scheduled_at, next_cursor). Your TypeScript interfaces should use snake_case when typing API responses, or transform them to camelCase in your API route before returning to the frontend.

Expected result: API routes at /api/agorapulse/profiles and /api/agorapulse/inbox return Agorapulse data as JSON. The inbox route supports profile filtering and pagination via cursor. The posts route accepts scheduling requests.

4

Wire the V0 Inbox UI to Live Agorapulse Data

Update the V0-generated inbox component to fetch real data from your API routes. Since the inbox requires interactive selection — clicking a profile in the sidebar, selecting a conversation, switching status tabs — mark the inbox component as a client component with 'use client'. On mount, fetch /api/agorapulse/profiles to populate the left sidebar. When a profile is selected or a status tab is clicked, fetch /api/agorapulse/inbox with the relevant profileId and status parameters. The Agorapulse API uses cursor-based pagination — when the user scrolls to the bottom of the inbox list or clicks Load More, pass the nextCursor value from the previous response as a cursor query parameter to append the next page of results to the existing list. For the conversation thread view, clicking an inbox item should open the thread. If Agorapulse's API provides thread detail via a separate endpoint, create a GET /api/agorapulse/inbox/[id] route. For the post scheduling form, collect the message text, select the target profile(s), and set a scheduled date/time. POST this to /api/agorapulse/posts. Show a success toast with the scheduled post's link after a successful response. For complex multi-profile campaigns or inbox moderation workflows, RapidDev can help architect efficient data fetching and caching strategies for high-volume social accounts.

V0 Prompt

Update the social inbox component to fetch profiles from /api/agorapulse/profiles on mount and populate the sidebar. When a profile is clicked, fetch /api/agorapulse/inbox?profileId={id} and populate the conversation list. When a status tab is clicked (All/Unanswered/Assigned), re-fetch with the status parameter. Show a loading spinner in the conversation list during fetch. Add infinite scroll: when the user scrolls to the bottom, check for nextCursor and fetch the next page, appending items to the list.

Paste this in V0 chat

app/components/SocialInbox.tsx
1'use client';
2
3import { useEffect, useState, useCallback } from 'react';
4
5interface InboxItem {
6 id: string;
7 author: { name: string; avatar?: string };
8 message: string;
9 platform: string;
10 created_at: string;
11 status: string;
12}
13
14interface Profile {
15 id: string;
16 name: string;
17 network: string;
18}
19
20export default function SocialInbox() {
21 const [profiles, setProfiles] = useState<Profile[]>([]);
22 const [selectedProfileId, setSelectedProfileId] = useState<string | null>(null);
23 const [items, setItems] = useState<InboxItem[]>([]);
24 const [nextCursor, setNextCursor] = useState<string | null>(null);
25 const [loading, setLoading] = useState(false);
26 const [status, setStatus] = useState('inbox');
27
28 useEffect(() => {
29 fetch('/api/agorapulse/profiles')
30 .then((r) => r.json())
31 .then((d) => setProfiles(d.profiles || []));
32 }, []);
33
34 const fetchInbox = useCallback(async (cursor?: string) => {
35 setLoading(true);
36 const params = new URLSearchParams({ status });
37 if (selectedProfileId) params.set('profileId', selectedProfileId);
38 if (cursor) params.set('cursor', cursor);
39
40 const data = await fetch(`/api/agorapulse/inbox?${params}`).then((r) => r.json());
41 setItems((prev) => cursor ? [...prev, ...data.items] : data.items);
42 setNextCursor(data.nextCursor);
43 setLoading(false);
44 }, [selectedProfileId, status]);
45
46 useEffect(() => { fetchInbox(); }, [fetchInbox]);
47
48 return (
49 <div className="flex h-screen">
50 <div className="w-64 border-r p-4">
51 {profiles.map((p) => (
52 <button
53 key={p.id}
54 onClick={() => setSelectedProfileId(p.id)}
55 className={`w-full text-left p-2 rounded mb-1 ${selectedProfileId === p.id ? 'bg-blue-50' : ''}`}
56 >
57 {p.name}
58 </button>
59 ))}
60 </div>
61 <div className="flex-1 overflow-y-auto p-4">
62 {items.map((item) => (
63 <div key={item.id} className="border-b py-3">
64 <p className="font-medium">{item.author?.name}</p>
65 <p className="text-sm text-gray-600">{item.message}</p>
66 </div>
67 ))}
68 {nextCursor && (
69 <button onClick={() => fetchInbox(nextCursor)} className="mt-4 px-4 py-2 bg-gray-100 rounded">
70 Load more
71 </button>
72 )}
73 </div>
74 </div>
75 );
76}

Pro tip: Cache profile data in React state for the session rather than re-fetching on every tab switch — social profiles rarely change, and re-fetching the profiles list on every filter interaction creates unnecessary API calls.

Expected result: The inbox component displays real Agorapulse inbox items, grouped by the selected profile and filtered by status. Pagination loads additional inbox items when requested. The profile sidebar shows all connected social accounts.

5

Set Environment Variables in Vercel and Deploy

Your Agorapulse API key must be stored as a server-only environment variable — no NEXT_PUBLIC_ prefix. Add AGORAPULSE_API_KEY to your Vercel project under Settings → Environment Variables. Apply it to both Production and Preview environments. For local development, add it to your .env.local file (never commit this file). After saving the variable, push your code to GitHub to trigger a Vercel deployment. Once deployed, navigate to your production URL and verify that social profiles appear in the sidebar and inbox items load correctly. Test the post scheduling form by submitting a test post scheduled for a few minutes in the future and confirming it appears in your Agorapulse publishing queue. Check the Vercel Function Logs (Dashboard → Your Project → Functions tab) for any API errors. Common issues at this stage are 401 Unauthorized (wrong API key or missing env var) and 403 Forbidden (your Agorapulse plan doesn't include API access). If you're on Agorapulse's free plan, upgrade to Medium or above to unlock API credentials.

.env.local
1# .env.local never commit this file
2# Agorapulse credentials (server-only, no NEXT_PUBLIC_ prefix)
3AGORAPULSE_API_KEY=your_agorapulse_api_key_here

Pro tip: Agorapulse API keys are tied to a specific user account in your workspace. If that user's account is deactivated or their permissions change, the API key will stop working. Consider creating a dedicated 'API integration' user in Agorapulse for service accounts.

Expected result: AGORAPULSE_API_KEY is set in Vercel. The deployed app loads social profiles and inbox data from Agorapulse. Post scheduling via the form creates entries in Agorapulse's publishing queue.

Common use cases

Unified Social Inbox Dashboard

Build a custom inbox view showing all unanswered comments, messages, and mentions across every social network your brand uses — Facebook, Instagram, LinkedIn, and Twitter/X — in a single chronological feed. Agents or community managers can reply, assign conversations, and mark items as done from the interface.

V0 Prompt

Create a social inbox page with a sidebar listing connected social profiles (each with a platform icon, profile name, and unread badge count). The main panel shows a list of conversation items with: platform icon, author avatar and name, message preview text, timestamp, and status badge (New/Replied/Assigned). Clicking a conversation opens a thread view on the right. Add tabs at the top for All, Unanswered, and Assigned. Fetch from /api/agorapulse/inbox.

Copy this prompt to try it in V0

Content Publishing Calendar

Build a visual content calendar showing scheduled and published social media posts across all connected profiles. Display posts in a week or month view with color-coded labels per platform. Add a compose button that opens a form to schedule new posts via the Agorapulse API.

V0 Prompt

Build a content calendar page with a monthly calendar view. Each day cell shows colored post blocks for scheduled content (blue = draft, green = scheduled, gray = published). Each block shows the platform icon and post preview text. A panel on the right shows today's post queue. Add a New Post button that opens a modal with a text editor, image upload, platform selector (multi-select checkboxes), and scheduled date/time picker. Submit to /api/agorapulse/posts.

Copy this prompt to try it in V0

Social Engagement Report

Build a reporting dashboard showing engagement metrics from all connected social profiles: total impressions, replies, mentions, follower growth, and response time averages for a selected date range. Useful for monthly client reports or team performance reviews.

V0 Prompt

Create a social media report page with a date range picker at the top (last 7, 30, or 90 days). Below show a metrics grid with cards for: Total Messages Received, Average Response Time (in hours), Mentions, Comments, Engagement Rate, and New Followers. Then a bar chart showing daily message volume by platform. Fetch from /api/agorapulse/reports?days=30.

Copy this prompt to try it in V0

Troubleshooting

API routes return 401 Unauthorized from the Agorapulse API

Cause: The AGORAPULSE_API_KEY environment variable is missing, incorrect, or the key has been revoked in Agorapulse's Developer Settings.

Solution: Verify that AGORAPULSE_API_KEY is correctly set in Vercel Settings → Environment Variables and matches exactly what Agorapulse shows in your Developer Settings. Regenerate the API key in Agorapulse if unsure. Make sure there are no leading or trailing spaces in the key value when pasting into Vercel.

Inbox returns an empty array even though messages exist in Agorapulse

Cause: The profileId parameter may be missing or incorrect, or the status filter doesn't match any items. Agorapulse organizes inbox items per social profile, so querying without a valid profileId may return nothing.

Solution: First test the /api/agorapulse/profiles route to confirm profile IDs are being fetched correctly. Log one of those IDs and use it explicitly in a test request to /api/agorapulse/inbox?profileId=ID. Also try removing the status filter to see all inbox items regardless of status.

typescript
1// Test with an explicit profile ID and no status filter
2const data = await agorapulseFetch(`/inbox?profile_id=${profileId}&limit=5`);
3console.log('Raw inbox response:', JSON.stringify(data, null, 2));

Scheduled post creation returns 422 Unprocessable Entity from Agorapulse

Cause: The request body is missing required fields, the scheduled_at time is in the past, or the profile doesn't support the content type being posted (e.g., posting a video URL to a profile that doesn't support video).

Solution: Log the full request body before sending it to Agorapulse and verify that profile_id, text, and scheduled_at are all present. The scheduled_at field must be in ISO 8601 format and at least a few minutes in the future. Check that the target social profile is still connected and has posting permissions in Agorapulse.

typescript
1// Ensure scheduledAt is in the future
2const scheduledAt = new Date(Date.now() + 5 * 60 * 1000).toISOString(); // 5 minutes from now
3console.log('Scheduling post for:', scheduledAt);

API calls succeed in development (.env.local) but fail in the Vercel deployment with 401

Cause: The environment variable was added to Vercel but not deployed yet — environment variable changes in Vercel require a redeployment to take effect.

Solution: After adding or updating environment variables in Vercel Settings → Environment Variables, trigger a new deployment by pushing a commit to GitHub or clicking Redeploy on the latest deployment in the Vercel Dashboard. Without a redeployment, serverless functions continue to use the previous environment snapshot.

Best practices

  • Never use NEXT_PUBLIC_ prefix for your Agorapulse API key — it must stay server-only to prevent exposure in client-side JavaScript bundles
  • Implement cursor-based pagination for inbox fetching rather than loading all items at once — social inboxes with thousands of messages will time out serverless functions if paginated incorrectly
  • Cache social profile lists in your React component's state for the session duration — profiles don't change frequently and repeated fetches slow down the inbox navigation experience
  • Include the platform name alongside each inbox item in your UI — visual indicators help agents quickly recognize which network they're responding on before opening the thread
  • Test post scheduling with times well in the future during development to avoid 422 validation errors from the Agorapulse API
  • Log Agorapulse API response shapes during initial development — the API uses snake_case and nested data/meta response structures that differ from how V0 components typically expect data
  • Use Agorapulse's webhook feature to push inbox update notifications to your app rather than polling the API if real-time inbox updates are important for your workflow

Alternatives

Frequently asked questions

Does Agorapulse offer a free API access tier?

Agorapulse API access is available on Medium plan and above. The Standard plan does not include API access. If you need API integration, you'll need at least the Medium plan. For development and testing, Agorapulse offers a trial period on paid plans where API access is included.

Can I use the Agorapulse API to manage multiple social profiles from different clients?

Yes. If your Agorapulse account has multiple social profiles connected — common for agencies managing multiple brand accounts — the API returns all profiles with their IDs. You can filter inbox and publishing API requests by profileId to operate on specific profiles. Each profile belongs to your Agorapulse workspace, so your API key has access to all profiles in your workspace.

Can I reply to social media messages through the Agorapulse API from my V0 app?

Yes. Agorapulse's API includes endpoints for replying to inbox conversations. You POST the reply content with the parent conversation ID to the appropriate endpoint. The reply is sent through Agorapulse to the original social network — your API key must have posting permissions on the connected social profile for replies to go through successfully.

Does V0 have a native Agorapulse integration?

V0 does not have a native Agorapulse connector in the Vercel Marketplace. Agorapulse integrates via the standard Next.js API Route pattern — set your API key as a Vercel environment variable, create API route handlers using fetch with Bearer token authorization, and connect them to your V0-generated React components.

How do I handle Agorapulse API rate limits in my dashboard?

Agorapulse enforces rate limits on API requests — check their current API documentation for specific limits. For dashboards with multiple users loading inbox data simultaneously, add server-side caching with a 30–60 second TTL using Next.js unstable_cache or Vercel's fetch cache. For individual user views, client-side polling at a 60-second interval is generally safe and keeps the inbox reasonably fresh without hitting rate limits.

What social networks does the Agorapulse API support?

Agorapulse's API covers all networks supported by the platform: Facebook Pages and Groups, Instagram Business accounts, Twitter/X, LinkedIn Company Pages and personal profiles, YouTube channels, TikTok business accounts, and Google Business Profile. The specific API endpoints and available data fields vary by network due to differences in each platform's API permissions.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.