---
title: "Setup Admin"
method: POST
path: "/api/auth/setup-admin"
tags: ["Authentication"]
---

# Setup Admin

`POST /api/auth/setup-admin`

## Request body

- RegisterRequest — User registration request model
  - `username` string, required
  - `email` string, nullable
  - `password` string, required

## Response `200`

Successful Response

- RegisterResponse — User registration response model
  - `success` boolean, required
  - `message` string, required
  - `user` object, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-06-13** `33e4ba4936ad` — 1 info
  - added the new optional request property `email`
- **2026-03-01** `239cac762143` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/xorbitsai/apis/xagent/changes/api/auth/setup-admin/post.md)

---

[API](https://skmtc.dev/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.dev/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
