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
bearerAuthapiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Workspace to run in.
Command that starts the server and keeps running.
Port the command listens on, from 1024 to 65535.
Setup command to run once before the server starts, such as an install.
Display name for the server.
Seconds before the server is shut down. Pass 0 to keep it running.
Who can reach the URL. Defaults to workspace members.
Available options:
public, workspace, personal Response
Successful response
The response is of type object.