Skip to main content

System, Status, and License Management

The System, Status, and License Management API endpoints provide tools to control Gunbot's system operations and manage license configurations. These endpoints allow you to start or stop the system, retrieve server time, and update license keys.

Info

A license key is a data string that verifies authorized software use. It is typically used to activate a software program and ensure it is not being used illegitimately.

The following sections outline the available endpoints, including parameter details, request examples in multiple programming languages, and example responses to help users effectively interact with Gunbot's system and licensing features.

Start System​

  • Method: POST
  • Endpoint: /api/v1/system/start
  • Description: Starts the system and returns the current configuration (excluding private keys).

Headers:

NameTypeDescription
AuthorizationstringBearer token for authentication.
Content-Typestringapplication/json

Parameters​

This endpoint does not require any request parameters.

Examples​

cURL​

curl -X POST "https://your-gunbot-instance.com:3000/api/v1/system/start" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_BEARER_TOKEN"

JavaScript (fetch API)​

fetch('https://your-gunbot-instance.com:3000/api/v1/system/start', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_BEARER_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Python (requests library)​

import requests

url = 'https://your-gunbot-instance.com:3000/api/v1/system/start'
headers = {
'Authorization': 'Bearer YOUR_BEARER_TOKEN',
'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers)
print(response.json())

Response​

{
// returns the current configuration without private keys
}

Stop System​

  • Method: POST
  • Endpoint: /api/v1/system/stop
  • Description: Stops the system and returns the current configuration (excluding private keys).

Headers:

NameTypeDescription
AuthorizationstringBearer token for authentication.
Content-Typestringapplication/json

Parameters​

This endpoint does not require any request parameters.

Examples​

cURL​

curl -X POST "https://your-gunbot-instance.com:3000/api/v1/system/stop" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_BEARER_TOKEN"

JavaScript (fetch API)​

fetch('https://your-gunbot-instance.com:3000/api/v1/system/stop', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_BEARER_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Python (requests library)​

import requests

url = 'https://your-gunbot-instance.com:3000/api/v1/system/stop'
headers = {
'Authorization': 'Bearer YOUR_BEARER_TOKEN',
'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers)
print(response.json())

Response​

{
// returns the current configuration without private keys
}

Get Server Time​

  • Method: GET
  • Endpoint: /api/v1/time
  • Description: Retrieves the current server time in milliseconds since the Unix epoch.

Headers:

NameTypeDescription
AuthorizationstringBearer token for authentication.

Parameters​

This endpoint does not require any request parameters.

Examples​

cURL​

curl -X GET "https://your-gunbot-instance.com:3000/api/v1/time" \
-H "Authorization: Bearer YOUR_BEARER_TOKEN"

JavaScript (fetch API)​

fetch('https://your-gunbot-instance.com:3000/api/v1/time', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_BEARER_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Python (requests library)​

import requests

url = 'https://your-gunbot-instance.com:3000/api/v1/time'
headers = {
'Authorization': 'Bearer YOUR_BEARER_TOKEN'
}

response = requests.get(url, headers=headers)
print(response.json())

Response​

{
"serverTime": 1733307452501
}

Edit License Keys​

  • Method: POST
  • Endpoint: /api/v1/license/keys/edit
  • Description: Edits license keys associated with a wallet and optionally verifies an exchange.

Parameters​

NameTypeDescription
walletstringWallet address (e.g., 0xYourWalletAddress).
newLicensesobjectObject containing new license data. Use the entire config.exchanges object to place in config, with key changes. For new keys, set the isEncrypted value to false. Multiple key changes at once are possible
verifyExchangestringExchange used to verify (e.g., binance). Provide the name of an exchange that currently has valid, registered credentials in your configuration. This name will be used to authenticate the request.

Examples​

cURL​

curl -X POST "https://your-gunbot-instance.com:3000/api/v1/license/keys/edit" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-d '{
"wallet": "0xYourWalletAddress",
"newLicenses": {},
"verifyExchange": "binance"
}'

JavaScript (fetch API)​

const data = {
wallet: '0xYourWalletAddress',
newLicenses: {

},
verifyExchange: 'binance'
};

fetch('https://your-gunbot-instance.com:3000/api/v1/license/keys/edit', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_BEARER_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Python (requests library)​

import requests

url = 'https://your-gunbot-instance.com:3000/api/v1/license/keys/edit'
headers = {
'Authorization': 'Bearer YOUR_BEARER_TOKEN',
'Content-Type': 'application/json'
}
data = {
"wallet": "0xYourWalletAddress",
"newLicenses": {
},
"verifyExchange": "binance"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

Response​

{
"status": "success"
}