Get Location Access Token from Agency Token
This API allows you to generate locationAccessToken from AgencyAccessToken
POST
/
oauth
/
locationToken
Get Location Access Token from Agency Token
curl --request POST \
--url https://services.leadconnectorhq.com/oauth/locationToken \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Version: <version>' \
--data 'companyId=<string>' \
--data 'locationId=<string>'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({companyId: '<string>', locationId: '<string>'})
};
fetch('https://services.leadconnectorhq.com/oauth/locationToken', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/oauth/locationToken"
payload = {
"companyId": "<string>",
"locationId": "<string>"
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"userId": "l1C08ntBrFjLS0elLIYU",
"access_token": "ab12dc0ae1234a7898f9ff06d4f69gh",
"token_type": "Bearer",
"expires_in": 86399,
"scope": "conversations/message.readonly conversations/message.write",
"locationId": "l1C08ntBrFjLS0elLIYU",
"planId": "l1C08ntBrFjLS0elLIYU"
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Body
application/x-www-form-urlencoded
Response
Successful response
Last modified on March 7, 2026
Was this page helpful?
Get Location Access Token from Agency Token
curl --request POST \
--url https://services.leadconnectorhq.com/oauth/locationToken \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Version: <version>' \
--data 'companyId=<string>' \
--data 'locationId=<string>'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({companyId: '<string>', locationId: '<string>'})
};
fetch('https://services.leadconnectorhq.com/oauth/locationToken', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/oauth/locationToken"
payload = {
"companyId": "<string>",
"locationId": "<string>"
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"userId": "l1C08ntBrFjLS0elLIYU",
"access_token": "ab12dc0ae1234a7898f9ff06d4f69gh",
"token_type": "Bearer",
"expires_in": 86399,
"scope": "conversations/message.readonly conversations/message.write",
"locationId": "l1C08ntBrFjLS0elLIYU",
"planId": "l1C08ntBrFjLS0elLIYU"
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}