---
title: Update an account.
slug: docs/demo/update-an-account
description: Learn how to use the curl command to send a PATCH request to the fictive.com API with this handy code example. Set headers for accepting and setting content type as JSON, and include data like value, path, operation, and reference in your request. Elevate
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "S_SuA9VisnF092A5pXSv9",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}",
    "name": "Update an account.",
    "method": "PATCH",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "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": "patchRequest",
          "type": "array",
          "schema": [
            {
              "kind": "optional",
              "name": "value",
              "type": "object",
              "schema": [],
              "modelRef": "#/definitions/System.Object",
              "customType": "System.Object"
            },
            {
              "kind": "optional",
              "name": "path",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "op",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "from",
              "type": "string",
              "example": ""
            }
          ],
          "modelRef": "#/definitions/Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Patch.Accounts.AccountsPatchModel]",
          "customType": "Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Patch.Accounts.AccountsPatchModel]",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "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": "Account reference"
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string<None | Active | Suspended | Closed | MWalletInactive>",
                "example": "",
                "description": "Status of account"
              },
              {
                "kind": "optional",
                "name": "verified",
                "type": "boolean",
                "example": "",
                "description": "Flag that marks if the account has been verified"
              },
              {
                "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": "salutation",
                "type": "string",
                "example": ""
              },
              {
                "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:13.0102964",
                "description": "Date of birth of the Account"
              },
              {
                "kind": "optional",
                "name": "gender",
                "type": "string<NotKnown | Female | Male>",
                "example": "",
                "description": "Gender"
              },
              {
                "kind": "optional",
                "name": "addresses",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "addressType",
                    "type": "string<Home | Billing | Invoice>",
                    "example": "",
                    "description": "Address type"
                  },
                  {
                    "kind": "optional",
                    "name": "houseName",
                    "type": "string",
                    "example": "",
                    "description": "House name"
                  },
                  {
                    "kind": "optional",
                    "name": "houseNumber",
                    "type": "string",
                    "example": "",
                    "description": "House number"
                  },
                  {
                    "kind": "optional",
                    "name": "street",
                    "type": "string",
                    "example": "",
                    "description": "Street name"
                  },
                  {
                    "kind": "optional",
                    "name": "townCity",
                    "type": "string",
                    "example": "",
                    "description": "Name of town city"
                  },
                  {
                    "kind": "optional",
                    "name": "district",
                    "type": "string",
                    "example": "",
                    "description": "Name of district"
                  },
                  {
                    "kind": "optional",
                    "name": "state",
                    "type": "string",
                    "example": "",
                    "description": "State"
                  },
                  {
                    "kind": "optional",
                    "name": "county",
                    "type": "string",
                    "example": "",
                    "description": "County"
                  },
                  {
                    "kind": "optional",
                    "name": "postCode",
                    "type": "string",
                    "example": "",
                    "description": "Post code"
                  },
                  {
                    "kind": "optional",
                    "name": "country",
                    "type": "string",
                    "example": "",
                    "description": "Country"
                  },
                  {
                    "kind": "optional",
                    "name": "isDefault",
                    "type": "boolean",
                    "example": "",
                    "description": "Is default"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Address",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Address[]",
                "description": "Addresses of Account"
              },
              {
                "kind": "optional",
                "name": "customParameters",
                "type": "object",
                "schema": [],
                "example": {},
                "description": "Custom parameters"
              },
              {
                "kind": "optional",
                "name": "sessionToken",
                "type": "string",
                "example": "",
                "description": "The session token"
              },
              {
                "kind": "optional",
                "name": "marketingAllowed",
                "type": "boolean",
                "example": "",
                "description": "Marketing Allowed"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.AccountResult",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v2.AccountResult",
            "isExpanded": true,
            "description": "Account"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "Ok",
        "jsonExample": "{\n  \"accountId\": 15,\n  \"accountReference\": \"accRef\",\n  \"status\": \"Active\",\n  \"verified\": true,\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:13.1196695\",\n  \"gender\": \"NotKnown\",\n  \"addresses\": [\n    {\n      \"addressType\": \"Home\",\n      \"houseName\": \"HouseName\",\n      \"houseNumber\": \"HouseNumber\",\n      \"street\": \"Street\",\n      \"townCity\": \"TownCity\",\n      \"district\": \"District\",\n      \"state\": \"State\",\n      \"county\": \"County\",\n      \"postCode\": \"PostCode\",\n      \"country\": \"Country\"\n    }\n  ],\n  \"customParameters\": {\n    \"ParameterName\": \"ParameterValue\"\n  },\n  \"sessionToken\": \"a44c2dc229d34986aaec7305b0280a9e\",\n  \"marketingAllowed\": true\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "• Email address format invalid\r\n            <br />• Invalid status provided.\r\n            <br />• ClientUserId provided exceeds maximum length.\r\n            <br />• FirstName provided exceeds maximum length.\r\n            <br />• Surname provided exceeds maximum length.\r\n            <br />• Phone number provided exceeds maximum length.\r\n            <br />• Phone number does not support non-numeric characters.\r\n            <br />• Mobile number provided exceeds maximum length.\r\n            <br />• Mobile number does not support non-numeric characters.\r\n            <br />• DateOfBirth must be a date in the past.\r\n            <br />• {parameterName} provided exceeds maximum length.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "403",
        "description": "• Unable to manage ClientUserId with the provided authentication.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "409",
        "description": "• The email is already in use.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "412",
        "description": "• {parameterName} not configured.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "• Internal Server Error.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to update an existing account within the platform and return the account object.",
    "examples": {
      "languages": [
        {
          "id": "fRvstWk3H5FuKbfEyav2C",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-version: string' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "dlISY6lo_BSAd4wnadkay",
          "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 raw = JSON.stringify([\n   {}\n]);\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "LZNoEFBFTZwZhrU_8maAk",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\nrequest.body = JSON.dump([\n   {}\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "POH7Mj6zITNYGJJCW0oWj",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}\"\n\npayload = json.dumps([\n   {}\n])\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "fRvstWk3H5FuKbfEyav2C"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"accountId\": 15,\n  \"accountReference\": \"accRef\",\n  \"status\": \"Active\",\n  \"verified\": true,\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:13.1196695\",\n  \"gender\": \"NotKnown\",\n  \"addresses\": [\n    {\n      \"addressType\": \"Home\",\n      \"houseName\": \"HouseName\",\n      \"houseNumber\": \"HouseNumber\",\n      \"street\": \"Street\",\n      \"townCity\": \"TownCity\",\n      \"district\": \"District\",\n      \"state\": \"State\",\n      \"county\": \"County\",\n      \"postCode\": \"PostCode\",\n      \"country\": \"Country\"\n    }\n  ],\n  \"customParameters\": {\n    \"ParameterName\": \"ParameterValue\"\n  },\n  \"sessionToken\": \"a44c2dc229d34986aaec7305b0280a9e\",\n  \"marketingAllowed\": true\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// • Email address format invalid\r\n            • Invalid status provided.\r\n            • ClientUserId provided exceeds maximum length.\r\n            • FirstName provided exceeds maximum length.\r\n            • Surname provided exceeds maximum length.\r\n            • Phone number provided exceeds maximum length.\r\n            • Phone number does not support non-numeric characters.\r\n            • Mobile number provided exceeds maximum length.\r\n            • Mobile number does not support non-numeric characters.\r\n            • DateOfBirth must be a date in the past.\r\n            • {parameterName} provided exceeds maximum length.\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// • Unable to manage ClientUserId with the provided authentication.\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// • The email is already in use.\n"
        },
        {
          "id": "response-4-412",
          "language": "412",
          "code": "// • {parameterName} not configured.\n"
        },
        {
          "id": "response-5-500",
          "language": "500",
          "code": "// • Internal Server Error.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}