Skip to main content

Create Group API

POST /createGroup

Description

This API endpoint allows users to create a new group within a service group. The group can have specific attributes such as name, description, tag, duration, price, and various user access settings.

Request Body

The request utilizes GraphQL to perform the createGroup mutation.

Mutation:

mutation createGroup ($group: GroupEdit) {
createGroup (group: $group) {
id
name
description
tagName
duration
price
usernamePostfix
usernamePostfixId
dailyBandwidth
multiLoginCount
downloadUpload
ip
}
}

Variables:

{
"group": {
"serviceGroupId": 0,
"name": "<Group_Name>",
"description": "<Group_Description>",
"tagName": "<Tag_Name>",
"duration": 0,
"price": "<Price>",
"usernamePostfix": "<Username_Postfix>",
"usernamePostfixId": "<Username_Postfix_ID>",
"dailyBandwidth": "<Daily_Bandwidth>",
"multiLoginCount": 0,
"downloadUpload": "<Download_Upload_Limits>",
"ip": "<IP_Address>"
}
}
  • group (GroupEdit Object): An object containing the group's details.
    • serviceGroupId (Int): The ID of the service group this group belongs to.
    • name (String): The name of the group.
    • description (String): A description of the group.
    • tagName (String): A tag name associated with the group.
    • duration (Int): The duration (e.g., in days or months) that the group is valid for.
    • price (String): The price associated with the group.
    • usernamePostfix (String): A postfix to be added to usernames within the group.
    • usernamePostfixId (String): An ID associated with the username postfix.
    • dailyBandwidth (String): The daily bandwidth limit for users in the group.
    • multiLoginCount (Int): The number of simultaneous logins allowed for users in the group.
    • downloadUpload (String): The download and upload limits for the group.
    • ip (String): The IP address associated with the group.

Response:

  • Success (200 OK):

    {
    "data": {
    "createGroup": {
    "id": "<Group_ID>",
    "name": "<Group_Name>",
    "description": "<Group_Description>",
    "tagName": "<Tag_Name>",
    "duration": <Duration>,
    "price": "<Price>",
    "usernamePostfix": "<Username_Postfix>",
    "usernamePostfixId": "<Username_Postfix_ID>",
    "dailyBandwidth": "<Daily_Bandwidth>",
    "multiLoginCount": <Multi_Login_Count>,
    "downloadUpload": "<Download_Upload_Limits>",
    "ip": "<IP_Address>"
    }
    }
    }
    • id (Int): The unique identifier of the created group.
    • name (String): The name of the group.
    • description (String): The description of the group.
    • tagName (String): The tag name associated with the group.
    • duration (Int): The duration the group is valid for.
    • price (String): The price associated with the group.
    • usernamePostfix (String): The postfix added to usernames within the group.
    • usernamePostfixId (String): The ID associated with the username postfix.
    • dailyBandwidth (String): The daily bandwidth limit for the group.
    • multiLoginCount (Int): The number of simultaneous logins allowed for users in the group.
    • downloadUpload (String): The download and upload limits for the group.
    • ip (String): The IP address associated with the group.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that the serviceGroupId corresponds to an existing service group. All required fields should be provided and correctly formatted according to the platform's specifications.