← OAuth 2.0

Get Location Access Token from Agency Token

Generate a sub-account (location) access token from an agency-level (company) access token. This allows your app to act on behalf of a specific location without requiring separate authorization.

POST/oauth/locationToken
Scope
Auth Method
Bearer Token (Agency)
Token Type
Company

Header Parameters

ParameterTypeDescription
AuthorizationrequiredstringBearer {company_access_token}
VersionrequiredstringAPI Version
Possible values: 2021-07-28
Content-Typerequiredstringapplication/x-www-form-urlencoded

Body Parameters

ParameterTypeDescription
companyIdrequiredstringThe Company ID of the agency that owns the location you want to request a token for.
locationIdrequiredstringThe Location ID (sub-account) for which you want to obtain an access token.
Example RequestcURL
curl -X POST \
  'https://services.leadconnectorhq.com/oauth/locationToken' \
  -H 'Authorization: Bearer {company_access_token}' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'companyId=5DP41231LkQsiKESj6rh' \
  -d 'locationId=ve9EPM428h8vShlRW1KT'

Response — 200 OK

Example ResponseJSON
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 86400,
  "scope": "contacts.readonly contacts.write conversations.readonly ...",
  "locationId": "ve9EPM428h8vShlRW1KT",
  "userId": "usr_abc123",
  "planId": "plan_xyz789",
  "appId": "app_def456",
  "appVersionId": "ver_ghi789"
}

Response Fields

ParameterTypeDescription
access_tokenstringLocation access token which can be used to authenticate and authorize API calls under the granted scopes.
token_typestringAlways "Bearer".
expires_inintegerTime in seconds remaining for the token to expire.
scopestringScopes the access token has access to.
locationIdstringLocation ID — present only for Sub-Account access tokens.
userIdstringUser ID of the person who performed the installation.
planIdstringPlan ID of the subscribed plan (paid apps only).
appIdstringApp ID of the installed application.
appVersionIdstringVersion ID of the installed app version.

Important

This endpoint requires a Company-level access token in the Authorization header. The resulting location token inherits the scopes that were approved during the original OAuth installation flow. No refresh token is returned — generate a new location token from the agency token whenever needed.