# Admin Management

## Retrieve a List of Admins

> \### Retrieve a List of Admins\
> \
> This endpoint allows administrators to retrieve a list of all admins associated with their account. The response includes user details.\
> \
> \*\*Usage Example:\*\*\
> Send a \`GET\` request to \`admin-management/admins-list/\`.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a JSON array, where each element is an admin object containing:\
> \
> \- \`uid\` \*(string)\*: Unique identifier of the admin.\
> \- \`email\` \*(string)\*: Email address of the admin.\
> \- \`display\_name\` \*(string)\*: Display name of the admin.\
> \- \`status\` \*(string)\*: Status of the admin account. Possible values: 'Active'.\
> \
> \*\*Notes:\*\*\
> \- Proper authorization is required; only users with admin privileges can access this endpoint.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/admin-management/admins-list/":{"get":{"operationId":"admin-management_admins-list_list","summary":"Retrieve a List of Admins","description":"### Retrieve a List of Admins\n\nThis endpoint allows administrators to retrieve a list of all admins associated with their account. The response includes user details.\n\n**Usage Example:**\nSend a `GET` request to `admin-management/admins-list/`.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a JSON array, where each element is an admin object containing:\n\n- `uid` *(string)*: Unique identifier of the admin.\n- `email` *(string)*: Email address of the admin.\n- `display_name` *(string)*: Display name of the admin.\n- `status` *(string)*: Status of the admin account. Possible values: 'Active'.\n\n**Notes:**\n- Proper authorization is required; only users with admin privileges can access this endpoint.","responses":{"200":{"description":"Successfully retrieved the list of admins.","content":{"application/json":{"schema":{"required":["query_count","users"],"type":"object","properties":{"users":{"description":"List of admins retrieved.","type":"array","items":{"required":["uid","email","display_name","status"],"type":"object","properties":{"uid":{"description":"Unique identifier of the admin.","type":"string"},"email":{"description":"Email address of the admin.","type":"string","format":"email"},"display_name":{"description":"Display name of the admin.","type":"string"},"status":{"description":"Status of the admin account. Possible values: 'Active', 'Invited'.","type":"string"}}}}}}}}},"400":{"description":"Bad Request - Invalid query parameters provided.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"403":{"description":"Forbidden - User lacks super admin privileges.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"404":{"description":"Not Found - No admins found.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"]}}}}
```

## List User Invitations

