Admin Account Management API

The Admin Account Management API provides a comprehensive set of endpoints to manage admin users within the system efficiently. These endpoints allow for the creation, updating, activation, deactivation, and role management of admin accounts, ensuring that users have the appropriate access and permissions. The API supports retrieving a list of admin users, adding or removing roles, and enabling or disabling accounts, all secured through Basic Authentication to maintain strict access control.
Endpoints
GET /users
POST /user
PUT /user/[id]
DELETE /user/[id]
POST /user/[id]/activate
POST /user/[id]/deactivate
PUT /user/[id]/access
DELETE /user/[id]/access
Get All Users
GET /users

Authentication

Basic Auth

This endpoint retrieves a list of all admin users in the system along with their associated roles

Responses

200 OK

The request was successful, and the response includes a list of all admin users along with their roles and other relevant details

Body
Object
users
Array
Object
id
string
email
string
roles
Array of string
active
boolean
firstName
string
lastName
string
Examples
{
    "users": [
        {
            "id": "0x0000...",
            "firstName": "John",
            "lastName": "Doe",
            "email": "xxxxxxaj@wbd.com",
            "roles": [
                "CMS_ADMIN",
                "LAUNCHPAD_MINTER",
                "LAUNCHPAD_APPROVER"
            ],
            "active": true
        }
    ]
}
400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

500 Internal Server Error

An unexpected error occurred on the server

Create New User
POST /user

Authentication

Basic Auth

This endpoint allows for the creation of a new admin user in the system

Request body

Examples
{
    "firstName": "John",
    "lastName": "Doe",
    "email": "xxxxxxaj@wbd.com",
    "roles": [
        "CMS_ADMIN",
        "LAUNCHPAD_MINTER",
        "LAUNCHPAD_APPROVER"
    ],
    "active": false
}

Responses

200 OK

The admin account was successfully created. The response includes the details of the newly created user.

Body
Examples
{
    "id": "0x0000...",
    "firstName": "John",
    "lastName": "Doe",
    "email": "xxxxxxaj@wbd.com",
    "roles": [
        "CMS_ADMIN",
        "LAUNCHPAD_MINTER",
        "LAUNCHPAD_APPROVER"
    ],
    "active": false
}
400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

409 Conflict

There was a conflict in creating the admin user, often due to a unique constraint violation, such as trying to create or update an user with an existing email

500 Internal Server Error

An unexpected error occurred on the server

Update User
PUT /user/[id]

Authentication

Basic Auth

This endpoint updates the details of an existing admin user.

Request parameters

id
string required

A unique identifier for the user

Request body

Examples
{
    "firstName": "John",
    "lastName": "Doe",
    "email": "xxxxxxaj@wbd.com",
    "roles": [
        "CMS_ADMIN",
        "LAUNCHPAD_MINTER",
        "LAUNCHPAD_APPROVER"
    ],
    "active": true
}

Responses

200 OK

The admin account was successfully updated. The response includes the details of the updated user.

400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

404 Not Found

The specified admin account could not be found

409 Conflict

There was a conflict in creating the admin user, often due to a unique constraint violation, such as trying to create or update an user with an existing email

500 Internal Server Error

An unexpected error occurred on the server

Delete User
DELETE /user/[id]

Authentication

Basic Auth

This endpoint updates the details of an existing admin user.

Request parameters

id
string required

A unique identifier for the user

Responses

200 OK

The admin account was successfully deleted. The response includes the details of the deleted user.

400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

404 Not Found

The specified admin account could not be found

500 Internal Server Error

An unexpected error occurred on the server

Activate User
POST /user/[id]/activate

Authentication

Basic Auth

This endpoint activates an admin account by setting the Active status to true

Request parameters

id
string required

A unique identifier for the user

Responses

200 OK

The admin account was successfully enabled

Body
Examples
{
    "id": "0x0000...",
    "firstName": "John",
    "lastName": "Doe",
    "email": "xxxxxxaj@wbd.com",
    "roles": [
        "CMS_ADMIN",
        "LAUNCHPAD_MINTER",
        "LAUNCHPAD_APPROVER"
    ],
    "active": true
}
400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

404 Not Found

The specified admin account could not be found

500 Internal Server Error

An unexpected error occurred on the server

Deactivate User
POST /user/[id]/deactivate

Authentication

Basic Auth

This endpoint deactivates an admin account by setting the Active status to false

Request parameters

id
string required

A unique identifier for the user

Responses

200 OK

