Users

Create a new user

Register a new user with the required account details.

The Create User endpoint allows you to register a new user in your application. This is typically used during the signup flow.

Endpoint

POST /v1/users

Headers

Key

Value

Required

Content-Type

application/json

Yes

Authorization

Bearer <access_token>

Required for admin-created accounts

Request Body

{
  "email": "newuser@example.com",
  "password": "strong_password_here",
  "name": "Jane Doe"
}

Field

Type

Required

Description

email

string

Yes

The user’s unique email address.

password

string

Yes

A strong password for the new account.

name

string

No

The user’s full name.

Response

Successful Response (201 Created)

{
  "id": "user_456",
  "email": "newuser@example.com",
  "name": "Jane Doe",
  "status": "active",
  "created_at": "2025-09-18T19:40:00Z",
  "updated_at": "2025-09-18T19:40:00Z"
}

Field

Type

Description

id

string

Unique identifier of the newly created user.

email

string

The user’s email address.

name

string

Full name of the user.

status

string

Account status, usually active after creation.

created_at

string

ISO 8601 timestamp of creation.

updated_at

string

ISO 8601 timestamp of last update.

Error Response (400 / 409)

{
  "error": "email_exists",
  "message": "A user with this email already exists."
}

Error Code

Meaning

invalid_request

Missing or malformed fields.

email_exists

The email is already registered.

unauthorized

Token missing or insufficient permissions.

Example Usage

cURL

curl -X POST "https://api.example.com/v1/users" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer admin_access_token" \
  -d '{
    "email": "newuser@example.com",
    "password": "strong_password_here",
    "name": "Jane Doe"
  }'

JavaScript (Fetch)

const response = await fetch("https://api.example.com/v1/users", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer admin_access_token"
  },
  body: JSON.stringify({
    email: "newuser@example.com",
    password: "strong_password_here",
    name: "Jane Doe"
  })
});

const data = await response.json();
console.log(data.id);

Passwords should never be logged or stored in plaintext. Always enforce strong password policies and transmit data over HTTPS.

Need help? Contact Support

Questions? Contact Sales

On this page

Create a free website with Framer, the website builder loved by startups, designers and agencies.