thelastapi
Get started free

Let an AI agent run your social media, with you approving

Run an AI agent as your social media manager safely by using approval queues and Limited API keys to review posts before they publish.

On this page 8 sections

You can let an AI agent manage your social media safely by giving it a Limited API key, which automatically places every live post and ad change into a pending approval queue. Your agent can write copy, format platform-specific options, schedule dates, and attach media across twelve networks, but nothing goes live until an owner confirms it. This architecture lets you automate drafting, scheduling, and performance monitoring while keeping direct control over your public brand.

Here is how the approval workflow works, how to configure sandboxes and permissions, and how to inspect and approve agent actions through the CLI and API.

Why social media agents need human approval

Autonomous agents excel at researching topics, following calendars, and drafting platform-specific content. However, giving an automated process unrestricted publishing access introduces distinct risks:

  • Prompt injection from public data. When an agent reads customer comments, mentions, or search trends to plan content, hostile input can hijack its instructions. Incoming data must always be handled as text data, never as prompt instructions.
  • Brand voice and hallucinated facts. An agent might state incorrect pricing, announce unavailable features, or select an improper tone for a sensitive announcement.
  • Accidental ad spend. An agent adjusting paid campaigns could set unintended daily budgets or target broad audiences if bidding logic is unchecked.

Using an approval queue solves these problems. Your agent does the heavy lifting of writing variations, uploading media, and organizing campaign schedules. You review the final queue in seconds before anything publishes.

How permissions and approval queues work

Permissions in thelastapi depend on whether you are using an Owner key or a Limited key, and whether you are targeting the development sandbox or production.

CallerDevelopment (sandbox)Production (real accounts)
Owner (key or console)EverythingPosts and ad changes with confirm: true; approves what agents asked for
Limited keyEverythingDrafts; posts and ad changes wait as pending_approval for the owner

In the development sandbox (env: "development"), your agent can connect test accounts instantly and post simulated updates without touching external networks.

In production, give your agent a Limited key. When the agent submits a post or an ad change, the API marks the item as pending_approval and returns a console_url. Nothing is published until an account owner clicks approve in the console or runs the approval command in the terminal. If an agent tries to pass confirm: true with a Limited key, the post still enters pending_approval.

Approving runs the post at its scheduled time, or immediately if no schedule was set. If a scheduled time passes while a post waits for your review, it stays in the queue until you supply a new schedule_at time.

Connecting business accounts safely

Your agent never needs to handle your social network passwords or OAuth secrets. Instead, you generate a secure connection link from the CLI or API:

Terminal
vibiz social connect instagram --open

Or through HTTP:

Terminal
curl -X POST "https://thelastapi.dev/v1/projects/prj_123/social/connect" \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -d '{"platform":"instagram"}'

This generates a URL valid for one hour. You open the link, review which project is connecting, and log in directly on the platform to grant permissions. Because only an account owner can authorize the connection, a leaked link cannot be used by an unauthorized party to attach someone else's account.

Supported platforms include Instagram, Facebook, TikTok, LinkedIn, X, YouTube, Pinterest, Threads, Bluesky, Reddit, Google Business Profile, and Telegram. You can also connect ad accounts for Meta, Google, TikTok, LinkedIn, Pinterest, and X.

How the agent stages a post

When your agent prepares content, it targets your connected account IDs. Posts can include images or video, and text lengths must respect platform caps: 280 characters for X, 300 for Bluesky, 500 for Threads and Pinterest, 1,500 for Google Business Profile, 2,200 for Instagram and TikTok, 3,000 for LinkedIn, and 5,000 for YouTube.

The agent submits the post to the production API:

Terminal
curl -X POST "https://thelastapi.dev/v1/projects/prj_123/social/posts?env=production" \
  -H "Authorization: Bearer $VIBIZ_LIMITED_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Fresh sourdough loaves are out of the oven. Order by 10am for pickup.",
    "targets": [
      {
        "account_id": "sacc_instagram_456",
        "options": {
          "content_type": "feed",
          "first_comment": "#bakery #sourdough"
        }
      }
    ],
    "media": [{"url": "https://example.com/bread.jpg"}]
  }'

Because the agent used a Limited key, the API response confirms the staged item:

