---
title: Create Account Group
slug: docs/demo/create-account-group
description: Learn how to create a group in a REST API by making a POST request with CURL. This code example provides the necessary headers and request parameters to effortlessly execute the desired action. Master the art of crafting successful POST requests with ease
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "LCbx5NREAfX1MVaW6_xfw",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/groups",
    "name": "Create Account Group",
    "method": "POST",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "The account reference."
        }
      ],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "createAccountGroupParamaters",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "groupName",
              "type": "string",
              "example": "",
              "description": "The group name."
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.CreateAccountGroupParameters",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.CreateAccountGroupParameters",
          "isExpanded": true,
          "description": "Create account group parameters"
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "groupToken",
                "type": "string",
                "example": "",
                "description": "The account group token."
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.CreateAccountGroup",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.CreateAccountGroup",
            "isExpanded": true,
            "description": "Create account group details."
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Not Found.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will enable you to create an account group.",
    "examples": {
      "languages": [
        {
          "id": "vdDJjjVGz6ESkxBMKhjCt",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location --globoff 'https://api.fictive.com/REST/api/accounts/{accountReference}/groups' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"groupName\": \"\"\n}'"
        },
        {
          "id": "SItpgtEgJ_MT54dlQFcZT",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"groupName\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/groups\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "cb7OXQ96vm64q7rvSPvi6",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/groups\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"groupName\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "qX-ovaofiDkAVs5IJwypd",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/groups\"\n\npayload = json.dumps({\n   \"groupName\": \"\"\n})\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "vdDJjjVGz6ESkxBMKhjCt"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"groupToken\": \"\"\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Not Found.\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}