Download OpenAPI specification:
Pluto provides a set of HTTP restful APIs for user authentication, authorization, RBAC, and OAuth services.
The API uses different authentication mechanisms:
All error responses follow this format:
{
"status": "error",
"error": {
"code": <error_code>,
"message": "<error_message>"
}
}
Register a new user account with email
| mail required | string <email> User email address |
| user_id required | string Unique user ID |
| name required | string User display name |
| password required | string User password |
| app_id required | string Application ID |
{- "mail": "user@example.com",
- "user_id": "string",
- "name": "string",
- "password": "string",
- "app_id": "string"
}{- "status": "ok",
- "body": { }
}Send verification email for user registration
string <email> User email address | |
| app_id required | string Application ID |
| user_id | string User ID |
{- "mail": "user@example.com",
- "app_id": "string",
- "user_id": "string"
}{- "status": "ok",
- "body": { }
}Authenticate user with email/username and password
| account required | string Email or username |
| password required | string User password |
| device_id | string Device identifier |
| app_id required | string Application ID |
{- "account": "string",
- "password": "string",
- "device_id": "string",
- "app_id": "string"
}{- "status": "ok",
- "body": { }
}Authenticate user with Google ID token for mobile applications
| id_token required | string Google ID token |
| device_id | string Device identifier |
| app_id required | string Application ID |
{- "id_token": "string",
- "device_id": "string",
- "app_id": "string"
}{- "status": "ok",
- "body": { }
}Authenticate user with Apple authorization code for mobile applications
| code required | string Apple authorization code |
| device_id | string Device identifier |
| app_id required | string Application ID |
{- "code": "string",
- "device_id": "string",
- "app_id": "string"
}{- "status": "ok",
- "body": { }
}Authenticate user with WeChat authorization code for mobile applications
| code required | string WeChat authorization code |
| device_id | string Device identifier |
| app_id required | string Application ID |
{- "code": "string",
- "device_id": "string",
- "app_id": "string"
}{- "status": "ok",
- "body": { }
}Send password reset email to user
| mail required | string <email> User email address |
| app_id required | string Application ID |
{- "mail": "user@example.com",
- "app_id": "string"
}{- "status": "ok",
- "body": { }
}Bind external accounts to the user profile
string <email> Email to bind | |
| code | string Authorization code |
| id_token | string ID token for social login |
| type required | string Binding type (mail, google, wechat, apple) |
{- "mail": "user@example.com",
- "code": "string",
- "id_token": "string",
- "type": "string"
}{- "status": "ok",
- "body": { }
}Remove external account binding from user profile
| type required | string Binding type to remove |
{- "type": "string"
}{- "status": "ok",
- "body": { }
}Update current user's profile information
| name | string User display name |
| avatar | string User avatar URL |
| user_id | string User ID |
{- "name": "string",
- "avatar": "string",
- "user_id": "string"
}{- "status": "ok",
- "body": { }
}Create a new role in the application
| app_id required | integer Application ID |
| name required | string Role name |
{- "app_id": 0,
- "name": "string"
}{- "status": "ok",
- "body": { }
}Create a new scope in the application
| app_id required | integer Application ID |
| name required | string Scope name |
{- "app_id": 0,
- "name": "string"
}{- "status": "ok",
- "body": { }
}Update the scopes assigned to a role
| role_id required | integer Role ID |
| scopes required | Array of integers Array of scope IDs |
{- "role_id": 0,
- "scopes": [
- 0
]
}{- "status": "ok",
- "body": { }
}Set the default scope for a role
| role_id required | integer Role ID |
| scope_id required | integer Scope ID |
{- "role_id": 0,
- "scope_id": 0
}{- "status": "ok",
- "body": { }
}Create a new application
| name required | string Application name |
{- "name": "string"
}{- "status": "ok",
- "body": {
- "id": 0,
- "name": "string",
- "webhook": "string",
- "default_role": 0
}
}Update internationalized names for the application
| app_id required | integer Application ID |
required | Array of objects |
{- "app_id": 0,
- "i18n_names": [
- {
- "tag": "string",
- "i18n_name": "string"
}
]
}{- "status": "ok",
- "body": { }
}Set the default role for an application
| app_id required | integer Application ID |
| role_id required | integer Role ID |
{- "app_id": 0,
- "role_id": 0
}{- "status": "ok",
- "body": { }
}Get a list of all roles in a specific application
| app_id required | integer Application ID |
{- "status": "ok",
- "body": {
- "application": {
- "id": 0,
- "name": "string",
- "webhook": "string",
- "default_role": 0
}, - "roles": [
- {
- "id": 0,
- "name": "string"
}
]
}
}Get a list of all scopes in a specific application
| app_id required | integer Application ID |
{- "status": "ok",
- "body": {
- "application": {
- "id": 0,
- "name": "string",
- "webhook": "string",
- "default_role": 0
}, - "scopes": [
- {
- "id": 0,
- "name": "string"
}
]
}
}Assign a role to a user for a specific application
| user_id required | integer User ID |
| app_id required | integer Application ID |
| role_id required | integer Role ID |
{- "user_id": 0,
- "app_id": 0,
- "role_id": 0
}{- "status": "ok",
- "body": { }
}Refresh an access token using a refresh token
| refresh_token required | string Refresh token |
| app_id required | string Application ID |
| scopes | string Requested scopes |
{- "refresh_token": "string",
- "app_id": "string",
- "scopes": "string"
}{- "status": "ok",
- "body": { }
}Request an OAuth access token using various grant types
| grant_type required | string Enum: "authorization_code" "password" "client_credentials" "refresh_token" OAuth grant type |
| code | string Authorization code (for authorization_code grant) |
| redirect_uri | string <uri> Redirect URI (for authorization_code grant) |
| scopes | string Requested scopes |
| app_id | string Application ID |
| device_id | string Device ID |
| password | string User password (for password grant) |
| user | string Username (for password grant) |
| refresh_token | string Refresh token (for refresh_token grant) |
{- "grant_type": "authorization_code",
- "code": "string",
- "scopes": "string",
- "app_id": "string",
- "device_id": "string",
- "password": "string",
- "user": "string",
- "refresh_token": "string"
}{- "status": "ok",
- "body": { }
}Create a new OAuth client
| key required | string Client key |
| secret required | string Client secret |
| redirect_uri required | string <uri> Client redirect URI |
{- "key": "string",
- "secret": "string",
}{- "status": "ok",
- "body": { }
}Change the status of an OAuth client (admin only)
| key required | string Client key |
| status required | string Client status |
{- "key": "string",
- "status": "string"
}{- "status": "ok",
- "body": { }
}Process web login form
| account required | string Email or username |
| password required | string User password |
| device_id | string Device identifier |
| app_id required | string Application ID |
{- "status": "ok",
- "body": { }
}