Skip to content

HighLevel: Connect Account (Step 3 of 3)

HighLevel socialPlanner.attachOauthAccounts: arguments, response, policy and SDK examples.

← Social planner operations · Get started

Operation gohighlevel.attach_oauth_accounts

Provider route: POST /social-media-posting/oauth/{locationId}/{platform}/accounts/{accountId}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/gohighlevel with npm, or alter-sdk-gohighlevel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HighLevelIntegration } from "@alter-ai/gohighlevel";
async function execute(input: Parameters<HighLevelIntegration["socialPlanner"]["attachOauthAccounts"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HighLevelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.socialPlanner.attachOauthAccounts(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_gohighlevel import HighLevelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HighLevelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.social_planner.attach_oauth_accounts(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.locationIdstringRequired within parent
path.platformstringRequired within parentOne of: google, facebook, instagram, linkedin, tiktok, youtube, pinterest, threads, bluesky
path.accountIdstringRequired within parent
bodyJSONRequired within parent
body (oneOf 1)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body / type: page
body (oneOf 2)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body avatar, name, origin Id, page Id
body (oneOf 3)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body account, location
body (oneOf 4)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Pinterest Account DTO
body (oneOf 5)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body / type: page, group, profile, location, business — Attach Tiktok Account DTO
body (oneOf 6)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Youtube Account Response DTO
body (oneOf 7)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body / type: page, group, profile, location, business — Attach Linkedin Account DTO
body (oneOf 8)ModelAlternativeExpand Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Threads Account DTO

Referenced models: Connect Account (Step 3 of 3) — request body — body / type: page, Connect Account (Step 3 of 3) — request body — body account, location, Connect Account (Step 3 of 3) — request body — body avatar, name, origin Id, page Id, Connect Account (Step 3 of 3) — request body — body / type: page, group, profile, location, business — Attach Linkedin Account DTO, Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Pinterest Account DTO, Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Threads Account DTO, Connect Account (Step 3 of 3) — request body — body / type: page, group, profile, location, business — Attach Tiktok Account DTO, Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Youtube Account Response DTO

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media FBAccount Response DTO
$ (anyOf 2)ModelAlternativeExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Gmb Account Response DTO
$ (anyOf 3)ModelAlternativeExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Gmb Account Response DTO
$ (anyOf 4)ModelAlternativeExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Linked In Account Response DTO
$ (anyOf 5)ModelAlternativeExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Tiktok Account Response DTO
$ (anyOf 6)ModelAlternativeExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media You Tube Account Response DTO
$ (anyOf 7)ModelAlternativeExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Pinterest Account Response DTO

Referenced models: Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media FBAccount Response DTO, Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Gmb Account Response DTO, Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Linked In Account Response DTO, Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Pinterest Account Response DTO, Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Tiktok Account Response DTO, Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media You Tube Account Response DTO

11 more schemas are linked from the tables above, on the schema pages.

Connect Account (Step 3 of 3) — request body — body / type: page
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringRequired within parentAvatar or profile picture URL
namestringRequired within parentName of the Facebook page or account
originIdstringRequired within parentOriginal Facebook platform identifier
typestringRequired within parentType of Facebook account (must be page)
One of: page
Connect Account (Step 3 of 3) — request body — body account, location
FieldTypePresenceDescription and constraints
$objectRoot
accountobjectRequired within parent
account (allOf 1)ModelAll variants applyExpand Connect Account (Step 3 of 3) — request body — body account, location account account Name, name, type, verification State, vetted State
locationobjectRequired within parent
location (allOf 1)ModelAll variants applyExpand Connect Account (Step 3 of 3) — request body — body account, location location is Connected, is Verified, max Location, metadata, name, store Code, storefront Address, title

Referenced models: Connect Account (Step 3 of 3) — request body — body account, location account account Name, name, type, verification State, vetted State, Connect Account (Step 3 of 3) — request body — body account, location location is Connected, is Verified, max Location, metadata, name, store Code, storefront Address, title

Connect Account (Step 3 of 3) — request body — body avatar, name, origin Id, page Id
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringOptionalAvatar or profile picture URL
namestringOptionalDisplay name of the account
originIdstringOptionalOriginal platform-specific account identifier
pageIdstringRequired within parentFacebook page ID associated with the Instagram account
Connect Account (Step 3 of 3) — request body — body / type: page, group, profile, location, business — Attach Linkedin Account DTO
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringRequired within parentAvatar or profile picture URL
namestringRequired within parentName of the LinkedIn page or profile
originIdstringRequired within parentOriginal LinkedIn platform identifier
typestringRequired within parentType of LinkedIn account (must be one of: page, profile)
One of: page, group, profile, location, business
urnstringRequired within parentLinkedIn URN (Uniform Resource Name) identifier
Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Pinterest Account DTO
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringOptionalAvatar URL
companyIdstringOptionalCompany ID
namestringOptionalName
originAccountTypestringOptionalOrigin account type
originIdstringRequired within parentOrigin ID
typestringOptionalAccount type must be one of the following values: profile
One of: profile
usernamestringOptionalUsername
verifiedbooleanOptionalVerification status
websiteUrlstringOptionalWebsite URL
Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Threads Account DTO
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringRequired within parentAvatar URL
namestringRequired within parentAccount name
originIdstringRequired within parentOrigin ID
typestringRequired within parentAccount type
One of: profile
Connect Account (Step 3 of 3) — request body — body / type: page, group, profile, location, business — Attach Tiktok Account DTO
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringRequired within parentAvatar or profile picture URL
namestringRequired within parentDisplay name of the account
originIdstringRequired within parentOriginal platform-specific account identifier
typestringRequired within parentType of TikTok account
One of: page, group, profile, location, business
usernamestringOptionalUsername or handle of the TikTok account
verifiedbooleanOptionalIndicates if the TikTok account is verified
Connect Account (Step 3 of 3) — request body — body / type: profile — Attach Youtube Account Response DTO
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringRequired within parentAvatar URL
namestringRequired within parentName
originIdstringRequired within parentOrigin ID
typestringRequired within parentAccount type
One of: profile
usernamestringOptionalUsername
verifiedbooleanOptionalVerification status
Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media FBAccount Response DTO
FieldTypePresenceDescription and constraints
$objectRoot
messagestringRequired within parentMessage
resultsJSONOptionalRequested Results
results (allOf 1)ModelAll variants applyExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success results id, active, avatar, created At, deleted, location Id, meta, name, o Auth Id, old Id, origin Id, platform, type, updated At — Social Media Facebook Account Schema
statusCodeJSONRequired within parent
statusCode (anyOf 1)numberAlternativeStatus Code
statusCode (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
successbooleanRequired within parentSuccess or Failure

Referenced models: Connect Account (Step 3 of 3) — response body — message, results, status Code, success results id, active, avatar, created At, deleted, location Id, meta, name, o Auth Id, old Id, origin Id, platform, type, updated At — Social Media Facebook Account Schema

Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Gmb Account Response DTO
FieldTypePresenceDescription and constraints
$objectRoot
messagestringRequired within parentMessage
resultsJSONOptionalRequested Results
results (allOf 1)ModelAll variants applyExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success results id, active, avatar, created At, deleted, location Id, meta, name, o Auth Id, old Id, origin Id, platform, type, updated At — Social Google Media Account Schema
statusCodeJSONRequired within parent
statusCode (anyOf 1)numberAlternativeStatus Code
statusCode (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
successbooleanRequired within parentSuccess or Failure

Referenced models: Connect Account (Step 3 of 3) — response body — message, results, status Code, success results id, active, avatar, created At, deleted, location Id, meta, name, o Auth Id, old Id, origin Id, platform, type, updated At — Social Google Media Account Schema

Connect Account (Step 3 of 3) — response body — message, results, status Code, success — Social Media Linked In Account Response DTO
FieldTypePresenceDescription and constraints
$objectRoot
messagestringRequired within parentMessage
resultsJSONOptionalRequested Results
results (allOf 1)ModelAll variants applyExpand Connect Account (Step 3 of 3) — response body — message, results, status Code, success results id, active, avatar, created At, deleted, location Id, meta, name, o Auth Id, old Id, origin Id, platform, type, updated At — Social Media Linked In Account Schema
statusCodeJSONRequired within parent
statusCode (anyOf 1)numberAlternativeStatus Code
statusCode (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
successbooleanRequired within parentSuccess or Failure

Referenced models: Connect Account (Step 3 of 3) — response body — message, results, status Code, success results id, active, avatar, created At, deleted, location Id, meta, name, o Auth Id, old Id, origin Id, platform, type, updated At — Social Media Linked In Account Schema

Connect Account (Step 3 of 3) — response body — message, results, statusCode, success / results / platform: youtube avatar, name, origin Id
FieldTypePresenceDescription and constraints
$objectRoot
avatarstringOptionalAccount Avatar URL
namestringRequired within parentAccount Name
originIdstringRequired within parentOrigin ID

SDK function policy ID: gohighlevel.attach_oauth_accounts. Catalog operation: attach-oauth-accounts. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Version": "v3"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.