---
title: "Add Variant From Key Route"
method: POST
path: "/apps/{app_id}/variant/from-template"
tags: ["Apps"]
---

# Add Variant From Key Route

`POST /apps/{app_id}/variant/from-template`

## Path parameters

- `app_id` string, required

## Request body

- AddVariantFromKeyPayload
  - `variant_name` string, required
  - `key` string, required
  - `commit_message` string, nullable
  - `base_name` string, nullable
  - `config_name` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-02-13** `72fe88316d15` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2025-06-27** `e3e84db47198` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/apps/:app_id/variant/from-template/post.md)

---

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