Start a server
curl --request POST \
--url https://api.arg.ai/api/tunnels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "<string>",
"command": "<string>",
"port": 123
}
'import requests
url = "https://api.arg.ai/api/tunnels"
payload = {
"workspace_id": "<string>",
"command": "<string>",
"port": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspace_id: '<string>', command: '<string>', port: 123})
};
fetch('https://api.arg.ai/api/tunnels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"detail": "<string>"
}Servers
Start a server
Run a long-lived command in the workspace sandbox and expose its port on an HTTPS URL. Each workspace can run a limited number of servers at once.
POST
/
api
/
tunnels
Start a server
curl --request POST \
--url https://api.arg.ai/api/tunnels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "<string>",
"command": "<string>",
"port": 123
}
'import requests
url = "https://api.arg.ai/api/tunnels"
payload = {
"workspace_id": "<string>",
"command": "<string>",
"port": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspace_id: '<string>', command: '<string>', port: 123})
};
fetch('https://api.arg.ai/api/tunnels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"detail": "<string>"
}Authorizations
Bearer-tokenAPI-key
Body
application/json
Response
Successful response
The response is of type object.