APIs to manage an Organisation's monitor reports.
HoxtonAi API (0.0.1)
All endpoints need a valid access token which can be obtained following either of the authentication flows detailed below. Both the authentication methods required a OAuth2 client. Create a OAuth2 client for your organisation at https://app.hoxton.ai/settings?tab=oauth_client, if not done already.

This method should be reserved for internal use only. If you are sharing with third party, use authorization code flow described above. This flow is best suited for Machine-to-Machine (M2M) applications, such as CLIs, daemons, or backend services, because the system must authenticate and authorize the application instead of a user.
To get the access token, make a POST request to the token URL with the oauth2 client's credentials (client_id & client_secret). This is a single step method.
- Get
access_token:- Endpoint:
https://auth.hoxton.ai/oauth/token - Parameters:
- Endpoint:
| Parameter | Type | Description |
|---|---|---|
grant_type | required | Always set this to client_credentials |
audience | required | Always set this to https://api.hoxton.cloud |
client_id | required | The oauth client's id |
client_secret | required | The oauth client's secret |
Once you have the required oauth client credentials, the access token can be obtained from the authorization server by making a POST request to the token URL.
curl -X POST https://auth.hoxton.ai/oauth/token
-H 'Content-Type: application/json'
-d '{
"grant_type": "client_credentials",
"audience": "https://api.hoxton.cloud",
"client_id": "<CLIENT_ID>",
"client_secret": "<CLIENT_SECRET>",
}'If the authorization server was able to successfully validate the request, you will receive HTTP 200 response with a payload containing access_token which is valid for 24hr.
{
"access_token": "eyJhbGc...2oSuHNwA",
"token_type": "Bearer",
"expires_in": 86400
}
This method should be reserved for internal use only. If you are sharing with third party, use authorization code flow described above.
To get the access token first get the user's credentials (username & password). Then get the oauth2 client's credentials (client_id & client_secret). Finally, exchange them for token by making a POST request to the token URL. This is a single step method.
- Get
access_token:
- Endpoint:
https://auth.hoxton.ai/oauth/token - Parameters
- Get
| Parameter | Type | Description |
|---|---|---|
grant_type | required | Always set this to password |
audience | required | Always set this to https://api.hoxton.cloud |
scope | optional | A space separated list of claims to include in the token. Use profile to get ID token. Include offline_access to get Refresh Token. |
username | required | The user's loging username |
password | required | The user's login password |
client_id | required | The oauth client's id |
client_secret | required | The oauth client's secret |
Once you have the required oauth client credentials, the access token can be obtained from the authorization server by making a POST request to the token URL.
curl -X POST https://auth.hoxton.ai/oauth/token
-H 'Content-Type: application/json'
-d '{
"grant_type": "password",
"username": "<USERNAME>",
"password": "<PASSWORD>",
"audience": "https://api.hoxton.cloud",
"scope": "offline",
"client_id": "<CLIENT_ID>",
"client_secret": "<CLIENT_SECRET>",
}'If the authorization server was able to successfully validate the request, you will receive HTTP 200 response with a payload containing access_token which is valid for 24hr.
{
"access_token": "eyJhbGc...2oSuHNwA",
"refresh_token": "v1.MT...4XFunfTks",
"id_token": "eyv1.KDNM3w...vPkdKvMU",
"token_type": "Bearer",
"expires_in": 86400
}If you have requested offline_access claim in the authorisation call as described above, you can request a new access_token using this method.
- Get new
access_tokenandrefresh_token:
- Endpoint:
https://auth.hoxton.ai/oauth/token - Parameters
- Get new
| Parameter | Type | Description |
|---|---|---|
grant_type | required | Always set this to refresh_token |
scope | optional | A space separated list of claims to include in the token. Do not set this parameter if you want to keep the original claims |
client_id | required | The oauth client's id use in the initial authorization call |
refresh_token | required | The refresh_token from the previous successful authorization call |
To get a new access_token & refresh_token, make a POST request to the token URL.
curl -X POST https://auth.hoxton.ai/oauth/token
-H 'Content-Type: application/json'
-d '{
"grant_type": "refresh_token",
"client_id": "<CLIENT_ID>",
"scope": "offline",
"refresh_token": "v1.MT...4XFunfTks"
}'If the authorization server was able to successfully validate the request, you will receive HTTP 200 response with a payload containing access_token (which is valid for 24hr) and a refresh_token.
{
"access_token": "eyJhbGc...2oSuHNwA",
"refresh_token": "v1.MT...4XFunfTks",
"id_token": "eyv1.KDNM3w...vPkdKvMU",
"token_type": "Bearer",
"expires_in": 86400
}