Activate Custom Error Template

POST /v1/templates/{uuid}/activate

Mark a previously-uploaded template as the active one for a given error type. The matching previously-active template (if any) is automatically deactivated — only one template per type is active at a time.

The type in the request body must match the type the template was uploaded with; it's required so the server can verify intent and atomically deactivate the right sibling.

Path params

uuid string (uuid) Req
The template's uuid, from list or the response of upload.

Deprecated: the legacy integer id is still accepted in the path until the sunset, answered with Deprecation and Sunset headers. Use the uuid.

Request body

type string Req
Must match the template's type. One of: firewall, rate_limit, bad_gateway, service_unavailable, not_found, request_timeout, internal_error, gateway_timeout.

Unknown fields in the body are rejected with 400 Bad Request.

Response (200 OK)

Empty body on success. The template is now serving requests of the given type; any previously-active template of the same type is deactivated.

Errors

400 Bad Request
An integer id after the sunset (integer_id_unsupported), type is unknown, body is not JSON, or body contains unexpected fields.
401 Unauthorized
Missing or invalid auth.
404 Not Found
Template not found — unknown uuid, or a template of another account.
Request
curl -X POST "https://api.ngris.com/v1/templates/019b0817-a55a-7007-b556-eea4fe532a62/activate" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"type": "firewall"}'
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") client.templates.activate("019b0817-a55a-7007-b556-eea4fe532a62", type="firewall")
Response — 200 OK
(empty body)
Was this helpful?
Was this helpful?