Skip to main content
PUT
/
v1beta1
/
users
/
{id}
Update User
curl --request PUT \
  --url https://api.example.com/v1beta1/users/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "email": "<string>",
  "title": "<string>",
  "avatar": "<string>",
  "metadata": {}
}
'
{
  "400": {},
  "401": {},
  "404": {},
  "409": {},
  "500": {},
  "user": {
    "id": "<string>",
    "name": "<string>",
    "title": "<string>",
    "email": "<string>",
    "avatar": "<string>",
    "state": "<string>",
    "metadata": {},
    "created_at": {},
    "updated_at": {}
  }
}
Update an existing user’s information. This endpoint supports upsert behavior when using email as the identifier - if the user doesn’t exist, it will be created.

Authentication

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

Path Parameters

id
string
required
User identifier. Can be one of:
  • User ID (UUID)
  • Email address (supports upsert)
  • Username/slug

Request Body

name
string
Username or slug for the user. Must start with a character.
email
string
required
Email address of the user. Must match the email in the path parameter if updating by email.
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 updated 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.
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 PUT 'https://api.frontier.example.com/v1beta1/users/9f256f86-4a1e-4b2a-9c45-6d2c8f5a3b7e' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "john.doe",
    "email": "[email protected]",
    "title": "John Doe - Senior Engineer",
    "avatar": "https://example.com/avatars/john-new.jpg",
    "metadata": {
      "department": "Engineering",
      "team": "Platform"
    }
  }'

Example Response

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

Upsert Behavior

When using an email address as the ID parameter:
  • If the user exists, their information will be updated
  • If the user doesn’t exist, a new user will be created with the provided information
  • The email in the request body must match the email in the path parameter

Error Codes

400
error
Bad Request - Invalid request body, missing required fields, email mismatch, or metadata schema validation failed.
401
error
Unauthorized - Invalid or missing authentication token.
404
error
Not Found - User does not exist with the provided identifier (when not using email).
409
error
Conflict - Email already exists for a different user.
500
error
Internal Server Error - An unexpected error occurred.

Build docs developers (and LLMs) love