Update static gate
/static-gate/{id}
Update an existing static gate with new values.
Path Parameters
The ID of the static gate you want to update.
1ba1f401-7183-47c5-9e39-e8e257e3c795Request Body
A new token for the gate, replacing the stored one. Required when domain changes, and it must be sent with domain (the current one, to rotate the token in place), so the token is saved with the domain it is for. Not returned in the response. On a gate on Truto's own Static Gate, which uses Truto's token, accepted only with a domain that moves it to your own gate.
your-new-static-gate-tokenThe domain this static gate will proxy requests for: a host name with an optional port, as on create. Any change to the stored text, letter case included, requires api_token in the same request: Truto never sends the stored token to a new domain. It can't change to Truto's own Static Gate; a gate Truto support set up there keeps its domain, and can move to your own gate with a token.
updated.example.comA descriptive name for the static gate.
Updated Static GateResponse Body
The 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 domain changes without api_token, api_token is sent without domain, api_token is blank or not a string (a stored domain sent back unchanged without api_token is not re-checked), domain changes to Truto's own Static Gate, api_token is sent for a gate on Truto's own Static Gate, or domain is not a public host name with an optional port (for example localhost, a private or reserved IP address, or a value with a scheme, path or credentials) |
403 | Forbidden if the user does not have access to the static gate's environment |
404 | Not found if no static gate with that ID |
truto gates update '<id>' \
-b '{
"name": "Updated Static Gate",
"domain": "updated.example.com",
"api_token": "your-new-static-gate-token"
}' \
-o jsonimport Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const body = {
"name": "Updated Static Gate",
"domain": "updated.example.com",
"api_token": "your-new-static-gate-token"
};
const result = await truto.staticGate.update('<id>', body);
console.log(result);import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
body = {
"name": "Updated Static Gate",
"domain": "updated.example.com",
"api_token": "your-new-static-gate-token"
}
result = await truto_api.static_gates.update("<id>", body)
print(result)
asyncio.run(main())curl -X PATCH 'https://api.truto.one/static-gate/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Updated Static Gate",
"domain": "updated.example.com",
"api_token": "your-new-static-gate-token"
}'const body = {
"name": "Updated Static Gate",
"domain": "updated.example.com",
"api_token": "your-new-static-gate-token"
};
const response = await fetch('https://api.truto.one/static-gate/{id}', {
method: 'PATCH',
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/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"name": "Updated Static Gate",
"domain": "updated.example.com",
"api_token": "your-new-static-gate-token"
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())