> \### List User Invitations\
> \
> This endpoint allows a user to retrieve a list of their pending invitations to become a sub-admin. Each invitation includes details such as the inviter's information and the invitation status.\
> \
> \*\*Usage Example:\*\*\
> Send a \`GET\` request to \`admin-management/invitations/\`.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a JSON object containing a list of invitations.\
> \
> \*\*Notes:\*\*\
> \- Proper authentication is required; only authenticated users can access their invitations.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"}}},"paths":{"/admin-management/invitation/":{"get":{"operationId":"admin-management_invitation_list","summary":"List User Invitations","description":"### List User Invitations\n\nThis endpoint allows a user to retrieve a list of their pending invitations to become a sub-admin. Each invitation includes details such as the inviter's information and the invitation status.\n\n**Usage Example:**\nSend a `GET` request to `admin-management/invitations/`.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a JSON object containing a list of invitations.\n\n**Notes:**\n- Proper authentication is required; only authenticated users can access their invitations.","responses":{"200":{"description":"Successfully retrieved a list of user invitations.","content":{"application/json":{"schema":{"required":["invitations"],"type":"object","properties":{"invitations":{"description":"List of user invitations.","type":"array","items":{"required":["invite_token","admin_uid","admin_email","admin_display_name","invitee_email","status","created_at"],"type":"object","properties":{"invite_token":{"description":"Unique token identifying the invitation.","type":"string"},"admin_uid":{"description":"UID of the admin who sent the invitation.","type":"string"},"admin_email":{"description":"Email address of the admin.","type":"string","format":"email"},"admin_display_name":{"description":"Display name of the admin.","type":"string"},"invitee_email":{"description":"Email address of the invitee.","type":"string","format":"email"},"status":{"description":"Current status of the invitation. Possible values: 'pending', 'accepted', 'declined'.","type":"string"},"created_at":{"description":"Timestamp when the invitation was created.","type":"string","format":"date-time"}}}}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"404":{"description":"Not Found - No invitations found for the user.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"]}}}}
```

## Create a User Invitation

> \### Create a User Invitation\
> \
> This endpoint allows a super administrator to create an invitation for a user to become a sub-admin. Provide the \`user\_email\` of the user you wish to invite. Optionally, you can include a \`platform\_link\` to direct the user to your platform upon accepting the invitation.\
> \
> \*\*Usage Example:\*\*\
> Send a \`POST\` request to \`admin-management/invitation/\` with a JSON body containing the \`user\_email\` and optionally the \`platform\_link\`.\
> \
> \*\*Request Body:\*\*\
> \- \`user\_email\` \*(string, required)\*: The email address of the user to be invited as a sub-admin.\
> \- \`platform\_link\` \*(string, optional)\*: A URL to direct the invited user to your platform.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a JSON object containing the invitation details.\
> \
> \*\*Notes:\*\*\
> \- The \`user\_email\` must correspond to an existing user or a new user to be invited.\
> \- Only users with super admin privileges can access this endpoint.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"}}},"paths":{"/admin-management/invitation/":{"post":{"operationId":"admin-management_invitation_create","summary":"Create a User Invitation","description":"### Create a User Invitation\n\nThis endpoint allows a super administrator to create an invitation for a user to become a sub-admin. Provide the `user_email` of the user you wish to invite. Optionally, you can include a `platform_link` to direct the user to your platform upon accepting the invitation.\n\n**Usage Example:**\nSend a `POST` request to `admin-management/invitation/` with a JSON body containing the `user_email` and optionally the `platform_link`.\n\n**Request Body:**\n- `user_email` *(string, required)*: The email address of the user to be invited as a sub-admin.\n- `platform_link` *(string, optional)*: A URL to direct the invited user to your platform.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a JSON object containing the invitation details.\n\n**Notes:**\n- The `user_email` must correspond to an existing user or a new user to be invited.\n- Only users with super admin privileges can access this endpoint.","responses":{"201":{"description":"Invitation successfully created.","content":{"application/json":{"schema":{"required":["invite_token","admin_uid","invitee_email","status","created_at"],"type":"object","properties":{"invite_token":{"description":"Unique token identifying the invitation.","type":"string"},"admin_uid":{"description":"UID of the admin who created the invitation.","type":"string"},"invitee_email":{"description":"Email address of the invited user.","type":"string","format":"email"},"status":{"description":"Current status of the invitation. Possible values: 'pending'.","type":"string"},"created_at":{"description":"Timestamp when the invitation was created.","type":"string","format":"date-time"},"platform_link":{"description":"URL to direct the invited user upon accepting the invitation.","type":"string","format":"uri"}}}}}},"400":{"description":"Bad Request - Missing or invalid parameters.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"403":{"description":"Forbidden - User lacks super admin privileges.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"404":{"description":"Not Found - Admin or user not found.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"],"requestBody":{"content":{"application/json":{"schema":{"required":["user_email"],"type":"object","properties":{"user_email":{"description":"Email address of the user to be invited as a sub-admin.","type":"string","format":"email"},"platform_link":{"description":"Optional URL to direct the invited user upon accepting the invitation.","type":"string","format":"uri"}}}}},"required":true}}}}}
```

## Remove a User Invitation

