---
title: "Persist a new curated template order. Admin-only."
method: POST
path: "/api/v1/avatars/admin/templates/reorder"
tags: ["Avatars"]
---

# Persist a new curated template order. Admin-only.

`POST /api/v1/avatars/admin/templates/reorder`

## Request

- Base URL: `https://api.avatarfactory.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.avatarfactory.io/api/v1/avatars/admin/templates/reorder`
- Auth: one of:
  - API key in cookie `session`
  - HTTP bearer

<br/>``ids`` is the templates in their new order (typically one niche<br/>tab's cards). Each template row gets ``display_order`` = (position+1)<br/>* 10; duplicate ids honour the first occurrence and non-template ids<br/>are skipped, so the endpoint can never touch user avatars. Non-admins<br/>get 403; anonymous callers get 401.

## Request body

- ReorderAvatarsRequest: Payload for ``POST /api/v1/avatars/reorder``. ``ids`` is the caller's avatars in their new left-to-right / top-to- bottom order. The endpoint writes ``display_order`` = position in this list for every id the caller actually owns; unknown or foreign ids are silently skipped so a stale client can never reorder another user's rows. Unknown fields are rejected so the SPA can't drift the contract.
  - `ids` integer[], required

## Response `200`

OK

- ReorderAvatarsResponse: The persisted order after a reorder. ``ids`` echoes only the owned avatars that were reordered, in their new order, so the SPA can confirm which rows the write actually touched.
  - `ids` integer[], required
  - `success` boolean, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `422`: Unprocessable Entity

---

[API](https://skmtc.dev/avatarfactory/apis/avatarfactory-api.md) · [All operations](https://skmtc.dev/avatarfactory/apis/avatarfactory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/avatarfactory/apis/avatarfactory-api/revisions/66fc7aa3f296?raw)