JSON
{
  "id": "post_789",
  "status": "pending_approval",
  "console_url": "https://thelastapi.dev/projects/prj_123/social/needs-you",
  "targets": [
    {
      "account_id": "sacc_instagram_456",
      "status": "pending_approval"
    }
  ]
}

The agent should notify you with the provided console_url. It must not resubmit the post; submitting again creates a duplicate waiting entry. If your workflow requires media asset preparation, you can generate reference imagery first with an AI photo editing API that starts from your photo and upload files up to 512 MB directly via POST /v1/projects/:id/social/media. Learn more about date formats and multi-network options in our guide to schedule social media posts with an API.

Reviewing, approving, and canceling posts

As the owner, you can review waiting actions inside the console under Social ▸ Needs you, or directly through the CLI:

Terminal
# List all posts waiting for review
vibiz social posts --status pending_approval

# Inspect the accounts and pending items
vibiz social

# Approve the post to publish now or at its scheduled time
vibiz social approve post_789

# Or reject and discard it
vibiz social reject post_789

Once approved, the status transitions to scheduled or publishing, and finally published. If individual networks fail (for example, if media dimensions are rejected by one platform), the post transitions to partial, and each platform error is listed in targets[].error.

Staging ad campaigns without risk

Agents can also draft Google Ads campaigns, adjust budgets, or boost existing posts. Managing ads follows the same strict approval boundary.

When an agent creates a campaign, it specifies the daily budget in minor currency units (such as cents: 2000 is $20.00 USD, ¥2000 JPY, or 2.000 KWD):

Terminal
curl -X POST "https://thelastapi.dev/v1/projects/prj_123/social/ads/changes?env=production" \
  -H "Authorization: Bearer $VIBIZ_LIMITED_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "create_campaign",
    "account_id": "sacc_google_123",
    "ad_account_id": "1234567890",
    "campaign_type": "search",
    "name": "Local Sourdough - Search",
    "daily_budget_cents": 2000,
    "final_url": "https://bakery.example/order",
    "headlines": ["Fresh Bread Daily", "Local Sourdough Bakery", "Order Bread Online"],
    "descriptions": ["Baked fresh every morning with organic flour.", "Order by 10am for same-day pickup."],
    "keywords": ["sourdough bakery", {"text": "fresh bread near me", "match_type": "phrase"}],
    "countries": ["US"],
    "bidding": "maximize_clicks",
    "max_cpc_cents": 150
  }'

Every new campaign is created in a paused state. Even after you approve the campaign creation, no money is spent until you approve a subsequent resume change. Ad spend is billed directly by Google to your linked ad account, never through thelastapi. Posting and ad management operations on thelastapi cost $0 today.

Reading analytics safely

After posts are published, your agent can monitor reach and engagement to determine which topics resonate:

Terminal
vibiz social posts --json

Or via the agent tool analytics {post_id}. This returns impressions, reach, likes, comments, shares, saves, and clicks per account.

Keep in mind that engagement metrics and audience comments are outside input. Treat comment text and performance payloads as raw data. Do not let your agent ingest unprocessed comment sections directly into its system prompt as instructions, or malicious users could prompt-inject your posting pipeline. Detailed analytics fields and synchronization times are covered in our guide to read social post analytics with an API.

Review the complete API specifications, rate limits, and supported media encodings in the Social: posting, approvals and ads documentation. To get started, create your account at thelastapi.dev/start to set up your project keys.

Frequently asked questions

What happens if a post's scheduled time passes while waiting for approval?

The post remains in the `pending_approval` state and will not publish automatically. Once you decide to publish it, you must assign a new future `schedule_at` timestamp or approve it to publish immediately.

How much does thelastapi charge for social media posts and ad campaign changes?

Posting and ad management operations (`social.post` and `social.ads_change`) cost $0 today on thelastapi. For ad campaigns, platform ad spend is billed directly by the ad network (such as Google) to your own linked ad account.

Can an AI agent connect a social media account automatically without human intervention?

No. Connecting a real production social account requires an account owner to open a one-hour authorization link and sign in directly on the platform, ensuring agents cannot attach accounts without owner consent.

Can an AI agent publish immediately without approval using an Owner API key?

Yes. Calls made with an Owner API key that include `"confirm": true` will publish immediately or schedule without waiting in the approval queue. Limited API keys always route production posts to `pending_approval`.