Skip to content
Start here

Get override codes (deprecated)

Deprecated
zero_trust.devices.override_codes.list(strdevice_id, OverrideCodeListParams**kwargs) -> OverrideCodeListResponse
GET/accounts/{account_id}/devices/{device_id}/override_codes

Fetches a one-time use admin override code for a device. This relies on the Admin Override setting being enabled in your device configuration. Not supported when multi-user mode is enabled for the account. Deprecated: please use GET /accounts/{account_id}/devices/registrations/{registration_id}/override_codes instead.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zero Trust ReadZero Trust Write
ParametersExpand Collapse
account_id: str
device_id: str

Registration ID. Equal to Device ID except for accounts which enabled multi-user mode.

maxLength36
ReturnsExpand Collapse
class OverrideCodeListResponse: …
disable_for_time: Optional[DisableForTime]
_1: Optional[str]

Override code that is valid for 1 hour.

_12: Optional[str]

Override code that is valid for 12 hour2.

_24: Optional[str]

Override code that is valid for 24 hour.2.

_3: Optional[str]

Override code that is valid for 3 hours.

_6: Optional[str]

Override code that is valid for 6 hours.

Get override codes (deprecated)

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
override_codes = client.zero_trust.devices.override_codes.list(
    device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    account_id="699d98642c564d2e855e9661899b7252",
)
print(override_codes.disable_for_time)
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "disable_for_time": {
      "1": "9106681",
      "3": "5356247",
      "6": "9478972",
      "12": "3424359",
      "24": "2887634"
    }
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "disable_for_time": {
      "1": "9106681",
      "3": "5356247",
      "6": "9478972",
      "12": "3424359",
      "24": "2887634"
    }
  },
  "success": true
}