Auth

User authentication and authorization for Phala Cloud

Register User

post

Register a new user with invite code

Body
usernamestringRequired
emailstring · emailRequired
passwordstringRequired
invite_codeany ofOptional
stringOptional
or
nullOptional
site_keyany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
Responseany
post
POST /api/v1/auth/register HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 101

{
  "username": "text",
  "email": "[email protected]",
  "password": "text",
  "invite_code": "text",
  "site_key": "text"
}

No content

Forgot Password

post

Request a password reset

Body
emailstring · emailRequired
Responses
200
Successful Response
application/json
Responseany
post
POST /api/v1/auth/forgot-password HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "email": "[email protected]"
}

No content

Validate Reset Token

get

Validate a password reset token.

Query parameters
tokenstringRequired
Responses
200
Successful Response
application/json
get
GET /api/v1/auth/validate-reset-token?token=text HTTP/1.1
Host: 
Accept: */*
{
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Handle Reset Password With Token

put

Reset password using a reset token.

Body

Request model for resetting password with token.

tokenstringRequired
passwordstringRequired
Responses
200
Successful Response
application/json
put
PUT /api/v1/auth/reset-password HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "token": "text",
  "password": "text"
}
{
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Login For Access Token

post

Traditional OAuth2 compatible token endpoint

Body
grant_typeany ofOptional
stringOptionalPattern: ^password$
or
nullOptional
usernamestringRequired
passwordstringRequired
scopestringOptionalDefault: ""
client_idany ofOptional
stringOptional
or
nullOptional
client_secretany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
Responseany
post
POST /api/v1/auth/token HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 110

"grant_type='text'&username='text'&password='text'&scope=''&client_id='text'&client_secret='text'"

No content

Login With Cookie

post

Cookie-based login endpoint

Body
grant_typeany ofOptional
stringOptionalPattern: ^password$
or
nullOptional
usernamestringRequired
passwordstringRequired
scopestringOptionalDefault: ""
client_idany ofOptional
stringOptional
or
nullOptional
client_secretany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
Responseany
post
POST /api/v1/auth/login HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 110

"grant_type='text'&username='text'&password='text'&scope=''&client_id='text'&client_secret='text'"

No content

Logout

post

Logout endpoint that clears the auth cookie

Responses
200
Successful Response
application/json
Responseany
post
POST /api/v1/auth/logout HTTP/1.1
Host: 
Accept: */*
200

Successful Response

No content

Authenticated

get

Check if user is authenticated

Authorizations
Responses
200
Successful Response
application/json
Responseany
get
GET /api/v1/auth/authenticated HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
200

Successful Response

No content

Read Users Me

get

Get current user info

Authorizations
Responses
200
Successful Response
application/json
Responseany
get
GET /api/v1/auth/me HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
200

Successful Response

No content

Handle Update Password

post

Update current user's password

Authorizations
Body
passwordstringRequired
Responses
200
Successful Response
application/json
post
POST /api/v1/auth/password HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "password": "text"
}
{
  "username": "text",
  "id": 1,
  "role": "text",
  "created_at": "2025-07-04T04:40:03.630Z",
  "credit": {
    "id": 1,
    "balance": 1,
    "granted_balance": 1
  }
}

Api Request Email Verification

post
Authorizations
Body
site_keystringOptional
Responses
200
Successful Response
application/json
Responseany
post
POST /api/v1/auth/request-email-verification HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 56

{
  "request": {
    "email": "[email protected]"
  },
  "site_key": "text"
}

No content

Api Verify Email Token

post
Body
site_keystringOptional
Responses
200
Successful Response
application/json
post
POST /api/v1/auth/verify-email-token HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "request": {
    "token": "text"
  },
  "site_key": "text"
}
{
  "ANY_ADDITIONAL_PROPERTY": "text"
}

Was this helpful?