Run a command in-game as virtual server management
POST
/
v2
/
server
/
command
Run a command in-game as virtual server management
curl --request POST \
--url https://api.erlc.gg/v2/server/command \
--header 'Content-Type: application/json' \
--header 'server-key: <api-key>' \
--data '
{
"command": ":h Hey everyone!"
}
'import requests
url = "https://api.erlc.gg/v2/server/command"
payload = { "command": ":h Hey everyone!" }
headers = {
"server-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'server-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({command: ':h Hey everyone!'})
};
fetch('https://api.erlc.gg/v2/server/command', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlc.gg/v2/server/command",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'command' => ':h Hey everyone!'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"server-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlc.gg/v2/server/command"
payload := strings.NewReader("{\n \"command\": \":h Hey everyone!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("server-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlc.gg/v2/server/command")
.header("server-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"command\": \":h Hey everyone!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlc.gg/v2/server/command")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["server-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"command\": \":h Hey everyone!\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Success"
}{
"message": "Missing command in request body"
}{
"message": "The private server is currently offline.",
"commandId": "ecfd9342-0acd-4485-bf32-e654b4a829fd"
}{
"message": "Error communicating with Roblox",
"commandId": "ecfd9342-0acd-4485-bf32-e654b4a829fd"
}Authorizations
REQUIRED ON ALL REQUESTS. Get your server key at https://erlc.link/sk
Headers
OPTIONAL. ONLY provide this header if you are creating a public app (used in many unique servers). Register your app at https://apidocs.erlc.gg/creating-public-applications.
Body
application/json
Command to be executed
The command to be executed
Example:
":h Hey everyone!"
Response
Command executed successfully
A message explaining the status of your command
Example:
"Success"
⌘I
Run a command in-game as virtual server management
curl --request POST \
--url https://api.erlc.gg/v2/server/command \
--header 'Content-Type: application/json' \
--header 'server-key: <api-key>' \
--data '
{
"command": ":h Hey everyone!"
}
'import requests
url = "https://api.erlc.gg/v2/server/command"
payload = { "command": ":h Hey everyone!" }
headers = {
"server-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'server-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({command: ':h Hey everyone!'})
};
fetch('https://api.erlc.gg/v2/server/command', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlc.gg/v2/server/command",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'command' => ':h Hey everyone!'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"server-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlc.gg/v2/server/command"
payload := strings.NewReader("{\n \"command\": \":h Hey everyone!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("server-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlc.gg/v2/server/command")
.header("server-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"command\": \":h Hey everyone!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlc.gg/v2/server/command")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["server-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"command\": \":h Hey everyone!\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Success"
}{
"message": "Missing command in request body"
}{
"message": "The private server is currently offline.",
"commandId": "ecfd9342-0acd-4485-bf32-e654b4a829fd"
}{
"message": "Error communicating with Roblox",
"commandId": "ecfd9342-0acd-4485-bf32-e654b4a829fd"
}