---
title: Update an account device policy
slug: docs/demo/update-an-account-device-policy
description: Learn how to use cURL command to send a PUT request to an API endpoint and update a device policy associated with an account. This code example includes parameters for permissions, device limits, and parent policy reference. Improve your API integration w
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "31fj7oAFRF7BTX5WLPoNH",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference}",
    "name": "Update an account device policy",
    "method": "PUT",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "devicePolicyReference",
          "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": "devicePolicyReference",
              "type": "string",
              "example": "",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "allowedDevices",
              "type": "integer<int32>",
              "example": 0,
              "description": ""
            },
            {
              "kind": "optional",
              "name": "deviceChangesAllowed",
              "type": "integer<int32>",
              "example": 0,
              "description": ""
            },
            {
              "kind": "optional",
              "name": "deviceChangesUnit",
              "type": "string<none | hours | days | months | years>",
              "example": "",
              "description": ""
            },
            {
              "kind": "optional",
              "name": "deviceChangesPeriod",
              "type": "integer<int32>",
              "example": 0,
              "description": ""
            },
            {
              "kind": "optional",
              "name": "allowedPlayoutSlots",
              "type": "integer<int32>",
              "example": 0,
              "description": ""
            },
            {
              "kind": "optional",
              "name": "parentPolicyReference",
              "type": "string",
              "example": "",
              "description": ""
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Devices.AccountDevicePolicyDTO",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Devices.AccountDevicePolicyDTO",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "string",
            "isExpanded": true,
            "description": "OK"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "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.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "The device management policy cannot be found.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "Calling this endpoint will update the device policy",
    "examples": {
      "languages": [
        {
          "id": "OJu_vb5Kpr_e7p3yR-Vi6",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference} \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "HSza_Nu7FHqRb7oOTGbqo",
          "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}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "uVFZ23bMtjaAhW6g8OBwL",
          "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}\")\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": "quJZhKFBSOV-phs2PBHVe",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/device-policies/{devicePolicyReference}\"\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": "OJu_vb5Kpr_e7p3yR-Vi6"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n\"\""
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// API Authentication Failure: Invalid Authentication Type/Credentials Provided.\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// • Missing privilege.\r\n            • Disabled Device Management Feature.\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// The device management policy cannot be found.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}