Skip to main content
POST
/
v1
/
auth
/
realms
Create Realm
curl --request POST \
  --url https://api.example.com/v1/auth/realms \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "<string>",
  "name": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "error": "<string>"
}

Overview

Realms provide multi-tenancy isolation in QAuth. Each realm maintains its own set of users, roles, and clients. This endpoint creates a new realm with a unique identifier and display name.

Request Body

id
string
required
Unique realm identifier. Used as the primary key for realm lookups.
name
string
required
Human-readable display name for the realm.

Response

Returns the created realm object:
id
string
The unique realm identifier.
name
string
The display name of the realm.

Example

cURL
curl -X POST http://localhost:8080/v1/auth/realms \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "acme",
    "name": "Acme Corporation"
  }'
Response
{
  "id": "acme",
  "name": "Acme Corporation"
}

Error Responses

error
string
Human-readable error message when the request fails.
Common errors:
  • 400 Bad Request: Invalid request format or missing required fields
  • 500 Internal Server Error: Realm creation failed due to internal error

Build docs developers (and LLMs) love