Skip to content
PATCH /static-gate/{id}

Update an existing static gate with new values.

Path Parameters

idstring · uuid
required·

The ID of the static gate you want to update.

Example: 1ba1f401-7183-47c5-9e39-e8e257e3c795

Request Body

api_tokenstring

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.

Example: your-new-static-gate-token
domainstring

The 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.

Example: updated.example.com
namestring

A descriptive name for the static gate.

Example: Updated Static Gate

Response Body

created_atstring · date-time

The date and time when the static gate was created.

Example: 2021-08-10T10:30:00.000Z
created_bystring · uuid

The ID of the user who created this static gate.

Example: b7bb7578-bff2-42b2-a57f-46c874865296
domainstring

The domain this static gate will proxy requests for.

Example: api.example.com
environment_idstring · uuid

The ID of the environment this static gate is scoped to.

Example: 8a2b104d-74a6-47f2-b93e-c6b611e82391
idstring · uuid

The ID of the static gate.

Example: 1ba1f401-7183-47c5-9e39-e8e257e3c795
namestring

A descriptive name for the static gate.

Example: My Static Gate
updated_atstring · date-time

The date and time when the static gate was last updated.

Example: 2021-08-10T10:30:00.000Z

Errors

StatusDescription
400Bad 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)
403Forbidden if the user does not have access to the static gate's environment
404Not 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 json
import 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())