# Connect Account (Step 3 of 3)

POST https://services.leadconnectorhq.com/social-media-posting/oauth/{locationId}/{platform}/accounts/{accountId}

## OAuth Connection Flow - Step 3: Connect the Account

This is the final step in the OAuth flow. After retrieving available accounts (Step 2), use this endpoint to connect the selected account to your location.

### OAuth Flow Summary

1. **Start OAuth** → User authenticates with platform
2. **Get Accounts** → Retrieved available pages/channels
3. **Attach Account** (this endpoint) → Connect the selected account

### Request Body

The accepted fields depend on the `platform` path parameter — pick the matching schema in the request body below. Most platforms take the `originId`, `name` and optional `avatar` of the account you selected in Step 2; Google Business Profile takes the full `location` and `account` objects.

> `tiktok-business` accounts are connected through the TikTok Business flow, not this endpoint.

### After Connection

Once connected, the account will appear in your location's connected accounts and can be used for social media posting.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `socialplanner/oauth.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `platform` | string | Yes | Social media platform. Must match the platform used in the preceding steps of the OAuth flow. |
| `locationId` | string | Yes | The Location ID where you want to connect this social account |
| `accountId` | string | Yes | The OAuth Account ID received from Step 1 (Start OAuth) via the window message event |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/social-media-posting/oauth/{locationId}/{platform}/accounts/{accountId}": {
      "post": {
        "summary": "Connect Account (Step 3 of 3)",
        "operationId": "connectAccountStep3Of3",
        "description": "## OAuth Connection Flow - Step 3: Connect the Account\n\nThis is the final step in the OAuth flow. After retrieving available accounts (Step 2), use this endpoint to connect the selected account to your location.\n\n### OAuth Flow Summary\n\n1. **Start OAuth** → User authenticates with platform\n2. **Get Accounts** → Retrieved available pages/channels\n3. **Attach Account** (this endpoint) → Connect the selected account\n\n### Request Body\n\nThe accepted fields depend on the `platform` path parameter — pick the matching schema in the request body below. Most platforms take the `originId`, `name` and optional `avatar` of the account you selected in Step 2; Google Business Profile takes the full `location` and `account` objects.\n\n> `tiktok-business` accounts are connected through the TikTok Business flow, not this endpoint.\n\n### After Connection\n\nOnce connected, the account will appear in your location's connected accounts and can be used for social media posting.",
        "parameters": [
          {
            "name": "platform",
            "required": true,
            "in": "path",
            "description": "Social media platform. Must match the platform used in the preceding steps of the OAuth flow.",
            "schema": {
              "example": "facebook",
              "enum": [
                "google",
                "facebook",
                "instagram",
                "threads",
                "bluesky",
                "linkedin",
                "tiktok",
                "tiktok-business",
                "youtube",
                "pinterest"
              ],
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "description": "The Location ID where you want to connect this social account",
            "schema": {
              "example": "w37swmmLbA02zgqKPpxITe2",
              "type": "string"
            }
          },
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "The OAuth Account ID received from Step 1 (Start OAuth) via the window message event",
            "schema": {
              "example": "w37swmmLbA02zgqKPpxITe",
              "type": "string"
            }
          },
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The account to connect. The accepted fields depend on the `platform` path parameter.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectAccountStep3Of3Dto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response - Account attached. Response structure varies by platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectAccountStep3Of3Response"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "Location-Access": [
              "socialplanner/oauth.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ConnectAccountStep3Of3Dto": {
        "oneOf": [
          {
            "title": "Facebook",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of Facebook account (must be page)",
                "example": "page",
                "enum": [
                  "page",
                  "group",
                  "profile",
                  "location",
                  "business"
                ]
              },
              "originId": {
                "type": "string",
                "description": "Original Facebook platform identifier",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Name of the Facebook page or account",
                "example": "JOHN_DEO"
              },
              "avatar": {
                "type": "string",
                "description": "Avatar or profile picture URL",
                "example": "https://storage.googleapis.com/2ad21ebc23/test"
              }
            }
          },
          {
            "title": "Instagram",
            "type": "object",
            "properties": {
              "originId": {
                "type": "string",
                "description": "Original platform-specific account identifier",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Display name of the account",
                "example": "JOHN_DEO"
              },
              "avatar": {
                "type": "string",
                "description": "Avatar or profile picture URL",
                "example": "https://storage.googleapis.com/2ad21ebc23/test"
              },
              "pageId": {
                "type": "string",
                "description": "Facebook page ID associated with the Instagram account",
                "example": "234234234242sd"
              }
            },
            "required": [
              "pageId"
            ]
          },
          {
            "title": "Linkedin",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of LinkedIn account (must be one of: page, profile)",
                "enum": [
                  "page",
                  "profile"
                ],
                "example": "page"
              },
              "originId": {
                "type": "string",
                "description": "Original LinkedIn platform identifier",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Name of the LinkedIn page or profile",
                "example": "JOHN_DEO"
              },
              "avatar": {
                "type": "string",
                "description": "Avatar or profile picture URL",
                "example": "https://storage.googleapis.com/2ad21ebc23/test"
              },
              "urn": {
                "type": "string",
                "description": "LinkedIn URN (Uniform Resource Name) identifier",
                "example": "urn:li:organization:80847980"
              }
            }
          },
          {
            "title": "Google Business Account",
            "type": "object",
            "properties": {
              "location": {
                "description": "Google My Business location details to attach",
                "example": {
                  "name": "locations/12345",
                  "title": "My Business Location",
                  "storeCode": "STORE123",
                  "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
                  "isConnected": true
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Location name",
                        "example": "accounts/114659701071209971352/locations/17909648580344584627"
                      },
                      "storeCode": {
                        "type": "string",
                        "description": "Store code",
                        "example": "STORE-001"
                      },
                      "title": {
                        "type": "string",
                        "description": "Location title",
                        "example": "My Business Location"
                      },
                      "storefrontAddress": {
                        "type": "object",
                        "description": "Storefront address details, passed through from the Google Business Profile location",
                        "example": {
                          "regionCode": "US",
                          "languageCode": "en",
                          "postalCode": "94043",
                          "administrativeArea": "CA",
                          "locality": "Mountain View",
                          "addressLines": [
                            "1600 Amphitheatre Pkwy"
                          ]
                        }
                      },
                      "metadata": {
                        "type": "object",
                        "description": "Additional location metadata, passed through from the Google Business Profile location",
                        "example": {
                          "hasVoiceOfMerchant": true,
                          "canOperateLocalPost": true,
                          "canHaveFoodMenus": false
                        }
                      },
                      "maxLocation": {
                        "type": "boolean",
                        "description": "Whether this is a max location",
                        "example": false
                      },
                      "isVerified": {
                        "type": "string",
                        "description": "Google Place ID indicating verification, or \"false\" if unverified",
                        "example": "ChIJsZQpj1qbXjkRQNDUG4UUx6k"
                      },
                      "isConnected": {
                        "type": "boolean",
                        "description": "Whether the location is connected",
                        "example": false
                      }
                    },
                    "required": [
                      "name",
                      "title"
                    ],
                    "title": "AttachGMBLocationLocationDTO"
                  }
                ]
              },
              "account": {
                "description": "Google My Business account details",
                "example": {
                  "name": "accounts/12345",
                  "accountName": "My Business Account",
                  "type": "LOCATION_GROUP",
                  "verificationState": "VERIFIED",
                  "vettedState": "VETTED"
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Account name identifier",
                        "example": "accounts/114659701071209971352"
                      },
                      "accountName": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "My Business Account"
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the account",
                        "example": "PERSONAL"
                      },
                      "verificationState": {
                        "type": "string",
                        "description": "State of account verification",
                        "example": "VERIFIED"
                      },
                      "vettedState": {
                        "type": "string",
                        "description": "Vetting state of the account",
                        "example": "NOT_VETTED"
                      }
                    },
                    "required": [
                      "name",
                      "accountName",
                      "type",
                      "verificationState",
                      "vettedState"
                    ],
                    "title": "AttachGMBLocationAccountDTO"
                  }
                ]
              }
            }
          },
          {
            "title": "Pinterest",
            "type": "object",
            "properties": {
              "originId": {
                "type": "string",
                "description": "Pinterest origin account id",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Pinterest account display name",
                "example": "Ayush"
              },
              "avatar": {
                "type": "string",
                "description": "Avatar URL",
                "example": "https://i.pinimg.com/example-avatar.jpg"
              },
              "verified": {
                "type": "boolean",
                "description": "Verification status",
                "example": true
              },
              "username": {
                "type": "string",
                "description": "Username",
                "example": "@ayush"
              },
              "websiteUrl": {
                "type": "string",
                "description": "Website URL",
                "example": "https://www.website.com"
              },
              "type": {
                "type": "string",
                "description": "Account type must be one of the following values: profile",
                "enum": [
                  "profile"
                ],
                "example": "profile"
              },
              "originAccountType": {
                "type": "string",
                "description": "Origin account type",
                "example": "business"
              }
            },
            "required": [
              "originId",
              "name",
              "verified",
              "username",
              "websiteUrl"
            ]
          },
          {
            "title": "Threads",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Account type. Threads accounts always connect as `profile`.",
                "enum": [
                  "profile"
                ],
                "example": "profile"
              },
              "originId": {
                "type": "string",
                "description": "Threads profile ID to connect, taken from Get Accounts.",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Display name of the profile to connect",
                "example": "JOHN_DEO"
              },
              "avatar": {
                "type": "string",
                "description": "Profile avatar URL",
                "example": "https://storage.googleapis.com/2ad21ebc23/test"
              }
            }
          },
          {
            "title": "Bluesky",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Account type. Bluesky accounts always connect as `profile`.",
                "enum": [
                  "profile"
                ],
                "example": "profile"
              },
              "originId": {
                "type": "string",
                "description": "Bluesky DID (decentralized identifier) of the profile to connect, taken from Get Accounts.",
                "example": "did:plc:abc123"
              },
              "name": {
                "type": "string",
                "description": "Display name of the profile to connect",
                "example": "John Doe"
              },
              "avatar": {
                "type": "string",
                "description": "Profile avatar URL",
                "example": "https://example.com/avatar.jpg"
              },
              "handle": {
                "type": "string",
                "description": "Bluesky handle of the profile",
                "example": "handle.bsky.social"
              }
            }
          },
          {
            "title": "Tiktok",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of TikTok account (defaults to business)",
                "enum": [
                  "profile",
                  "business"
                ],
                "example": "business",
                "default": "business"
              },
              "originId": {
                "type": "string",
                "description": "Original platform-specific account identifier",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Display name of the account",
                "example": "JOHN_DEO"
              },
              "avatar": {
                "type": "string",
                "description": "Avatar or profile picture URL",
                "example": "https://storage.googleapis.com/2ad21ebc23/test"
              },
              "verified": {
                "type": "boolean",
                "description": "Indicates if the TikTok account is verified",
                "example": true
              },
              "username": {
                "type": "string",
                "description": "Username or handle of the TikTok account",
                "example": "JOHN_DEO"
              },
              "connectionSource": {
                "type": "string",
                "description": "Source that connected the TikTok account",
                "enum": [
                  "integration",
                  "social_media_posting"
                ],
                "example": "social_media_posting"
              }
            }
          },
          {
            "title": "YouTube",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Account type",
                "enum": [
                  "profile"
                ],
                "example": "profile"
              },
              "originId": {
                "type": "string",
                "description": "Origin ID",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Name",
                "example": "Ayush"
              },
              "avatar": {
                "type": "string",
                "description": "Avatar URL",
                "example": "https://yt3.ggpht.com/example-avatar"
              },
              "verified": {
                "type": "boolean",
                "description": "Whether the YouTube channel is verified",
                "example": true
              },
              "username": {
                "type": "string",
                "description": "YouTube channel handle",
                "example": "@ayush"
              }
            }
          }
        ]
      },
      "ConnectAccountStep3Of3Response": {
        "oneOf": [
          {
            "title": "Facebook",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Whether the Facebook page was successfully attached to the requesting location",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Human-readable message confirming the account was attached",
                "example": "Added Facebook Account"
              },
              "results": {
                "description": "The connected account record created (or updated) for the page that was just attached.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "u37swmmLbA02zgqKPpxITe2",
                  "locationId": "u37swmmLbA02zgqKPpxITe2",
                  "platform": "facebook",
                  "type": "page",
                  "name": "Account Name",
                  "active": true
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Unique identifier of the connected social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier for backward compatibility",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID associated with this account",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "Original platform-specific account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "example": "facebook",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the connected account: `page` when attached through the standard page flow (Attach Account), or `group` when attached through the group-posting flow (Attach Facebook Page to Group).",
                        "example": "page",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "Account Name"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar or profile picture URL",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "meta": {
                        "type": "object",
                        "description": "Empty for a page attached through the standard page flow. For an account attached through the group-posting flow, holds the underlying page's `id`/`name`/`avatar` when the group is posted as a page rather than as the user themself.",
                        "example": {}
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Indicates if the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Indicates if the account has been deleted",
                        "example": true
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaFacebookAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Tiktok Business",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Success or Failure",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Message",
                "example": "Added Tiktok Account"
              },
              "results": {
                "description": "The connected account record just created or updated by this Attach Account call.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "u37swmmLbA02zgqKPpxITe2",
                  "locationId": "u37swmmLbA02zgqKPpxITe2",
                  "platform": "tiktok",
                  "type": "profile",
                  "name": "Account Name",
                  "active": true
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Unique identifier of the connected social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier for backward compatibility",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID associated with this account",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "Original platform-specific account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ],
                        "example": "tiktok"
                      },
                      "type": {
                        "type": "string",
                        "description": "type must be one of the following values: profile, business",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ],
                        "example": "profile"
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "Account Name"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar or profile picture URL",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "meta": {
                        "type": "object",
                        "description": "Additional metadata for the account",
                        "example": {
                          "pageId": "u37swmmLbA02zgqKPpxITe2",
                          "page": {
                            "id": "u37swmmLbA02zgqKPpxITe2",
                            "name": "Account Name",
                            "avatar": "u37swmmLbA02zgqKPpxITe2"
                          },
                          "storeCode": "122",
                          "isVerified": "true",
                          "verified": true,
                          "protected": true,
                          "locationId": "u37swmmLbA02zgqKPpxITe2",
                          "accountId": "u37swmmLbA02zgqKPpxITe2",
                          "openId": "u37swmmLbA02zgqKPpxITe2",
                          "urn": "u37swmmLbA02zgqKPpxITe2",
                          "username": "testUser",
                          "storefrontAddress": {
                            "regionCode": "30021",
                            "languageCode": "E001",
                            "postalCode": "1221",
                            "administrativeArea": "Down Town",
                            "locality": "Louis Street",
                            "addressLines": [
                              "207",
                              "county"
                            ]
                          }
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Indicates if the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Indicates if the account has been deleted",
                        "example": true
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaTiktokAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Google Business Account",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Whether the Google location was successfully attached to the requesting location",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Human-readable message confirming the account was attached",
                "example": "Added Google Business Account"
              },
              "results": {
                "description": "The connected account record created (or updated) for the location that was just attached.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "u37swmmLbA02zgqKPpxITe2",
                  "locationId": "u37swmmLbA02zgqKPpxITe2",
                  "platform": "google",
                  "type": "location",
                  "name": "Account Name",
                  "active": true
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Unique identifier of the connected social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier for backward compatibility",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID associated with this account",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "Original platform-specific account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ],
                        "example": "google"
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of account (e.g., location, page, profile)",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ],
                        "example": "location"
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "Account Name"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar or profile picture URL",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "meta": {
                        "type": "object",
                        "description": "The Google location and account names submitted in the Attach Account request body, plus the store code, verification flag and address that were on the chosen location — set once at attach time and not refreshed afterwards.",
                        "example": {
                          "locationId": "locations/17909648580344584627",
                          "accountId": "accounts/114659701071209971352",
                          "storeCode": "STORE-001",
                          "isVerified": "true"
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Indicates if the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Indicates if the account has been deleted",
                        "example": true
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialGoogleMediaAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Linkedin",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Success or Failure",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 200
              },
              "message": {
                "type": "string",
                "description": "Message",
                "example": "Added LinkedIn Account"
              },
              "results": {
                "description": "The connected account record just created or updated by this Attach Account call.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "name": "Acme LinkedIn Page",
                  "platform": "linkedin",
                  "type": "page"
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Unique identifier of the connected account record, generated when the page or profile is first attached. Use it as accountId in later calls such as Update Account Meta.",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "ID of the LinkedIn OAuth record (the stored token pair) this account authenticates through.",
                        "example": "65f2d989a4f2f1e5322c3850"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Composite legacy key built as {oAuthId}_{locationId}_{originId}_{type}, kept for backward compatibility with integrations that stored this format before _id was used as the account reference.",
                        "example": "65f2d989a4f2f1e5322c3850_w37swmmLbA02zgqKPpxITe2_80847980_page"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location the account is connected to.",
                        "example": "w37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "LinkedIn page or member ID this account represents — the same value sent as originId in the Attach Account request.",
                        "example": "80847980"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Always 'linkedin' for a LinkedIn connected account.",
                        "example": "linkedin",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "description": "'page' for a LinkedIn Company Page or 'profile' for a personal LinkedIn member — the only two account types LinkedIn supports.",
                        "example": "profile",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the page or profile, copied from the Attach Account request body.",
                        "example": "Profile Name"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar image URL. If the Attach Account request included one, the backend downloads it and returns its own stable URL instead of the original one.",
                        "example": "https://storage.example.com/social-media-posting/linkedin/profile/65f2d989a4f2f1e5322c3856.jpg"
                      },
                      "meta": {
                        "type": "object",
                        "description": "LinkedIn-specific metadata. For LinkedIn this is always the urn of the connected page or profile.",
                        "example": {
                          "urn": "urn:li:organization:80847980"
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "True while the account is connected and its token is valid; false once it needs to be reconnected.",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "True once the account has been soft-deleted (disconnected); deleted accounts are excluded from Get Accounts results.",
                        "example": false
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "Timestamp the account was first attached.",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "Timestamp of the most recent update to this record.",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaLinkedInAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Instagram",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Whether the Instagram account was successfully attached to the requesting location",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Human-readable message confirming the account was attached",
                "example": "Added Instagram Account"
              },
              "results": {
                "description": "The connected account record created (or updated) for the Instagram account that was just attached.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "u37swmmLbA02zgqKPpxITe2",
                  "locationId": "u37swmmLbA02zgqKPpxITe2",
                  "platform": "instagram",
                  "type": "profile",
                  "name": "Profile Name",
                  "active": true
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Unique identifier of the connected social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier for backward compatibility",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID associated with this account",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "Original platform-specific account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "example": "instagram",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the connected account — always `profile` for Instagram.",
                        "example": "profile",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "Profile Name"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar or profile picture URL",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "meta": {
                        "type": "object",
                        "description": "Records how this account was connected, set once at attach time: `{ pageId, loginType: 'facebook' }` when connected via a linked Facebook Page, or `{ loginType: 'instagram' }` (no `pageId`) when connected via direct Instagram login.",
                        "example": {
                          "pageId": "234234234242sd",
                          "loginType": "facebook"
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Indicates if the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Indicates if the account has been deleted",
                        "example": true
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaInstagramAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Threads",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Success or Failure",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Message",
                "example": "Added Threads Account"
              },
              "results": {
                "description": "The connected account record that was created or updated.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "u37swmmLbA02zgqKPpxITe2",
                  "locationId": "u37swmmLbA02zgqKPpxITe2",
                  "originId": "u37swmmLbA02zgqKPpxITe2",
                  "platform": "threads",
                  "type": "profile",
                  "name": "John Doe",
                  "avatar": "https://example.com/avatar.jpg",
                  "active": true,
                  "deleted": false
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "MongoDB document ID of the social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier for backward compatibility",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID associated with this account",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "Original platform-specific account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ],
                        "example": "threads"
                      },
                      "type": {
                        "type": "string",
                        "description": "type value must be profile",
                        "example": "profile",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "John Doe"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar or profile picture URL",
                        "example": "https://example.com/avatar.jpg"
                      },
                      "meta": {
                        "type": "object",
                        "description": "Additional metadata for the account",
                        "example": {
                          "pageId": "u37swmmLbA02zgqKPpxITe2",
                          "page": {
                            "id": "u37swmmLbA02zgqKPpxITe2",
                            "name": "Account Name",
                            "avatar": "u37swmmLbA02zgqKPpxITe2"
                          },
                          "storeCode": "122",
                          "isVerified": "true",
                          "verified": true,
                          "protected": true,
                          "locationId": "u37swmmLbA02zgqKPpxITe2",
                          "accountId": "u37swmmLbA02zgqKPpxITe2",
                          "openId": "u37swmmLbA02zgqKPpxITe2",
                          "urn": "u37swmmLbA02zgqKPpxITe2",
                          "username": "testUser",
                          "storefrontAddress": {
                            "regionCode": "30021",
                            "languageCode": "E001",
                            "postalCode": "1221",
                            "administrativeArea": "Down Town",
                            "locality": "Louis Street",
                            "addressLines": [
                              "207",
                              "county"
                            ]
                          }
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Indicates if the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Indicates if the account has been deleted",
                        "example": true
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaThreadsAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "YouTube",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Success or Failure",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Message",
                "example": "Added Youtube Account"
              },
              "results": {
                "description": "The connected account record that was created or updated.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "w37swmmLbA02zgqKPpxITe2",
                  "locationId": "w37swmmLbA02zgqKPpxITe2",
                  "originId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
                  "platform": "youtube",
                  "type": "profile",
                  "name": "Account Name",
                  "avatar": "https://yt3.ggpht.com/sample-channel-avatar=s240-c-k-c0x00ffffff-no-rj",
                  "meta": {
                    "verified": true,
                    "username": "@username"
                  },
                  "active": true,
                  "deleted": false
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Document ID of the connected social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "w37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier retained for backward compatibility",
                        "example": "w37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID this account is connected to",
                        "example": "w37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "YouTube channel ID",
                        "example": "UC_x5XG1OV2P6uZZ5FSM9Ttw"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ],
                        "example": "youtube"
                      },
                      "type": {
                        "type": "string",
                        "description": "Account type. YouTube channels always connect as `profile`.",
                        "enum": [
                          "profile"
                        ],
                        "example": "profile"
                      },
                      "name": {
                        "type": "string",
                        "description": "Channel display name",
                        "example": "Account Name"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Channel avatar URL",
                        "example": "https://yt3.ggpht.com/sample-channel-avatar=s240-c-k-c0x00ffffff-no-rj"
                      },
                      "meta": {
                        "type": "object",
                        "description": "Additional channel metadata captured at connect time",
                        "example": {
                          "verified": true,
                          "username": "@username"
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Whether the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Whether the account has been deleted",
                        "example": false
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "Created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "Updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaYoutubeAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Tiktok",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Success or Failure",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Message",
                "example": "Added Tiktok Account"
              },
              "results": {
                "description": "The connected account record just created or updated by this Attach Account call.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "u37swmmLbA02zgqKPpxITe2",
                  "locationId": "u37swmmLbA02zgqKPpxITe2",
                  "platform": "tiktok",
                  "type": "profile",
                  "name": "Account Name",
                  "active": true
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Unique identifier of the connected social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier for backward compatibility",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID associated with this account",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "Original platform-specific account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ],
                        "example": "tiktok"
                      },
                      "type": {
                        "type": "string",
                        "description": "type must be one of the following values: profile, business",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ],
                        "example": "profile"
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "Account Name"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar or profile picture URL",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "meta": {
                        "type": "object",
                        "description": "Additional metadata for the account",
                        "example": {
                          "pageId": "u37swmmLbA02zgqKPpxITe2",
                          "page": {
                            "id": "u37swmmLbA02zgqKPpxITe2",
                            "name": "Account Name",
                            "avatar": "u37swmmLbA02zgqKPpxITe2"
                          },
                          "storeCode": "122",
                          "isVerified": "true",
                          "verified": true,
                          "protected": true,
                          "locationId": "u37swmmLbA02zgqKPpxITe2",
                          "accountId": "u37swmmLbA02zgqKPpxITe2",
                          "openId": "u37swmmLbA02zgqKPpxITe2",
                          "urn": "u37swmmLbA02zgqKPpxITe2",
                          "username": "testUser",
                          "storefrontAddress": {
                            "regionCode": "30021",
                            "languageCode": "E001",
                            "postalCode": "1221",
                            "administrativeArea": "Down Town",
                            "locality": "Louis Street",
                            "addressLines": [
                              "207",
                              "county"
                            ]
                          }
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Indicates if the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Indicates if the account has been deleted",
                        "example": true
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaTiktokAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Bluesky",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Success or Failure",
                "example": true
              },
              "statusCode": {
                "type": "number",
                "description": "Status Code",
                "example": 201
              },
              "message": {
                "type": "string",
                "description": "Message",
                "example": "Added Bluesky Account"
              },
              "results": {
                "description": "The connected account record that was created or updated.",
                "example": {
                  "_id": "65f2d989a4f2f1e5322c3856",
                  "oAuthId": "u37swmmLbA02zgqKPpxITe2",
                  "locationId": "u37swmmLbA02zgqKPpxITe2",
                  "originId": "did:plc:abc123",
                  "platform": "bluesky",
                  "type": "profile",
                  "name": "John Doe",
                  "avatar": "https://example.com/avatar.jpg",
                  "active": true,
                  "deleted": false
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "MongoDB document ID of the social media account",
                        "example": "65f2d989a4f2f1e5322c3856"
                      },
                      "oAuthId": {
                        "type": "string",
                        "description": "OAuth provider account identifier",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "oldId": {
                        "type": "string",
                        "description": "Legacy account identifier for backward compatibility",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "Location ID associated with this account",
                        "example": "u37swmmLbA02zgqKPpxITe2"
                      },
                      "originId": {
                        "type": "string",
                        "description": "Original platform-specific account identifier",
                        "example": "did:plc:abc123"
                      },
                      "platform": {
                        "type": "string",
                        "description": "Social media platform name",
                        "enum": [
                          "google",
                          "facebook",
                          "instagram",
                          "threads",
                          "bluesky",
                          "linkedin",
                          "twitter",
                          "tiktok",
                          "youtube",
                          "pinterest",
                          "community"
                        ],
                        "example": "bluesky"
                      },
                      "type": {
                        "type": "string",
                        "description": "type value must be profile",
                        "example": "profile",
                        "enum": [
                          "page",
                          "group",
                          "profile",
                          "location",
                          "business"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name of the account",
                        "example": "John Doe"
                      },
                      "avatar": {
                        "type": "string",
                        "description": "Avatar or profile picture URL",
                        "example": "https://example.com/avatar.jpg"
                      },
                      "meta": {
                        "type": "object",
                        "description": "Additional metadata for the account",
                        "example": {
                          "pageId": "u37swmmLbA02zgqKPpxITe2",
                          "page": {
                            "id": "u37swmmLbA02zgqKPpxITe2",
                            "name": "Account Name",
                            "avatar": "u37swmmLbA02zgqKPpxITe2"
                          },
                          "storeCode": "122",
                          "isVerified": "true",
                          "verified": true,
                          "protected": true,
                          "locationId": "u37swmmLbA02zgqKPpxITe2",
                          "accountId": "u37swmmLbA02zgqKPpxITe2",
                          "openId": "u37swmmLbA02zgqKPpxITe2",
                          "urn": "u37swmmLbA02zgqKPpxITe2",
                          "username": "testUser",
                          "storefrontAddress": {
                            "regionCode": "30021",
                            "languageCode": "E001",
                            "postalCode": "1221",
                            "administrativeArea": "Down Town",
                            "locality": "Louis Street",
                            "addressLines": [
                              "207",
                              "county"
                            ]
                          }
                        }
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Indicates if the account is currently active",
                        "example": true
                      },
                      "deleted": {
                        "type": "boolean",
                        "description": "Indicates if the account has been deleted",
                        "example": true
                      },
                      "createdAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "created date",
                        "example": "2024-03-14T11:03:37.015Z"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "type": "string",
                        "description": "updated date",
                        "example": "2024-03-14T11:03:37.015Z"
                      }
                    },
                    "title": "SocialMediaBlueskyAccountSchema"
                  }
                ]
              }
            },
            "required": [
              "success",
              "statusCode",
              "message"
            ]
          },
          {
            "title": "Pinterest",
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Connected account type",
                "enum": [
                  "page",
                  "group",
                  "profile",
                  "location",
                  "business"
                ],
                "example": "profile"
              },
              "originId": {
                "type": "string",
                "description": "Pinterest origin account id",
                "example": "244405****11687"
              },
              "name": {
                "type": "string",
                "description": "Pinterest account display name",
                "example": "Ayush"
              },
              "avatar": {
                "type": "string",
                "description": "Pinterest account avatar URL",
                "example": "https://i.pinimg.com/example-avatar.jpg"
              },
              "verified": {
                "type": "boolean",
                "description": "Whether the Pinterest account is verified",
                "example": true
              },
              "username": {
                "type": "string",
                "description": "Pinterest account username",
                "example": "@ayush"
              }
            }
          }
        ]
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X POST 'https://services.leadconnectorhq.com/social-media-posting/oauth/<locationId>/<platform>/accounts/<accountId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "type": "profile",
  "originId": "244405****11687",
  "name": "Ayush",
  "avatar": "https://yt3.ggpht.com/example-avatar",
  "pageId": "234234234242sd",
  "urn": "urn:li:organization:80847980",
  "location": {
    "name": "locations/12345",
    "title": "My Business Location",
    "storeCode": "STORE123",
    "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
    "isConnected": true
  },
  "account": {
    "name": "accounts/12345",
    "accountName": "My Business Account",
    "type": "LOCATION_GROUP",
    "verificationState": "VERIFIED",
    "vettedState": "VETTED"
  },
  "verified": true,
  "username": "@ayush",
  "websiteUrl": "https://www.website.com",
  "originAccountType": "business",
  "handle": "handle.bsky.social",
  "connectionSource": "social_media_posting"
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "type": "profile",
      "originId": "244405****11687",
      "name": "Ayush",
      "avatar": "https://yt3.ggpht.com/example-avatar",
      "pageId": "234234234242sd",
      "urn": "urn:li:organization:80847980",
      "location": {
        "name": "locations/12345",
        "title": "My Business Location",
        "storeCode": "STORE123",
        "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
        "isConnected": true
      },
      "account": {
        "name": "accounts/12345",
        "accountName": "My Business Account",
        "type": "LOCATION_GROUP",
        "verificationState": "VERIFIED",
        "vettedState": "VETTED"
      },
      "verified": true,
      "username": "@ayush",
      "websiteUrl": "https://www.website.com",
      "originAccountType": "business",
      "handle": "handle.bsky.social",
      "connectionSource": "social_media_posting"
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/oauth/<locationId>/<platform>/accounts/<accountId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/social-media-posting/oauth/{locationId}/{platform}/accounts/{accountId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

payload = {
    "type": "profile",
    "originId": "244405****11687",
    "name": "Ayush",
    "avatar": "https://yt3.ggpht.com/example-avatar",
    "pageId": "234234234242sd",
    "urn": "urn:li:organization:80847980",
    "location": {
        "name": "locations/12345",
        "title": "My Business Location",
        "storeCode": "STORE123",
        "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
        "isConnected": true
    },
    "account": {
        "name": "accounts/12345",
        "accountName": "My Business Account",
        "type": "LOCATION_GROUP",
        "verificationState": "VERIFIED",
        "vettedState": "VETTED"
    },
    "verified": true,
    "username": "@ayush",
    "websiteUrl": "https://www.website.com",
    "originAccountType": "business",
    "handle": "handle.bsky.social",
    "connectionSource": "social_media_posting"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/social-media-posting/oauth/<locationId>/<platform>/accounts/<accountId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "type": "profile",
  "originId": "244405****11687",
  "name": "Ayush",
  "avatar": "https://yt3.ggpht.com/example-avatar",
  "pageId": "234234234242sd",
  "urn": "urn:li:organization:80847980",
  "location": {
    "name": "locations/12345",
    "title": "My Business Location",
    "storeCode": "STORE123",
    "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
    "isConnected": true
  },
  "account": {
    "name": "accounts/12345",
    "accountName": "My Business Account",
    "type": "LOCATION_GROUP",
    "verificationState": "VERIFIED",
    "vettedState": "VETTED"
  },
  "verified": true,
  "username": "@ayush",
  "websiteUrl": "https://www.website.com",
  "originAccountType": "business",
  "handle": "handle.bsky.social",
  "connectionSource": "social_media_posting"
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/social-media-posting/oauth/<locationId>/<platform>/accounts/<accountId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .header("Content-Type", "application/json")
  .body("{\"type\":\"profile\",\"originId\":\"244405****11687\",\"name\":\"Ayush\",\"avatar\":\"https://yt3.ggpht.com/example-avatar\",\"pageId\":\"234234234242sd\",\"urn\":\"urn:li:organization:80847980\",\"location\":{\"name\":\"locations/12345\",\"title\":\"My Business Location\",\"storeCode\":\"STORE123\",\"isVerified\":\"ChIJsZQpj1qbXjkRQNDUG4UUx6k\",\"isConnected\":true},\"account\":{\"name\":\"accounts/12345\",\"accountName\":\"My Business Account\",\"type\":\"LOCATION_GROUP\",\"verificationState\":\"VERIFIED\",\"vettedState\":\"VETTED\"},\"verified\":true,\"username\":\"@ayush\",\"websiteUrl\":\"https://www.website.com\",\"originAccountType\":\"business\",\"handle\":\"handle.bsky.social\",\"connectionSource\":\"social_media_posting\"}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/social-media-posting/oauth/<locationId>/<platform>/accounts/<accountId>"
  payload := strings.NewReader(`{
  "type": "profile",
  "originId": "244405****11687",
  "name": "Ayush",
  "avatar": "https://yt3.ggpht.com/example-avatar",
  "pageId": "234234234242sd",
  "urn": "urn:li:organization:80847980",
  "location": {
    "name": "locations/12345",
    "title": "My Business Location",
    "storeCode": "STORE123",
    "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
    "isConnected": true
  },
  "account": {
    "name": "accounts/12345",
    "accountName": "My Business Account",
    "type": "LOCATION_GROUP",
    "verificationState": "VERIFIED",
    "vettedState": "VETTED"
  },
  "verified": true,
  "username": "@ayush",
  "websiteUrl": "https://www.website.com",
  "originAccountType": "business",
  "handle": "handle.bsky.social",
  "connectionSource": "social_media_posting"
}`)
  req, _ := http.NewRequest("POST", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/social-media-posting/oauth/<locationId>/<platform>/accounts/<accountId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"
request["Content-Type"] = "application/json"
request.body = '{
  "type": "profile",
  "originId": "244405****11687",
  "name": "Ayush",
  "avatar": "https://yt3.ggpht.com/example-avatar",
  "pageId": "234234234242sd",
  "urn": "urn:li:organization:80847980",
  "location": {
    "name": "locations/12345",
    "title": "My Business Location",
    "storeCode": "STORE123",
    "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
    "isConnected": true
  },
  "account": {
    "name": "accounts/12345",
    "accountName": "My Business Account",
    "type": "LOCATION_GROUP",
    "verificationState": "VERIFIED",
    "vettedState": "VETTED"
  },
  "verified": true,
  "username": "@ayush",
  "websiteUrl": "https://www.website.com",
  "originAccountType": "business",
  "handle": "handle.bsky.social",
  "connectionSource": "social_media_posting"
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$body = '{
  "type": "profile",
  "originId": "244405****11687",
  "name": "Ayush",
  "avatar": "https://yt3.ggpht.com/example-avatar",
  "pageId": "234234234242sd",
  "urn": "urn:li:organization:80847980",
  "location": {
    "name": "locations/12345",
    "title": "My Business Location",
    "storeCode": "STORE123",
    "isVerified": "ChIJsZQpj1qbXjkRQNDUG4UUx6k",
    "isConnected": true
  },
  "account": {
    "name": "accounts/12345",
    "accountName": "My Business Account",
    "type": "LOCATION_GROUP",
    "verificationState": "VERIFIED",
    "vettedState": "VETTED"
  },
  "verified": true,
  "username": "@ayush",
  "websiteUrl": "https://www.website.com",
  "originAccountType": "business",
  "handle": "handle.bsky.social",
  "connectionSource": "social_media_posting"
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/social-media-posting/oauth/<locationId>/<platform>/accounts/<accountId>' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
