List Custom Error Templates

GET /v1/templates

List the caller's uploaded custom HTML error pages. Each template is rendered in place of the default Ngris error page when a request hits a matching condition — for example, a custom 403 page when the firewall denies a request, or a custom 502 page when the upstream is unreachable.

Only one template per type can be active at a time per user. Activate via /templates/{id}/activate; upload via /templates.

Query params

page int
1-based page number. Omit (or 0) for the legacy bare-array response.
page_size int
Rows per page. Defaults to the deployment's api.default_page_size; capped at api.max_page_size. Ignored when page is omitted.

Response (200 OK)

Two shapes for backward compatibility:

Legacy (no page): bare JSON array of templates.

Paginated (page ≥ 1): envelope with templates, total, page, page_size.

id int
Numeric template ID. Use with delete and activate.
type string
One of: firewall, rate_limit, bad_gateway, service_unavailable, not_found, request_timeout, internal_error, gateway_timeout. Determines which error condition the page replaces.
content string
Raw HTML body of the template. Up to 100 KB.
is_active boolean
true if this template is currently serving the given type for the user.
created_at, updated_at datetime
RFC 3339 UTC.

Errors

401 Unauthorized
Missing or invalid auth.
Request
curl "https://api.ngris.com/v1/templates?page=1&page_size=25" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") result = client.templates.list(page=1, page_size=25) for t in result["templates"]: active = " (active)" if t["is_active"] else "" print(f"{t['type']:<20} #{t['id']}{active}")
Response — 200 OK (paginated)
{ "templates": [ { "id": 42, "user_id": 7, "type": "firewall", "content": "<!doctype html><html><body>Blocked.</body></html>", "is_active": true, "created_at": "2026-04-01T10:00:00Z", "updated_at": "2026-04-01T10:00:00Z" } ], "total": 1, "page": 1, "page_size": 25 }
Iris