---
title: "Create a service descriptor error template"
method: POST
path: "/api/services/{serviceId}/template"
tags: ["services"]
---

# Create a service descriptor error template

`POST /api/services/{serviceId}/template`

Update a service descriptor targets

## Path parameters

- `serviceId` string, required

## Request body

- ErrorTemplate — Error templates for a service descriptor
  - `messages` object, required — Map for custom messages
  - `serviceId` string, required — The Id of the service for which the error template is enabled
  - `template40x` string, required — The html template for 40x errors
  - `template50x` string, required — The html template for 50x errors
  - `templateBuild` string, required — The html template for build page
  - `templateMaintenance` string, required — The html template for maintenance page

## Response `200`

Successful operation

- ErrorTemplate — Error templates for a service descriptor
  - `messages` object, required — Map for custom messages
  - `serviceId` string, required — The Id of the service for which the error template is enabled
  - `template40x` string, required — The html template for 40x errors
  - `template50x` string, required — The html template for 50x errors
  - `templateBuild` string, required — The html template for build page
  - `templateMaintenance` string, required — The html template for maintenance page

## Other responses

- `400` — Bad resource format. Take another look to the swagger, or open an issue :)
- `401` — You have to provide an Api Key. Api Key can be passed with 'Otoroshi-Client-Id' and 'Otoroshi-Client-Secret' headers, or use basic http authentication
- `404` — Resource not found or does not exist

---

[API](https://skmtc.net/maif/apis/otoroshi.md) · [All operations](https://skmtc.net/maif/apis/otoroshi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maif/otoroshi/versions/276881687271/schema)