> \### Remove a User Invitation\
> \
> This endpoint allows a super administrator to remove an existing invitation identified by the \`invite\_token\`. Providing a valid \`invite\_token\` will delete the corresponding invitation.\
> \
> \*\*Usage Example:\*\*\
> Send a \`DELETE\` request to \`admin-management/invitations/\` with a JSON body containing the \`invite\_token\`.\
> \
> \*\*Request Body:\*\*\
> \- \`invite\_token\` \*(string, required)\*: The unique token of the invitation to be removed.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a confirmation message.\
> \
> \*\*Notes:\*\*\
> \- The \`invite\_token\` must correspond to an existing invitation.\
> \- Only users with super admin privileges can access this endpoint.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"}}},"paths":{"/admin-management/invitation/":{"delete":{"operationId":"admin-management_invitation_delete","summary":"Remove a User Invitation","description":"### Remove a User Invitation\n\nThis endpoint allows a super administrator to remove an existing invitation identified by the `invite_token`. Providing a valid `invite_token` will delete the corresponding invitation.\n\n**Usage Example:**\nSend a `DELETE` request to `admin-management/invitations/` with a JSON body containing the `invite_token`.\n\n**Request Body:**\n- `invite_token` *(string, required)*: The unique token of the invitation to be removed.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a confirmation message.\n\n**Notes:**\n- The `invite_token` must correspond to an existing invitation.\n- Only users with super admin privileges can access this endpoint.","responses":{"200":{"description":"Invitation successfully removed.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Confirmation message.","type":"string"}}}}}},"400":{"description":"Bad Request - Missing or invalid parameters.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"403":{"description":"Forbidden - User lacks super admin privileges.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"404":{"description":"Not Found - Invitation not found.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"],"requestBody":{"content":{"application/json":{"schema":{"required":["invite_token"],"type":"object","properties":{"invite_token":{"description":"Unique token identifying the invitation to be removed.","type":"string"}}}}},"required":true}}}}}
```

## Respond to an Invitation

> \### Respond to an Invitation\
> \
> This endpoint allows a user to respond to a specific invitation identified by the \`invite\_token\`. Provide the \`user\_response\` parameter with either 'accept' or 'decline' to respond to the invitation.\
> \
> \*\*Usage Example:\*\*\
> Send a \`POST\` request to \`admin-management/invitations/respond/\` with a JSON body containing the \`invite\_token\` and \`user\_response\`.\
> \
> \*\*Request Body:\*\*\
> \- \`invite\_token\` \*(string, required)\*: Unique token identifying the invitation to respond to.\
> \- \`user\_response\` \*(string, required)\*: The user's response to the invitation. Must be either 'accept' or 'decline'.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a confirmation message.\
> \
> \*\*Notes:\*\*\
> \- The \`invite\_token\` must correspond to an existing invitation.\
> \- Only authenticated users can access this endpoint.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"}}},"paths":{"/admin-management/invitation/respond/":{"post":{"operationId":"admin-management_invitation_respond_create","summary":"Respond to an Invitation","description":"### Respond to an Invitation\n\nThis endpoint allows a user to respond to a specific invitation identified by the `invite_token`. Provide the `user_response` parameter with either 'accept' or 'decline' to respond to the invitation.\n\n**Usage Example:**\nSend a `POST` request to `admin-management/invitations/respond/` with a JSON body containing the `invite_token` and `user_response`.\n\n**Request Body:**\n- `invite_token` *(string, required)*: Unique token identifying the invitation to respond to.\n- `user_response` *(string, required)*: The user's response to the invitation. Must be either 'accept' or 'decline'.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a confirmation message.\n\n**Notes:**\n- The `invite_token` must correspond to an existing invitation.\n- Only authenticated users can access this endpoint.","responses":{"200":{"description":"Invitation successfully responded to.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Confirmation message.","type":"string"}}}}}},"400":{"description":"Bad Request - Missing or invalid parameters.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"403":{"description":"Forbidden - User lacks permissions to respond to this invitation.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"404":{"description":"Not Found - Invitation not found or already responded to.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"],"requestBody":{"content":{"application/json":{"schema":{"required":["user_response","invite_token"],"type":"object","properties":{"invite_token":{"description":"Unique token identifying the invitation to respond to.","type":"string"},"user_response":{"description":"The user's response to the invitation. Must be either 'accept' or 'decline'.","type":"string","enum":["accept","decline"]}}}}},"required":true}}}}}
```

## Retrieve a Paginated List of Sub-Admins

