Create static gate
/static-gate
Create a new static gate for domain proxying. The API token will be automatically generated if not provided.
Request Body
Optional. The token the gate expects from Truto. Generated when omitted. Returned once, in this response, as api_token.
The domain this static gate will proxy requests for.
api.example.comThe ID of the environment this static gate will be scoped to.
8a2b104d-74a6-47f2-b93e-c6b611e82391A descriptive name for the static gate.
My Static GateResponse Body
The static gate's API token, the one you sent or a generated one. Returned only in this response.
abc123def456ghi789jkl012mno345pqr678stu901vwx234yzThe date and time when the static gate was created.
2021-08-10T10:30:00.000ZThe ID of the user who created this static gate.
b7bb7578-bff2-42b2-a57f-46c874865296The domain this static gate will proxy requests for.
api.example.comThe ID of the environment this static gate is scoped to.
8a2b104d-74a6-47f2-b93e-c6b611e82391The ID of the static gate.
1ba1f401-7183-47c5-9e39-e8e257e3c795A descriptive name for the static gate.
My Static GateThe date and time when the static gate was last updated.
2021-08-10T10:30:00.000ZErrors
| Status | Description |
|---|---|
400 | Bad request if required fields are missing |
403 | Forbidden if the user does not have access to the specified environment, or environment_id is missing. |
truto gates create \
-b '{
"name": "My Static Gate",
"domain": "api.example.com",
"environment_id": "8a2b104d-74a6-47f2-b93e-c6b611e82391",
"api_token": "your_api_token"
}' \
-o jsonimport Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const body = {
"name": "My Static Gate",
"domain": "api.example.com",
"environment_id": "8a2b104d-74a6-47f2-b93e-c6b611e82391",
"api_token": "your_api_token"
};
const result = await truto.staticGate.create(body);
console.log(result);import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
body = {
"name": "My Static Gate",
"domain": "api.example.com",
"environment_id": "8a2b104d-74a6-47f2-b93e-c6b611e82391",
"api_token": "your_api_token"
}
result = await truto_api.static_gates.create(body)
print(result)
asyncio.run(main())curl -X POST 'https://api.truto.one/static-gate' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "My Static Gate",
"domain": "api.example.com",
"environment_id": "8a2b104d-74a6-47f2-b93e-c6b611e82391",
"api_token": "your_api_token"
}'const body = {
"name": "My Static Gate",
"domain": "api.example.com",
"environment_id": "8a2b104d-74a6-47f2-b93e-c6b611e82391",
"api_token": "your_api_token"
};
const response = await fetch('https://api.truto.one/static-gate', {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/static-gate"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"name": "My Static Gate",
"domain": "api.example.com",
"environment_id": "8a2b104d-74a6-47f2-b93e-c6b611e82391",
"api_token": "your_api_token"
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())