Connect Accounts

Link social media accounts to your PostPeer project via OAuth.

Overview

Before you can post to a platform, you need to connect a social account. PostPeer handles all OAuth flows — your users authorize on the platform, and we store the tokens securely.

Connect Twitter/X

curl https://api.postpeer.dev/v1/connect/twitter \
  -H "x-access-key: YOUR_API_KEY"

Response:

{
  "url": "https://twitter.com/i/oauth2/authorize?response_type=code&client_id=..."
}

Redirect the user to the returned url. After they authorize, Twitter redirects to PostPeer's callback, and the account is connected to your project.

Connect Instagram

curl https://api.postpeer.dev/v1/connect/instagram \
  -H "x-access-key: YOUR_API_KEY"

Returns an OAuth URL for Facebook/Instagram authorization. The user must have an Instagram Business Account linked to a Facebook Page.

Note: Instagram publishing requires Meta App Review for the instagram_content_publish permission.

Connect YouTube

curl https://api.postpeer.dev/v1/connect/youtube \
  -H "x-access-key: YOUR_API_KEY"

Returns a Google OAuth URL for YouTube Data API v3 access. The user authorizes video upload permissions.

List Connected Accounts

curl https://api.postpeer.dev/v1/connect/integrations \
  -H "x-access-key: YOUR_API_KEY"

Response:

{
  "success": true,
  "integrations": [
    {
      "id": "abc123",
      "platform": "twitter",
      "platformUserId": "123456789",
      "createdAt": "2026-03-28T10:00:00Z"
    },
    {
      "id": "def456",
      "platform": "youtube",
      "platformUserId": "UCxxxxxxxx",
      "createdAt": "2026-03-28T10:05:00Z"
    }
  ]
}

Use the id field as the accountId when publishing posts.

On this page