> \### Retrieve a List of Sub-Admins\
> \
> This endpoint allows administrators to retrieve a list of sub-admins associated with their account. The response includes key user details such as unique ID, email, display name, assigned role, and account status.\
> \
> \*\*Usage Example:\*\*\
> Send a \`GET\` request to \`admin-management/sub-admins/\` to retrieve all sub-admins under the current super admin.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a JSON object containing the following fields:\
> \
> 1\. \*\*query\_count\*\*: Total number of sub-admins available.\
> 2\. \*\*users\*\*: An array of sub-admin objects.\
> \
> \*\*Detailed Description of Response Fields:\*\*\
> \- \*\*query\_count\*\* \*(integer)\*: Represents the total number of sub-admins associated with the requesting super admin.\
> \- \*\*users\*\* \*(array of objects)\*: Each object within the array represents a sub-admin with the following properties:\
> &#x20; \- \`uid\` \*(string)\*: Unique identifier of the sub-admin.\
> &#x20; \- \`email\` \*(string)\*: Email address of the sub-admin.\
> &#x20; \- \`display\_name\` \*(string)\*: Display name of the sub-admin.\
> &#x20; \- \`role\` \*(string)\*: Role of the sub-admin. Possible values: 'Admin' or 'Owner'.\
> &#x20; \- \`status\` \*(string)\*: Status of the sub-admin account. Possible values: 'Active', 'Invited'.\
> \
> \*\*Notes:\*\*\
> \- Proper authorization is required; only users with admin privileges can access this endpoint.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/admin-management/sub-admins/":{"get":{"operationId":"admin-management_sub-admins_list","summary":"Retrieve a Paginated List of Sub-Admins","description":"### Retrieve a List of Sub-Admins\n\nThis endpoint allows administrators to retrieve a list of sub-admins associated with their account. The response includes key user details such as unique ID, email, display name, assigned role, and account status.\n\n**Usage Example:**\nSend a `GET` request to `admin-management/sub-admins/` to retrieve all sub-admins under the current super admin.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a JSON object containing the following fields:\n\n1. **query_count**: Total number of sub-admins available.\n2. **users**: An array of sub-admin objects.\n\n**Detailed Description of Response Fields:**\n- **query_count** *(integer)*: Represents the total number of sub-admins associated with the requesting super admin.\n- **users** *(array of objects)*: Each object within the array represents a sub-admin with the following properties:\n  - `uid` *(string)*: Unique identifier of the sub-admin.\n  - `email` *(string)*: Email address of the sub-admin.\n  - `display_name` *(string)*: Display name of the sub-admin.\n  - `role` *(string)*: Role of the sub-admin. Possible values: 'Admin' or 'Owner'.\n  - `status` *(string)*: Status of the sub-admin account. Possible values: 'Active', 'Invited'.\n\n**Notes:**\n- Proper authorization is required; only users with admin privileges can access this endpoint.","responses":{"200":{"description":"Successfully retrieved a paginated list of sub-admins.","content":{"application/json":{"schema":{"required":["query_count","users"],"type":"object","properties":{"query_count":{"description":"Total number of sub-admins available.","type":"integer"},"users":{"description":"List of sub-admins retrieved.","type":"array","items":{"required":["uid","email","display_name","role","status"],"type":"object","properties":{"uid":{"description":"Unique identifier of the sub-admin.","type":"string"},"email":{"description":"Email address of the sub-admin.","type":"string","format":"email"},"display_name":{"description":"Display name of the sub-admin.","type":"string"},"role":{"description":"Role of the sub-admin. Possible values: 'Admin' or 'Owner'.","type":"string"},"status":{"description":"Status of the sub-admin account. Possible values: 'active', 'invited'.","type":"string"}}}}}}}}},"400":{"description":"Bad Request - Invalid query parameters provided.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"403":{"description":"Forbidden - User lacks super admin privileges.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"404":{"description":"Not Found - No sub-admins found or retrieval failed.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"]}}}}
```

## Add a Sub-Admin

