---
title: "Apply template to a game"
method: POST
path: "/api/manageTemplate/applyTemplateToGame"
tags: ["Manage Template"]
---

# Apply template to a game

`POST /api/manageTemplate/applyTemplateToGame`

## Request body

- ApplyTemplateToGameDto
  - `templateDir` string, required — The template name to apply
  - `gameDir` string, required — The game name to be applied.

## Response `200`

Template applied successfully.

## Other responses

- `400` — Invalid input data or failed to apply template.
- `404` — Template or game directory not found.
- `500` — Internal server error.

## Changes

- **2024-11-15** `c868708333be` — 2 breaking, 2 warning, 2 info
  - added the new required request property `gameDir`
  - added the new required request property `templateDir`
  - removed the request property `gameName`
  - removed the request property `templateName`
  - …2 more
- **2024-03-24** `953aa5d22ca0` — 1 info
  - endpoint added
- **2023-10-20** `bbfe1dbc457f` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/openwebgal/apis/webgal-terre-api/changes/api/manageTemplate/applyTemplateToGame/post.md)

---

[API](https://skmtc.dev/openwebgal/apis/webgal-terre-api.md) · [All operations](https://skmtc.dev/openwebgal/apis/webgal-terre-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openwebgal/webgal-terre-api/revisions/ebcacb42f932/schema)
