OAuth Schemas

BadRequestDTO

statusCode
number
Example:
400
message
string
Example:
Bad Request
Example
{
  "statusCode": 400,
  "message": "Bad Request"
}

UnauthorizedDTO

statusCode
number
Example:
401
message
string
Example:
Invalid token: access token is invalid
error
string
Example:
Unauthorized
Example
 {
  "statusCode": 401,
  "message": "Invalid token: access token is invalid",
  "error": "Unauthorized"
} 

GetAccessCodebodyDto

client_id
string
required

The ID provided by GHL for your integration

client_secret
string
required
grant_type
string
required
Allowed values:
authorization_coderefresh_token
code
string
refresh_token
string
user_type
string

The type of token to be requested

Allowed values:
CompanyLocation
Example:
Location
redirect_uri
string

The redirect URI for your application

Example:
https://myapp.com/oauth/callback/gohighlevel
Example
 {
  "client_id": "string",
  "client_secret": "string",
  "grant_type": "authorization_code",
  "code": "string",
  "refresh_token": "string",
  "user_type": "Company",
  "redirect_uri": "https://myapp.com/oauth/callback/gohighlevel"
}

GetAccessCodeSuccessfulResponseDto

access_token
string
Example:
ab12dc0ae1234a7898f9ff06d4f69gh
token_type
string
Example:
Bearer
expires_in
number
Example:
86399
refresh_token
string
Example:
xy34dc0ae1234a4858f9ff06d4f66ba
scope
string
Example:
conversations/message.readonly conversations/message.write
userType
string
Example:
Location
locationId
string

Location ID - Present only for Sub-Account Access Token

Example:
l1C08ntBrFjLS0elLIYU
companyId
string

Company ID

Example:
l1C08ntBrFjLS0elLIYU
approvedLocations
array[string]

Approved locations to generate location access token

Example:
["l1C08ntBrFjLS0elLIYU"]
userId
string
required

USER ID - Represent user id of person who performed installation

Example:
l1C08ntBrFjLS0elLIYU
planId
string

Plan Id of the subscribed plan in paid apps.

Example:
l1C08ntBrFjLS0elLIYU
Example
 {
  "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"
  ],
  "userId": "l1C08ntBrFjLS0elLIYU",
  "planId": "l1C08ntBrFjLS0elLIYU"
}

UnprocessableDTO

statusCode
number
Example:
422
message
array[string]
Example:
["Unprocessable Entity"]
error
string
Example:
Unprocessable Entity
Example
 {
  "statusCode": 422,
  "message": [
    "Unprocessable Entity"
  ],
  "error": "Unprocessable Entity"
}

GetLocationAccessCodeBodyDto

companyId
string
required

Company Id of location you want to request token for

locationId
string
required

The location ID for which you want to obtain accessToken

Example
 {
  "companyId": "string",
  "locationId": "string"
}

GetLocationAccessTokenSuccessfulResponseDto

access_token
string

Location access token which can be used to authenticate & authorize API under following scope

Example:
ab12dc0ae1234a7898f9ff06d4f69gh
token_type
string
Example:
Bearer
expires_in
number

Time in seconds remaining for token to expire

Example:
86399
scope
string

Scopes the following accessToken have access to

Example:
conversations/message.readonly conversations/message.write
locationId
string

Location ID - Present only for Sub-Account Access Token

Example:
l1C08ntBrFjLS0elLIYU
planId
string

Plan Id of the subscribed plan in paid apps.

Example:
l1C08ntBrFjLS0elLIYU
userId
string
required

USER ID - Represent user id of person who performed installation

Example:
l1C08ntBrFjLS0elLIYU
Example
 {
  "access_token": "ab12dc0ae1234a7898f9ff06d4f69gh",
  "token_type": "Bearer",
  "expires_in": 86399,
  "scope": "conversations/message.readonly conversations/message.write",
  "locationId": "l1C08ntBrFjLS0elLIYU",
  "planId": "l1C08ntBrFjLS0elLIYU",
  "userId": "l1C08ntBrFjLS0elLIYU"
}

InstalledLocationSchema

_id
string
required

Location ID

Example:
0IHuJvc2ofPAAA8GzTRi
name
string
required

Name of the location

Example:
John Deo
address
string
required

Address linked to location

Example:
47 W 13th St, New York, NY 10011, USA
isInstalled
boolean

Check if the requested app is installed for following location

Example:
true
Example
 {
  "_id": "0IHuJvc2ofPAAA8GzTRi",
  "name": "John Deo",
  "address": "47 W 13th St, New York, NY 10011, USA",
  "isInstalled": true
}

GetInstalledLocationsSuccessfulResponseDto

locations
array[object]
_id
string
required

Location ID

Example:
0IHuJvc2ofPAAA8GzTRi
name
string
required

Name of the location

Example:
John Deo
address
string
required

Address linked to location

Example:
47 W 13th St, New York, NY 10011, USA
isInstalled
boolean

Check if the requested app is installed for following location

Example:
true
count
number

Total location count under the company

Example:
1231
installToFutureLocations
boolean

Boolean to control if user wants app to be automatically installed to future locations

Example:
true
Example
 {
  "locations": [
    {
      "_id": "0IHuJvc2ofPAAA8GzTRi",
      "name": "John Deo",
      "address": "47 W 13th St, New York, NY 10011, USA",
      "isInstalled": true
    }
  ],
  "count": 1231,
  "installToFutureLocations": true
}