Toggle API-Key

/owners/api-key/toggle

Updates the status of an API key.

Status changes take place immediately. Disabling a key will also invalidate any tokenized playback URLs generated by that key.

Request parameters are described below.

Request ParameterTypeDescription
key_to_togglestringIdentifies the API key whose status will be toggled.
is_enabledBooleanDefines the status of the API key. Valid values are: True: Sets the API key's status to enabled. False: Sets the API key's status to disabled. Passing an invalid value for this parameter will disable the specified API key.

Response parameters are described below.

Request ParameterTypeDescription
key_toggledstringIndicates the API key whose status was changed.
is_enabledBooleanIndicates the status applied to the API key. Valid values are: True: Indicates that the API key was enabled. False: Indicates that the API key was disabled.
errorintIndicates either an error code or 0 to indicate the API key's status was updated.

Sample request/response:

The Call() function, which is imported from API Auth (see below), prepares the message body and digital signature.


from uplynk_api2_auth import Call

print(Call('/api2/owners/api-key/toggle', key_to_toggle='a735c56ea4014685bc74c0a375236cc5', is_enabled=False))

{
    "key_toggled" : "a735c56ea4014685bc74c0a375236cc5",
    "is_enabled" : False,
    "error" : 0
}