The admin account was successfully disabled

Body
Examples
{
    "id": "0x0000...",
    "firstName": "John",
    "lastName": "Doe",
    "email": "xxxxxxaj@wbd.com",
    "roles": [
        "CMS_ADMIN",
        "LAUNCHPAD_MINTER",
        "LAUNCHPAD_APPROVER"
    ],
    "active": false
}
400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

404 Not Found

The specified admin account could not be found

500 Internal Server Error

An unexpected error occurred on the server

Add Access to User
PUT /user/[id]/access

Authentication

Basic Auth

This endpoint grants additional roles to an admin user, enhancing their permissions. The roles are added to the existing set of roles for that user.

Request parameters

id
string required

A unique identifier for the user

Request body

Examples
[
    "CMS_ADMIN",
    "LAUNCHPAD_MINTER",
    "LAUNCHPAD_APPROVER"
]

Responses

200 OK

The roles were successfully added to the admin account. The response includes the updated details of the user with the new roles

400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

404 Not Found

The specified admin account could not be found

500 Internal Server Error

An unexpected error occurred on the server

Revoke Access to User
DELETE /user/[id]/access

Authentication

Basic Auth

This endpoint revokes specific roles from an admin user, limiting their permissions within the system. The specified roles are removed from the user’s current roles.

Request parameters

id
string required

A unique identifier for the user

Request body

Examples
[
    "CMS_ADMIN",
    "LAUNCHPAD_MINTER",
    "LAUNCHPAD_APPROVER"
]

Responses

200 OK

The specified roles were successfully removed from the admin account. The response includes the updated details of the user with the remaining roles

400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

404 Not Found

The specified admin account could not be found

500 Internal Server Error

An unexpected error occurred on the server

Params
id
string required

A unique identifier for the user

Schemas
UserRequest

This schema defines the structure and properties of the admin user response object

Object
Example:
{
    "firstName": "John",
    "lastName": "Doe",
    "email": "xxxxxxaj@wbd.com",
    "roles": [
        "CMS_ADMIN",
        "LAUNCHPAD_MINTER",
        "LAUNCHPAD_APPROVER"
    ],
    "active": true
}
firstName
string

The first name of the user

lastName
string

The last name of the user

email
string

The email address associated with the user

roles
Array of string

An array of roles assigned to the user. Roles determine the user’s permissions and access levels within the system. The roles can include CMS_ADMIN, LAUNCHPAD_MINTER, and LAUNCHPAD_APPROVER

active
boolean

A boolean flag indicating whether the user’s account is active

RoleRequest

This schema defines the structure and properties of the role request object

Array of string
Example:
[
    "CMS_ADMIN",
    "LAUNCHPAD_MINTER",
    "LAUNCHPAD_APPROVER"
]
UserResponse

This schema defines the structure and properties of the admin user request object

Object
Example:
{
    "id": "0x0000...",
    "firstName": "John",
    "lastName": "Doe",
    "email": "xxxxxxaj@wbd.com",
    "roles": [
        "CMS_ADMIN",
        "LAUNCHPAD_MINTER",
        "LAUNCHPAD_APPROVER"
    ],
    "active": true
}
id
string

A unique identifier for the user

firstName
string

The first name of the user

lastName
string

The last name of the user

email
string

The email address associated with the user

roles
Array of string

An array of roles assigned to the user. Roles determine the user’s permissions and access levels within the system. The roles can include CMS_ADMIN, LAUNCHPAD_MINTER, and LAUNCHPAD_APPROVER

active
boolean

A boolean flag indicating whether the user’s account is active

ErrorResponse

This schema defines the structure and properties of the error response object

Object
error
string
Common Responses
400 Bad Request

The request was invalid. This might occur if required parameters were missing, incorrectly formatted, or if there were validation errors

Body
Examples
{
    "error": "Invalid request data. Please check the input parameters."
}
401 Unauthorized

Authentication failed. The user credentials provided are invalid or missing

Body
Examples
{
    "error": "Unauthorized access. Please provide valid credentials."
}
404 Not Found

The specified admin account could not be found

Body
Examples
{
    "error": "Admin account not found."
}
409 Conflict

There was a conflict in creating the admin user, often due to a unique constraint violation, such as trying to create or update an user with an existing email

Body
Examples
{
    "error": "Conflict: Admin account with the provided ID or email already exists."
}
500 Internal Server Error

An unexpected error occurred on the server

Body
Examples
{
    "error": "An error occurred. Please try again later."
}