Skip to main content
POST
/
v1beta1
/
users
Create User
curl --request POST \
  --url https://api.example.com/v1beta1/users \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "email": "<string>",
  "title": "<string>",
  "avatar": "<string>",
  "metadata": {}
}
'
{
  "400": {},
  "401": {},
  "409": {},
  "500": {},
  "user": {
    "id": "<string>",
    "name": "<string>",
    "title": "<string>",
    "email": "<string>",
    "avatar": "<string>",
    "state": "<string>",
    "metadata": {},
    "created_at": {},
    "updated_at": {}
  }
}
Create a new user in Frontier. If the email is not provided in the request body, it will be extracted from the authentication context.

Authentication

This endpoint requires authentication. Include a valid bearer token in the Authorization header.

Request Body

name
string
Username or slug for the user. Must start with a character. If not provided, it will be auto-generated from the email.
email
string
required
Email address of the user. Must be a valid email format. If not provided in the body, it will be extracted from the authentication context.
title
string
Display name or title for the user.
avatar
string
URL to the user’s avatar image.
metadata
object
Custom metadata to associate with the user. Must conform to the user metadata schema if validation is enabled.

Response

user
object
The newly created user object.
id
string
Unique identifier for the user (UUID).
name
string
User’s username or slug.
title
string
User’s title or display name.
email
string
User’s email address.
avatar
string
URL to the user’s avatar image.
state
string
Current state of the user account (defaults to enabled).
metadata
object
Custom metadata associated with the user.
created_at
timestamp
Timestamp when the user was created.
updated_at
timestamp
Timestamp when the user was last updated.

Example Request

curl -X POST 'https://api.frontier.example.com/v1beta1/users' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "john.doe",
    "email": "[email protected]",
    "title": "John Doe",
    "avatar": "https://example.com/avatars/john.jpg",
    "metadata": {
      "department": "Engineering"
    }
  }'

Example Response

{
  "user": {
    "id": "9f256f86-4a1e-4b2a-9c45-6d2c8f5a3b7e",
    "name": "john.doe",
    "title": "John Doe",
    "email": "[email protected]",
    "avatar": "https://example.com/avatars/john.jpg",
    "state": "enabled",
    "metadata": {
      "department": "Engineering"
    },
    "created_at": "2024-03-03T10:30:00Z",
    "updated_at": "2024-03-03T10:30:00Z"
  }
}

Error Codes

400
error
Bad Request - Invalid request body, missing required fields, or metadata schema validation failed.
401
error
Unauthorized - Invalid or missing authentication token.
409
error
Conflict - A user with this email already exists.
500
error
Internal Server Error - An unexpected error occurred.

Build docs developers (and LLMs) love