POST
/
api
/
auth
/
register
curl --request POST \
  --url https://copilotz.com/api/auth/register \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Your Name",
  "email": "your.email@example.com",
  "phone": "9999999999",
  "password": "123456",
  "namespace": "your_namespace"
}'
{
  "_id": 4,
  "account": {
    "_id": 3,
    "provider": "email",
    "username": "your_email@example.com",
    "passwordHash": "cb376cae8261bd9394c1d5bf2d7c31dfc3be0e4e6777d73a1530decd34ed336c",
    "salt": "b79afdd432f7cf578c43bb2a29093fd6",
    "name": "Your Name",
    "context": {},
    "profile": 3,
    "createdAt": "2024-09-17T22:47:24.270Z",
    "updatedAt": "2024-09-17T22:47:24.270Z"
  },
  "role": 2,
  "workspace": {
    "_id": 6,
    "name": "My Workspace",
    "namespace": "my_namespace",
    "host": "my_namespace.copilotz.com",
    "status": "active",
    "context": {},
    "createdAt": "2024-09-17T22:47:22.643Z",
    "updatedAt": "2024-09-17T22:47:22.643Z"
  },
  "createdAt": "2024-09-17T22:47:25.423Z",
  "updatedAt": "2024-09-17T22:47:25.423Z"
}

Body

application/json

Request payload for user registration.

name
string
required

Full name of the user.

Example:

"Your Name"

email
string
required

User's email address.

Example:

"your.email@example.com"

phone
string
required

User's phone number.

Example:

"9999999999"

password
string
required

User's password.

Example:

"123456"

namespace
string
required

Namespace for the new user.

Example:

"your_namespace"

Response

200
application/json
OK

Successful registration response containing user and workspace details.

_id
integer
required

Unique identifier for the user.

Example:

4

account
object
required

Account details associated with the user.

role
integer
required

Role identifier assigned to the user.

Example:

2

workspace
object
required

Workspace details associated with the user.

createdAt
string
required

Timestamp when the user was created.

Example:

"2024-09-17T22:47:25.423Z"

updatedAt
string
required

Timestamp when the user was last updated.

Example:

"2024-09-17T22:47:25.423Z"