---
title: Updates a device
slug: docs/demo/updates-a-device
description: Learn how to use the cURL command to make a PUT request to a specific API endpoint with this code example. Discover how to include headers for accepting and specifying JSON as the content type. The request payload contains essential fields like device ref
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "fZr0QyTcI5AyDtbAiCLVc",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference}/devices/{deviceReference}",
    "name": "Updates a device",
    "method": "PUT",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "devicePolicyReference",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "deviceReference",
          "type": "string",
          "description": ""
        }
      ],
      "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": "deviceDTO",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "deviceReference",
              "type": "string",
              "example": "",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "deviceName",
              "type": "string",
              "example": "",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "deviceType",
              "type": "string<none | mobile | tablet | console | tv | desktop>",
              "example": "",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "status",
              "type": "string<Active | AwaitingDeletion>",
              "example": "",
              "description": "The device status"
            },
            {
              "kind": "optional",
              "name": "identifier",
              "type": "string",
              "example": "",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "registeredDate",
              "type": "string<date-time>",
              "example": "2021-09-21T05:33:16.8228669",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "lastUpdateDate",
              "type": "string<date-time>",
              "example": "",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "registeredSlot",
              "type": "object",
              "schema": [
                {
                  "kind": "optional",
                  "name": "slotReference",
                  "type": "string",
                  "example": "",
                  "description": ""
                },
                {
                  "kind": "optional",
                  "name": "lastUpdatedDate",
                  "type": "string<date-time>",
                  "example": "",
                  "description": ""
                }
              ],
              "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Devices.DeviceSlotDTO",
              "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Devices.DeviceSlotDTO"
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Devices.DeviceDTO",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Devices.DeviceDTO",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "• The device name parameter is mandatory.. \r\n            <br />• The device type parameter must contain desktop, mobile, tablet, console or tv value.\r\n            <br />• The device identifier parameter is mandatory.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "API Authentication Failure: Invalid Authentication Type/Credentials Provided.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "403",
        "description": "• Missing privilege.       \r\n            <br />• Disabled Device Management Feature.\r\n            <br />• Invalid account.\r\n            <br />• Invalid device policy\r\n            <br />• Device cannot be found.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "Calling this endpoint will update a device against an account",
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference}/devices/{deviceReference} \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "example-1-javascript",
          "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: 'PUT',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference}/devices/{deviceReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference}/devices/{deviceReference}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.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": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference}/devices/{deviceReference}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// • The device name parameter is mandatory.. \r\n            • The device type parameter must contain desktop, mobile, tablet, console or tv value.\r\n            • The device identifier parameter is mandatory.\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// API Authentication Failure: Invalid Authentication Type/Credentials Provided.\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// • Missing privilege.       \r\n            • Disabled Device Management Feature.\r\n            • Invalid account.\r\n            • Invalid device policy\r\n            • Device cannot be found.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}