Skip to main content
These endpoints cover the user account lifecycle: registration, email confirmation, login, password management, and account deletion. Successful responses are wrapped in the standard { "meta": ..., "data": ... } envelope, where data holds the value described under each endpoint.

POST /api/user/register

Create the admin user and company account with the related parameters. After registering, a confirmation code is emailed to the user.

Authorization

This endpoint is unauthenticated. No access token is required.

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
emailstringYesEmail address (used as the username)Valid email
passwordstringYesAccount passwordMin 3 characters
company_namestringYesYour company name[ 2 .. 60 ] characters
first_namestring or nullNoFirst name[ 1 .. 50 ] characters
last_namestring or nullNoLast name[ 1 .. 50 ] characters
company_descriptionstring or nullNoDescription of your companyMax 1024 characters
countrystring or nullNoCountry[ 2 .. 60 ] characters

Request Example

{
  "email": "jane.doe@acme.com",
  "password": "S3curePass!",
  "company_name": "Acme Compute",
  "first_name": "Jane",
  "last_name": "Doe",
  "company_description": "GPU cloud provider",
  "country": "United States"
}

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/register",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": "User registered successfully. Please confirm your email."
}
  • 422: Validation Error
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}

POST /api/user/confirm

Confirm the registration of the user using the confirmation code that was emailed during registration.

Authorization

This endpoint is unauthenticated. No access token is required.

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
emailstringYesEmail addressValid email
confirmation_codestringYesThe confirmation code sent by email

Request Example

{
  "email": "jane.doe@acme.com",
  "confirmation_code": "123456"
}

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/confirm",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": "User confirmed successfully."
}
  • 422: Validation Error
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}

POST /api/user/resend-confirmation-code

Resend the registration verification code to the user’s email.

Authorization

This endpoint is unauthenticated. No access token is required.

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
emailstringYesEmail addressValid email

Request Example

{
  "email": "jane.doe@acme.com"
}

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/resend-confirmation-code",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": "The verification code already sent to your email:jane.doe@acme.com"
}
  • 422: Validation Error
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}

POST /api/user/initiate-set-password

Used for the user’s initial authentication. Exchanges a temporary password for a new password and returns the authentication tokens. This is required when an account was created with a temporary password and login returns a NEW_PASSWORD_REQUIRED challenge.

Authorization

This endpoint is unauthenticated. No access token is required (the temporary password is supplied in the body).

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
emailstringYesEmail addressValid email
temporary_passwordstringYesThe temporary passwordMin 3 characters
new_passwordstringYesThe new password to setMin 3 characters

Request Example

{
  "email": "jane.doe@acme.com",
  "temporary_password": "Temp1234",
  "new_password": "S3curePass!"
}

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/initiate-set-password",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "access_token": "eyJraWQiOiJ...",
    "refresh_token": "eyJjdHkiOiJ...",
    "id_token": "eyJraWQiOiJ...",
    "token_type": "Bearer",
    "expires_in": 3600
  }
}
  • 422: Validation Error
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}

POST /api/user/login

Log in with email and password to obtain the access_token, id_token, and refresh_token. The id_token is the Bearer token used to authenticate the other user and application endpoints.

Authorization

This endpoint is unauthenticated. No access token is required.

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
emailstringYesEmail addressValid email
passwordstringYesPassword

Request Example

{
  "email": "jane.doe@acme.com",
  "password": "S3curePass!"
}

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/login",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "access_token": "eyJraWQiOiJ...",
    "refresh_token": "eyJjdHkiOiJ...",
    "id_token": "eyJraWQiOiJ...",
    "token_type": "bearer",
    "expires_in": 3600,
    "company_name": "Acme Compute"
  }
}
  • 422: Validation Error
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}

GET /api/user/me

Get the current user’s information using the id_token.

Authorization

🔒OAuth2: OAuth2PasswordBearer
Flow type: password
Token URL: token

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/me",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": {
    "email": "jane.doe@acme.com",
    "first_name": "Jane",
    "last_name": "Doe",
    "company_name": "Acme Compute"
  }
}

POST /api/user/forgot-password

Send a confirmation code to the user’s email to begin a password reset.

Authorization

This endpoint is unauthenticated. No access token is required.

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
emailstringYesEmail addressValid email

Request Example

{
  "email": "jane.doe@acme.com"
}

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/forgot-password",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": [
    "Password reset has been initiated, please check your email:jane.doe@acme.com for the confirmation code"
  ]
}
  • 422: Validation Error
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}

POST /api/user/reset-password

Reset the password for the user using the confirmation code sent by forgot-password.

Authorization

This endpoint is unauthenticated. No access token is required.

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
emailstringYesEmail addressValid email
confirmation_codestringYesThe confirmation code sent by email
new_passwordstringYesThe new password to set

Request Example

{
  "email": "jane.doe@acme.com",
  "confirmation_code": "123456",
  "new_password": "N3wSecurePass!"
}

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/reset-password",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": "Update your password successfully"
}
  • 422: Validation Error
{
  "detail": [
    {
      "loc": [
        "string"
        ],
        "msg": "string",
        "type": "string"
    }
  ]
}

DELETE /api/user/delete-current-account

Delete the currently authenticated user’s account. The user must have logged in successfully and supply a valid access token.

Authorization

🔒OAuth2: OAuth2PasswordBearer
Flow type: password
Token URL: token

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/user/delete-current-account",
    "message": "OK",
    "timestamp": 1744201871
  },
  "data": "Your account has been deleted."
}