pfm_create_social_account
Create or update a social media account by platform and user ID using OAuth tokens from your own auth flow, preventing duplicates with upsert logic.
Instructions
Create a social account directly (upsert by platform + user_id). If an account with the same platform and user_id already exists, it is updated. Use this when you have OAuth tokens from your own auth flow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | The platform's user ID for this account | |
| metadata | No | Custom metadata for the account | |
| platform | Yes | Social media platform | |
| username | No | Platform username | |
| external_id | No | Your unique identifier for this account | |
| access_token | Yes | OAuth access token | |
| refresh_token | No | OAuth refresh token | |
| access_token_expires_at | Yes | ISO 8601 datetime when access token expires | |
| refresh_token_expires_at | No | ISO 8601 datetime when refresh token expires |