---
title: Create an account via third-party
slug: docs/demo/create-an-account-via-third-party
description: Learn how to use the cURL command to perform a POST request on an API endpoint with this helpful document. Discover a code example illustrating the incorporation of specific headers and content type for a seamlessly efficient workflow.
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "qCzKnPijBTvH4V0btVXOW",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/external-providers",
    "name": "Create an account via third-party",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "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": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "account",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "accountId",
                    "type": "integer<int32>",
                    "example": 0,
                    "description": "Id of the account"
                  },
                  {
                    "kind": "optional",
                    "name": "accountReference",
                    "type": "string",
                    "example": "",
                    "description": "Resource reference"
                  },
                  {
                    "kind": "optional",
                    "name": "status",
                    "type": "string<None | Active | Suspended | Closed | MWalletInactive>",
                    "example": "",
                    "description": "Status of account"
                  },
                  {
                    "kind": "optional",
                    "name": "email",
                    "type": "string",
                    "example": "",
                    "description": "Email of account"
                  },
                  {
                    "kind": "optional",
                    "name": "clientUserId",
                    "type": "string",
                    "example": "",
                    "description": "Client Id of the user"
                  },
                  {
                    "kind": "optional",
                    "name": "password",
                    "type": "string",
                    "example": "",
                    "description": "Account password"
                  },
                  {
                    "kind": "optional",
                    "name": "currentPassword",
                    "type": "string",
                    "example": "",
                    "description": "Current account password"
                  },
                  {
                    "kind": "optional",
                    "name": "newPassword",
                    "type": "string",
                    "example": "",
                    "description": "New account password"
                  },
                  {
                    "kind": "optional",
                    "name": "salutation",
                    "type": "string",
                    "example": "",
                    "description": "Salutation for account"
                  },
                  {
                    "kind": "optional",
                    "name": "firstName",
                    "type": "string",
                    "example": "",
                    "description": "Account first name"
                  },
                  {
                    "kind": "optional",
                    "name": "lastName",
                    "type": "string",
                    "example": "",
                    "description": "Account last name"
                  },
                  {
                    "kind": "optional",
                    "name": "phoneNumber",
                    "type": "string",
                    "example": "",
                    "description": "Account phone number"
                  },
                  {
                    "kind": "optional",
                    "name": "mobileNumber",
                    "type": "string",
                    "example": "",
                    "description": "Account mobile number"
                  },
                  {
                    "kind": "optional",
                    "name": "dateOfBirth",
                    "type": "string<date-time>",
                    "example": "2021-09-21T05:33:12.7915409",
                    "description": "Date of birth of the Account"
                  },
                  {
                    "kind": "optional",
                    "name": "gender",
                    "type": "string<NotKnown | Female | Male>",
                    "example": "",
                    "description": "Gender"
                  },
                  {
                    "kind": "optional",
                    "name": "customParameters",
                    "type": "object",
                    "schema": [],
                    "example": {},
                    "description": "Custom parameters"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.Account",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.Account",
                "description": "Details for account"
              },
              {
                "kind": "optional",
                "name": "sessionToken",
                "type": "string",
                "example": "",
                "description": "The session token"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.AccountWithSessionToken",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v3.AccountWithSessionToken",
            "isExpanded": true,
            "description": "Account wrapper"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"account\": {\n    \"accountId\": 15,\n    \"accountReference\": \"resRef\",\n    \"status\": \"Active\",\n    \"email\": \"Email\",\n    \"clientUserId\": \"ClientUserId\",\n    \"salutation\": \"Salutation\",\n    \"firstName\": \"FirstName\",\n    \"lastName\": \"LastName\",\n    \"phoneNumber\": \"PhoneNumber\",\n    \"mobileNumber\": \"MobileNumber\",\n    \"dateOfBirth\": \"2021-09-21T05:33:12.9165447\",\n    \"gender\": \"NotKnown\",\n    \"customParameters\": {\n      \"ParameterName\": \"ParameterValue\"\n    }\n  },\n  \"sessionToken\": \"8a567eb2071749b7ba240bee957c1a50\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "This session is associated with an existing eSuite account. The authentication status for the session must be NoAccountMatch in order to create a new account.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to create an account within the eSuite platform using the data gained from an external provider e.g. Facebook",
    "examples": {
      "languages": [
        {
          "id": "7mVRlT2iUStKT4pc5P4HE",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/accounts/external-providers \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "jUKeENipshSKWMWnGPcko",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/external-providers\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "FeEVvUdRyg73FRD3t7CXv",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/external-providers\")\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[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ycAtqAJGgXt9h5eRAp-bW",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/external-providers\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "7mVRlT2iUStKT4pc5P4HE"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"account\": {\n    \"accountId\": 15,\n    \"accountReference\": \"resRef\",\n    \"status\": \"Active\",\n    \"email\": \"Email\",\n    \"clientUserId\": \"ClientUserId\",\n    \"salutation\": \"Salutation\",\n    \"firstName\": \"FirstName\",\n    \"lastName\": \"LastName\",\n    \"phoneNumber\": \"PhoneNumber\",\n    \"mobileNumber\": \"MobileNumber\",\n    \"dateOfBirth\": \"2021-09-21T05:33:12.9165447\",\n    \"gender\": \"NotKnown\",\n    \"customParameters\": {\n      \"ParameterName\": \"ParameterValue\"\n    }\n  },\n  \"sessionToken\": \"8a567eb2071749b7ba240bee957c1a50\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// This session is associated with an existing eSuite account. The authentication status for the session must be NoAccountMatch in order to create a new account.\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}