Profiles

Overview

Manage your connected social media profiles

Profiles Overview

Profiles are the core concept in postcore - each profile represents one of your end-users and holds their social media connections.

What Are Profiles?

As a developer building a social media tool, you'll create a profile for each of your users. Each profile can connect to:

  • One LinkedIn account
  • One Bluesky account
  • (More platforms coming soon)

Example: If you're building a scheduler with 100 users, you'll have 100 profiles - one per user, each with their own social media connections.

Available Platforms

Currently supported:

  • LinkedIn - OAuth connection (60-day token expiry)
  • Bluesky - App password (never expires)

Additional platforms like Twitter/X, Facebook, Instagram, and more are in development.

Profile Structure

{
  "profileKey": "prof_abc123def456",
  "profileName": "John Smith Profile",
  "createdAt": "2025-01-01T12:00:00Z",
  "connectedPlatforms": [
    {
      "platform": "linkedin",
      "displayName": "John Smith",
      "username": "johnsmith",
      "connectedAt": "2025-01-01T12:30:00Z",
      "expiresAt": "2025-03-02T12:30:00Z",
      "daysUntilExpiry": 55,
      "needsReconnect": false
    },
    {
      "platform": "bluesky",
      "displayName": "johnsmith.bsky.social",
      "username": "johnsmith.bsky.social",
      "connectedAt": "2025-01-02T10:00:00Z",
      "expiresAt": null,
      "daysUntilExpiry": null,
      "needsReconnect": false
    }
  ]
}

Key Fields

FieldTypeDescription
profileKeystringUnique identifier for the profile
profileNamestringOptional descriptive name
createdAtstringWhen the profile was created
connectedPlatformsarrayConnected social media accounts

Platform Connection Fields

FieldTypeDescription
platformstringPlatform name (linkedin, bluesky)
displayNamestringUser's display name on the platform
usernamestringPlatform username/handle
connectedAtstringWhen connection was made
expiresAtstring|nullToken expiry (LinkedIn only)
daysUntilExpirynumber|nullDays until expiry (LinkedIn only)
needsReconnectbooleanWhether reconnection is needed

Profile Operations

Profile Lifecycle

Creating a Profile

Profiles can be created explicitly or auto-created during the first platform connection:

// Explicit creation
const { profileKey } = await fetch("https://api.postcore.dev/profiles/create", {
  method: "POST",
  headers: { "x-api-key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({ profileName: "User: john@example.com" }),
}).then((r) => r.json());

// Auto-created during connection (omit profileKey)
const { profileKey } = await fetch(
  "https://api.postcore.dev/profiles/connect",
  {
    method: "POST",
    headers: { "x-api-key": apiKey, "Content-Type": "application/json" },
    body: JSON.stringify({
      platform: "bluesky",
      credentials: {
        handle: "user.bsky.social",
        appPassword: "xxxx-xxxx-xxxx-xxxx",
      },
    }),
  }
).then((r) => r.json());

One Account Per Platform

Each profile can only have one account per platform. If a user wants to connect a different LinkedIn account, they must first disconnect the existing one or create a new profile.

Platform Differences

LinkedIn

  • Connection: OAuth redirect flow
  • Expiry: 60 days
  • Monitoring: Check needsReconnect field regularly
  • Rate Limit: 60 seconds between posts

Bluesky

  • Connection: App password (POST request)
  • Expiry: Never (unless user revokes)
  • Monitoring: needsReconnect always false
  • Rate Limit: 1 second between posts