---
title: Add Members
slug: docs/demo/add-members
description: Learn how to make a POST request to a specific API endpoint using a CURL command. This document includes a code example with the required headers and payload in JSON format, including email and clientUserId fields. Streamline your API integration process 
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "3zGGT45_KLbFf67B5M6J_",
  "data": {
    "url": "https://api.fictive.com/REST/api/groups/{accountGroupToken}/members",
    "name": "Add Members",
    "method": "POST",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountGroupToken",
          "type": "string",
          "description": "The account group token used to identify the account group"
        }
      ],
      "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": "addAccountToAccountGroup",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "email",
              "type": "string",
              "example": "",
              "description": "Email address"
            },
            {
              "kind": "optional",
              "name": "clientUserId",
              "type": "string",
              "example": "",
              "description": "Client user id"
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AddAccountToAccountGroup",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AddAccountToAccountGroup",
          "isExpanded": true,
          "description": "Add account to account group details"
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "isExpanded": true,
        "statusCode": "204",
        "description": "No Content",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "• Incorrect Parameters Passed: The account is already a member of the group.\r\n            <br />• Conflicting account identification parameters found\r\n            <br />• ClientUserId cannot be set using the provided authentication mechanism.\r\n            <br />• Incorrect Parameters Passed: Account group token must be a valid GUID format.\r\n            <br />• Incorrect Parameters Passed: The AccountGroupToken is not valid for the account affiliate",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Incorrect Parameters Passed: The account is already a member of the group.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will enable you to add an account to an existing account group.",
    "examples": {
      "languages": [
        {
          "id": "YexblgFqCFfAmEEsSFpF-",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location --globoff 'https://api.fictive.com/REST/api/groups/{accountGroupToken}/members' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"email\": \"\",\n  \"clientUserId\": \"\"\n}'"
        },
        {
          "id": "VjuROj0TCFmYaAn3TGplQ",
          "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   \"email\": \"\",\n   \"clientUserId\": \"\"\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/groups/{accountGroupToken}/members\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "ksBVW-19EB_NqNaLVu3Nh",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/groups/{accountGroupToken}/members\")\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   \"email\": \"\",\n   \"clientUserId\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "hcHO0e25jFBwXqJDKKkls",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/groups/{accountGroupToken}/members\"\n\npayload = json.dumps({\n   \"email\": \"\",\n   \"clientUserId\": \"\"\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": "YexblgFqCFfAmEEsSFpF-"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// No Content\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// • Incorrect Parameters Passed: The account is already a member of the group.\r\n            • Conflicting account identification parameters found\r\n            • ClientUserId cannot be set using the provided authentication mechanism.\r\n            • Incorrect Parameters Passed: Account group token must be a valid GUID format.\r\n            • Incorrect Parameters Passed: The AccountGroupToken is not valid for the account affiliate\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Incorrect Parameters Passed: The account is already a member of the group.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}