Skip to main content

Reset User Subscription with New Group API

POST /resetUserSubscriptionWithNewGroup

Description

This API endpoint allows you to reset a user's subscription and assign them to a new group. It is used to update the subscription details while changing the user's group assignment.

Request Body

The request utilizes GraphQL to perform the resetUserSubscriptionWithNewGroup mutation.

Mutation:

mutation resetUserSubscriptionWithNewGroup ($username: String!, $groupId: Int!) {
resetUserSubscriptionWithNewGroup (username: $username, groupId: $groupId) {
duration
multiLoginCount
expiresAt
createdAt
updatedAt
dailyBandwidth
downloadUpload
}
}

Variables:

{
"username": "<User_Username>",
"groupId": <New_Group_Id>
}
  • username (String): The username of the user whose subscription is to be reset.
  • groupId (Int): The ID of the new group to which the user will be assigned.

Response:

  • Success (200 OK):

    • If the reset and group assignment are successful, the response will include the updated subscription details.
    {
    "data": {
    "resetUserSubscriptionWithNewGroup": {
    "duration": "<New_Duration>",
    "multiLoginCount": "<Updated_Login_Count>",
    "expiresAt": "<New_Expiry_Date>",
    "createdAt": "<Creation_Date>",
    "updatedAt": "<Update_Date>",
    "dailyBandwidth": "<Updated_Bandwidth>",
    "downloadUpload": "<Updated_Download_Upload_Details>"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with the reset process or group assignment, the response will include an appropriate error message and status code.

Note:

Ensure that the provided username and group ID are valid. This API will reset the subscription details and reassign the user to the specified new group, updating their subscription duration and other related attributes accordingly.