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
Headers
Key | Value | Required |
---|---|---|
Content-Type | application/json | Yes |
Authorization | Bearer <access_token> | Required for admin-created accounts |
Request Body
Field | Type | Required | Description |
---|---|---|---|
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)
Field | Type | Description |
---|---|---|
id | string | Unique identifier of the newly created user. |
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 Code | Meaning |
---|---|
invalid_request | Missing or malformed fields. |
email_exists | The email is already registered. |
unauthorized | Token missing or insufficient permissions. |
Example Usage
cURL
JavaScript (Fetch)
Passwords should never be logged or stored in plaintext. Always enforce strong password policies and transmit data over HTTPS.