Get Access Token
Use Access Tokens to access HoopAI resources on behalf of an authenticated location/company.
POST
/
oauth
/
token
Get Access Token
curl --request POST \
--url https://services.leadconnectorhq.com/oauth/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=<string>' \
--data 'client_secret=<string>' \
--data 'code=<string>' \
--data 'refresh_token=<string>' \
--data user_type=Location \
--data redirect_uri=https://myapp.com/oauth/callback/hoopaiconst options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
client_id: '<string>',
client_secret: '<string>',
code: '<string>',
refresh_token: '<string>',
user_type: 'Location',
redirect_uri: 'https://myapp.com/oauth/callback/hoopai'
})
};
fetch('https://services.leadconnectorhq.com/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/oauth/token"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"code": "<string>",
"refresh_token": "<string>",
"user_type": "Location",
"redirect_uri": "https://myapp.com/oauth/callback/hoopai"
}
headers = {
"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,
"refresh_token": "xy34dc0ae1234a4858f9ff06d4f66ba",
"scope": "conversations/message.readonly conversations/message.write",
"userType": "Location",
"locationId": "l1C08ntBrFjLS0elLIYU",
"companyId": "l1C08ntBrFjLS0elLIYU",
"approvedLocations": [
"l1C08ntBrFjLS0elLIYU"
],
"planId": "l1C08ntBrFjLS0elLIYU",
"isBulkInstallation": "Bearer"
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Authorizations
Body
application/x-www-form-urlencoded
Response
Successful response
Last modified on March 7, 2026
Was this page helpful?
Get Access Token
curl --request POST \
--url https://services.leadconnectorhq.com/oauth/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=<string>' \
--data 'client_secret=<string>' \
--data 'code=<string>' \
--data 'refresh_token=<string>' \
--data user_type=Location \
--data redirect_uri=https://myapp.com/oauth/callback/hoopaiconst options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
client_id: '<string>',
client_secret: '<string>',
code: '<string>',
refresh_token: '<string>',
user_type: 'Location',
redirect_uri: 'https://myapp.com/oauth/callback/hoopai'
})
};
fetch('https://services.leadconnectorhq.com/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/oauth/token"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"code": "<string>",
"refresh_token": "<string>",
"user_type": "Location",
"redirect_uri": "https://myapp.com/oauth/callback/hoopai"
}
headers = {
"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,
"refresh_token": "xy34dc0ae1234a4858f9ff06d4f66ba",
"scope": "conversations/message.readonly conversations/message.write",
"userType": "Location",
"locationId": "l1C08ntBrFjLS0elLIYU",
"companyId": "l1C08ntBrFjLS0elLIYU",
"approvedLocations": [
"l1C08ntBrFjLS0elLIYU"
],
"planId": "l1C08ntBrFjLS0elLIYU",
"isBulkInstallation": "Bearer"
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}