> \### Add a Sub-Admin\
> \
> This endpoint allows a super administrator to add a new sub-admin to their account. Provide the \`user\_uid\` of the user you wish to promote to sub-admin status.\
> \
> \*\*Usage Example:\*\*\
> Send a \`POST\` request to \`admin-management/sub-admins/\` with a JSON body containing the \`user\_uid\`.\
> \
> \*\*Request Body:\*\*\
> \- \`user\_uid\` \*(string, required)\*: The UID of the user to be added as a sub-admin.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a confirmation message.\
> \
> \*\*Notes:\*\*\
> \- The \`user\_uid\` must correspond to an existing user.\
> \- Only users with super admin privileges can access this endpoint.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"}}},"paths":{"/admin-management/sub-admins/":{"post":{"operationId":"admin-management_sub-admins_create","summary":"Add a Sub-Admin","description":"### Add a Sub-Admin\n\nThis endpoint allows a super administrator to add a new sub-admin to their account. Provide the `user_uid` of the user you wish to promote to sub-admin status.\n\n**Usage Example:**\nSend a `POST` request to `admin-management/sub-admins/` with a JSON body containing the `user_uid`.\n\n**Request Body:**\n- `user_uid` *(string, required)*: The UID of the user to be added as a sub-admin.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a confirmation message.\n\n**Notes:**\n- The `user_uid` must correspond to an existing user.\n- Only users with super admin privileges can access this endpoint.","responses":{"201":{"description":"Sub-admin successfully added.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Confirmation message.","type":"string"}}}}}},"400":{"description":"Bad Request - Missing or invalid parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message detailing what went wrong.","type":"string"}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating missing token.","type":"string"}}}}}},"403":{"description":"Forbidden - User lacks super admin privileges.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating insufficient privileges.","type":"string"}}}}}},"404":{"description":"Not Found - User not found or already a sub-admin.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating the user was not found or already a sub-admin.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"],"requestBody":{"content":{"application/json":{"schema":{"required":["user_uid"],"type":"object","properties":{"user_uid":{"description":"UID of the user to be set as sub-admin.","type":"string"}}}}},"required":true}}}}}
```

## Remove a Sub-Admin

> \### Remove a Sub-Admin\
> \
> This endpoint allows a super administrator to remove an existing sub-admin from their account. Provide the \`user\_uid\` of the sub-admin you wish to remove.\
> \
> \*\*Usage Example:\*\*\
> Send a \`DELETE\` request to \`admin-management/sub-admins/\` with a JSON body containing the \`user\_uid\`.\
> \
> \*\*Request Body:\*\*\
> \- \`user\_uid\` \*(string, required)\*: The UID of the sub-admin to be removed.\
> \
> \*\*Response Structure:\*\*\
> Upon a successful request, the endpoint returns a confirmation message.\
> \
> \*\*Notes:\*\*\
> \- The \`user\_uid\` must correspond to an existing sub-admin.\
> \- Only users with super admin privileges can access this endpoint.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"}}},"paths":{"/admin-management/sub-admins/":{"delete":{"operationId":"admin-management_sub-admins_delete","summary":"Remove a Sub-Admin","description":"### Remove a Sub-Admin\n\nThis endpoint allows a super administrator to remove an existing sub-admin from their account. Provide the `user_uid` of the sub-admin you wish to remove.\n\n**Usage Example:**\nSend a `DELETE` request to `admin-management/sub-admins/` with a JSON body containing the `user_uid`.\n\n**Request Body:**\n- `user_uid` *(string, required)*: The UID of the sub-admin to be removed.\n\n**Response Structure:**\nUpon a successful request, the endpoint returns a confirmation message.\n\n**Notes:**\n- The `user_uid` must correspond to an existing sub-admin.\n- Only users with super admin privileges can access this endpoint.","responses":{"200":{"description":"Sub-admin successfully removed.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Confirmation message.","type":"string"}}}}}},"400":{"description":"Bad Request - Missing or invalid parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message detailing what went wrong.","type":"string"}}}}}},"401":{"description":"Unauthorized - Access token is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating missing token.","type":"string"}}}}}},"403":{"description":"Forbidden - User lacks super admin privileges.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating insufficient privileges.","type":"string"}}}}}},"404":{"description":"Not Found - Sub-admin not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating the sub-admin was not found.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"required":["error"],"type":"object","properties":{"error":{"description":"Error message.","type":"string"}}}}}}},"tags":["admin-management"],"requestBody":{"content":{"application/json":{"schema":{"required":["user_uid"],"type":"object","properties":{"user_uid":{"description":"UID of the sub-admin to be removed.","type":"string"}}}}},"required":true}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aikynetix.app/api-documentation/developer-resources-and-api-reference/api-reference/v.2/admin-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
