> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# Update a resource rule

`PUT /api/web/v2/resourcerules/{id}`

Update the specified resource rule. Caller requires the CONTEXTRULES:EDIT permission.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| id | path | Yes | string | The UUID of the resource rule to be modified. |

## Request Body

Required.

### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "acrFilter": {
      "type": "string",
      "description": "Identifies how the resource rule acr access filter operates. NA: The resource rule will apply to all requests. This is the default value. NONE: The resource rule will only apply if no acrs were requested. ANY: The resource rule will only apply if acrs were requested. SPECIFIC: The resource rule will only apply if acrs were requested and one of the requested acrs matches one from a specified list.",
      "enum": [
        "NA",
        "NONE",
        "ANY",
        "SPECIFIC"
      ]
    },
    "acrIds": {
      "type": "array",
      "description": "The UUIDs of acrs associated with this resource rule if acrFilter is set to SPECIFIC. The resource rule will only apply if a requested acr is one of the specified acrs. If acrFilter is set to SPECIFIC, at least one acrId should be specified otherwise the resource rule will never apply.",
      "items": {
        "type": "string",
        "description": "The UUIDs of acrs associated with this resource rule if acrFilter is set to SPECIFIC. The resource rule will only apply if a requested acr is one of the specified acrs. If acrFilter is set to SPECIFIC, at least one acrId should be specified otherwise the resource rule will never apply."
      }
    },
    "dateTimeContext": {
      "required": [
        "denyAccess",
        "riskPoint"
      ],
      "type": "object",
      "properties": {
        "allowedDateTime": {
          "type": "boolean",
          "description": "If true, the startDateTime and endDateTime define the allowed range. If false, the startDateTime and endDateTime define the denied range."
        },
        "allowedTime": {
          "type": "boolean",
          "description": "If true, the startTime and endTime define the allowed time range. If false, the startTime and endTime define the denied time range."
        },
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "endDateTime": {
          "type": "string",
          "description": "If specifying a date range, the end date of the range.",
          "format": "date-time",
          "example": "2019-02-19T13:15:27Z"
        },
        "endTime": {
          "type": "string",
          "description": "If specifying a time range, the end time of the range. The value should be of the form hh:mm:ss",
          "example": "17:00:00"
        },
        "riskPoint": {
          "maximum": 100,
          "minimum": 0,
          "type": "integer",
          "description": "The number of risk points that apply if this context applies.",
          "format": "int32"
        },
        "startDateTime": {
          "type": "string",
          "description": "If specifying a date range, the start date of the range.",
          "format": "date-time",
          "example": "2019-02-19T13:15:27Z"
        },
        "startTime": {
          "type": "string",
          "description": "If specifying a time range, the start time of the range. The value should be of the form hh:mm:ss",
          "example": "08:00:00"
        },
        "weekDays": {
          "type": "array",
          "description": "If specifying a time range, the days of the week to which the time range will apply.",
          "items": {
            "type": "string",
            "description": "If specifying a time range, the days of the week to which the time range will apply.",
            "enum": [
              "Mon",
              "Tue",
              "Wed",
              "Thu",
              "Fri",
              "Sat",
              "Sun"
            ]
          }
        },
        "zoneId": {
          "type": "string",
          "description": "The time zone or fixed offset in which dates and times are interpreted. For example, a value like -05:00 to specify a fixed offset of 5 hours behind UTC, or a time zone ID like America/New_York to account for regional time zone rules, including daylight saving time. Set this value if you want to interpret times (e.g., 8 AM to 5 PM) in the customer's local time zone rather than the timezone of the service. If not specified, the default is Z (UTC).",
          "example": "America/New_York"
        }
      },
      "description": "The DateTimeContext context specifies an allowed or disallowed date or time range. Only a date range or a time range can be specified. Risk is applied to the authentication if the current time is outside an allowed range or inside a disallowed range. A date range specifies a start and end date.  For example 2019/01/01 to 2019/03/01. A time range species a start and end time and days of the week.  For example Monday to Friday, 8am to 5pm.",
      "title": "DateTimeContext"
    },
    "description": {
      "type": "string",
      "description": "The description of the resource rule."
    },
    "deviceCertificateContext": {
      "required": [
        "denyAccess",
        "riskPoint"
      ],
      "type": "object",
      "properties": {
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "riskPoint": {
          "maximum": 100,
          "minimum": 0,
          "type": "integer",
          "description": "The number of risk points that apply if this context applies.",
          "format": "int32"
        }
      },
      "description": "Device Certificate checks to see if the user presented a trusted device certificate that's valid. If not found, risk is applied.",
      "title": "DeviceCertificateContext"
    },
    "disableSSO": {
      "type": "boolean",
      "description": "A flag indicating if single-sign on is disabled for this resource rule."
    },
    "domainIdpFilter": {
      "type": "string",
      "description": "Identifies how the resource rule domain idp access filter operates. This is the default value. NA: The resource rule will apply to all requests. NONE: The resource rule will only apply if the user does not have a domain-based IDP. ANY: The resource rule will only apply if the user has a domain-based IDP. SPECIFIC: The resource rule will only apply if the user has a domain-based IDP and the user's domain matches one from a specified list.",
      "enum": [
        "NA",
        "NONE",
        "ANY",
        "SPECIFIC"
      ]
    },
    "domainIdpIds": {
      "type": "array",
      "description": "The UUIDs of domain-based identity providers associated with this resource rule if domainIdpFilter is set to SPECIFIC. The resource rule will only apply to users using one of the specified domain-based identity providers. If domainIdpFilter is set to SPECIFIC, at least one domainIdpId should be specified otherwise the resource rule will never apply.",
      "items": {
        "type": "string",
        "description": "The UUIDs of domain-based identity providers associated with this resource rule if domainIdpFilter is set to SPECIFIC. The resource rule will only apply to users using one of the specified domain-based identity providers. If domainIdpFilter is set to SPECIFIC, at least one domainIdpId should be specified otherwise the resource rule will never apply."
      }
    },
    "enabled": {
      "type": "boolean",
      "description": "A flag indicating if this resource rule is enabled or not.  Only enabled resource rules are considered during authentication."
    },
    "groupIds": {
      "type": "array",
      "description": "The UUIDs of groups associated with this resource rule. The resource rule will only apply to users in one of the specified groups. When creating a resource rule, if no groupsIds are specified, the resource rule will apply to all users.",
      "items": {
        "type": "string",
        "description": "The UUIDs of groups associated with this resource rule. The resource rule will only apply to users in one of the specified groups. When creating a resource rule, if no groupsIds are specified, the resource rule will apply to all users."
      }
    },
    "groups": {
      "type": "array",
      "description": "The groups associated with this resource rule. The resource rule only applies to users in one of the specified groups. If no groups are specified, the resource rule applies to all users.  This attribute is ignored if the groupIds attribute is specified. The groupIds attribute should be used instead.",
      "deprecated": true,
      "items": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "attribute": {
            "type": "string",
            "description": "The attribute of this group."
          },
          "created": {
            "type": "string",
            "description": "When the group was created.",
            "format": "date-time",
            "example": "2019-02-19T13:15:27Z"
          },
          "directoryDesynced": {
            "type": "boolean",
            "description": "Whether the directory group is desynced. Desynced groups can be deleted.",
            "example": false
          },
          "externalId": {
            "type": "string",
            "description": "The externalId of this group."
          },
          "id": {
            "type": "string",
            "description": "The UUID of this group.  This value is generated when the group is created."
          },
          "lastModified": {
            "type": "string",
            "description": "When the group was last modified.",
            "format": "date-time",
            "example": "2019-02-19T13:15:27Z"
          },
          "name": {
            "type": "string",
            "description": "The name of this group."
          },
          "type": {
            "type": "string",
            "description": "The type of group indicating if this group was synchronized from a directory (LDAP_AD) or was created in Identity as a Service (MGMT_UI).",
            "example": "MGMT_UI",
            "enum": [
              "LDAP_AD",
              "MGMT_UI"
            ]
          }
        },
        "description": "Information returned about a group.",
        "title": "Group"
      }
    },
    "highRiskAuthenticationFlow": {
      "type": "string",
      "description": "The UUID of the authentication flow to use when the risk score is High. Required with v2 APIs."
    },
    "highRiskEnableSmartLogin": {
      "type": "boolean",
      "description": "A flag indicating if Smart Login is enabled for High risk.This parameter is deprecated, use the highRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true
    },
    "highRiskFirstStep": {
      "type": "string",
      "description": "The authenticator type to use in the first step of a two-step authentication scenario when the risk score is High. Only the values NONE, EXTERNAL, PASSWORD or DENY should be used for highRiskFirstStep. Other values are defined for backwards compatibility. Some values are not supported by all application types.This parameter is deprecated, use the highRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true,
      "enum": [
        "NONE",
        "EXTERNAL",
        "PASSWORD",
        "KBA",
        "OTP",
        "TOKEN",
        "TOKENPUSH",
        "SMARTCREDENTIALPUSH",
        "IDP",
        "PASSKEY",
        "SMART_LOGIN",
        "USER_CERTIFICATE",
        "FACE",
        "DENY",
        "MAGICLINK"
      ]
    },
    "highRiskSecondStep": {
      "type": "array",
      "description": "The authenticator type to use during in the second step of a two-step authentication scenario when the risk score is High. Some values are not supported by all application types.This parameter is deprecated, use the highRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true,
      "items": {
        "type": "string",
        "description": "The authenticator type to use during in the second step of a two-step authentication scenario when the risk score is High. Some values are not supported by all application types.This parameter is deprecated, use the highRiskAuthenticationFlow attribute with v2 APIs.",
        "deprecated": true,
        "enum": [
          "NONE",
          "KBA",
          "TEMP_ACCESS_CODE",
          "OTP",
          "GRID",
          "TOKEN",
          "TOKENCR",
          "TOKENPUSH",
          "FIDO",
          "USER_CERTIFICATE",
          "SMARTCREDENTIALPUSH",
          "FACE",
          "PASSTHROUGH",
          "MAGICLINK"
        ]
      }
    },
    "ipContext": {
      "required": [
        "denyAccess",
        "riskPoint"
      ],
      "type": "object",
      "properties": {
        "allowedIpList": {
          "type": "string",
          "description": "The UUID of an existing IP List that defines IPs that can access the resource. Risk applies if the given IP address is not found in the IP List. If specified, the allowed IP List takes precedence over the denied IP List."
        },
        "allowedIpRanges": {
          "type": "array",
          "description": "List of IP Address ranges (in CIDR notation) that are allowed access the resource. Risk applies if the given IP address is not in one of the allowed IP ranges. If specified, the allowed IP values take precedence over the denied IP values.",
          "items": {
            "type": "string",
            "description": "List of IP Address ranges (in CIDR notation) that are allowed access the resource. Risk applies if the given IP address is not in one of the allowed IP ranges. If specified, the allowed IP values take precedence over the denied IP values."
          }
        },
        "deniedIpList": {
          "type": "string",
          "description": "The UUID of an existing IP List that defines IPs that cannot access the resource. Risk applies if the given IP address is found in the IP List. The denied IP List is ignored if an allowed IP List is specified."
        },
        "deniedIpRanges": {
          "type": "array",
          "description": "List of IP Address ranges (in CIDR notation) that cannot access the resource. Risk applies if the given IP address is in one of the denied IP ranges. The denied IP values are ignored if allowed IP ranges are specified.",
          "items": {
            "type": "string",
            "description": "List of IP Address ranges (in CIDR notation) that cannot access the resource. Risk applies if the given IP address is in one of the denied IP ranges. The denied IP values are ignored if allowed IP ranges are specified."
          }
        },
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "riskPoint": {
          "maximum": 100,
          "minimum": 0,
          "type": "integer",
          "description": "The number of risk points that apply if this context applies.",
          "format": "int32"
        },
        "type": {
          "type": "string",
          "description": "The type of IpContext. If not specified, this value defaults to CUSTOM.",
          "enum": [
            "CUSTOM",
            "IPLIST"
          ]
        }
      },
      "description": "The IP context specifies allowed or denied IP address ranges or lists. Risk is applied to the authentication if the current IP address does not match an allowed IP address range/list or does match a denied IP address range/list.",
      "title": "IpContext"
    },
    "kbaContext": {
      "required": [
        "denyAccess"
      ],
      "type": "object",
      "properties": {
        "challengeSize": {
          "type": "integer",
          "description": "Number of questions that the user must answer. If not provided, the default QA challenge size in the KBA settings is used.",
          "format": "int32"
        },
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "wrongAnswersAllowed": {
          "type": "integer",
          "description": "Number of questions that the user could answer incorrectly and still be considered a valid response. If not provided, the default wrong answers allowed in the KBA settings is used.",
          "format": "int32"
        }
      },
      "description": "The KBA context allows the settings for knowledge-based authentication to be overridden for a particular resource rule.  For example, a different challenge size can be specified.",
      "title": "KbaContext"
    },
    "locationContext": {
      "required": [
        "allowed",
        "anonymousAllowed",
        "countryCodes",
        "denyAccess",
        "riskPoint"
      ],
      "type": "object",
      "properties": {
        "allowed": {
          "type": "boolean",
          "description": "If true, the list of countries defines allowed countries. If false, the list of countries defines denied countries."
        },
        "anonymousAllowed": {
          "type": "boolean",
          "description": "If true, then allows anonymous/TOR IP addresses. If false, then denies anonymous/TOR IP addresses."
        },
        "countryCodes": {
          "type": "array",
          "description": "List of country codes (ISO alpha-2) that can access(allowed=true) or not access (allowed=false).",
          "items": {
            "type": "string",
            "description": "List of country codes (ISO alpha-2) that can access(allowed=true) or not access (allowed=false)."
          }
        },
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "riskPoint": {
          "maximum": 100,
          "minimum": 0,
          "type": "integer",
          "description": "The number of risk points that apply if this context applies.",
          "format": "int32"
        }
      },
      "description": "The location context specifies allowed or denied country codes. Risk is applied to the authentication if the location of the current IP address does not match an allowed country or matches a disallowed country.",
      "title": "LocationContext"
    },
    "locationHistoryContext": {
      "required": [
        "denyAccess",
        "riskPoint"
      ],
      "type": "object",
      "properties": {
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "riskPoint": {
          "maximum": 100,
          "minimum": 0,
          "type": "integer",
          "description": "The number of risk points that apply if this context applies.",
          "format": "int32"
        }
      },
      "description": "Location history checks to see if the location of the current IP address matches a location from a previous authentication. If the current location does not match history, risk is applied.",
      "title": "LocationHistoryContext"
    },
    "lowRiskAuthenticationFlow": {
      "type": "string",
      "description": "The UUID of the authentication flow to use when the risk score is Low. Required with v2 APIs."
    },
    "lowRiskEnableSmartLogin": {
      "type": "boolean",
      "description": "A flag indicating if Smart Login is enabled for Low risk.This parameter is deprecated, use the lowRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true
    },
    "lowRiskFirstStep": {
      "type": "string",
      "description": "The authenticator type to use in the first step of a two-step authentication scenario when the risk score is Low.  Only the values NONE, EXTERNAL, PASSWORD should be used for lowRiskFirstStep.  The value DENY can only be specified for low risk authentication when using Smart Login, otherwise DENY can only be specified for medium or high risk values. Other values are defined for backwards compatibility. Some values are not supported by all application types. This parameter is deprecated, use the lowRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true,
      "enum": [
        "NONE",
        "EXTERNAL",
        "PASSWORD",
        "KBA",
        "OTP",
        "TOKEN",
        "TOKENPUSH",
        "SMARTCREDENTIALPUSH",
        "IDP",
        "PASSKEY",
        "SMART_LOGIN",
        "USER_CERTIFICATE",
        "FACE",
        "DENY",
        "MAGICLINK"
      ]
    },
    "lowRiskSecondStep": {
      "type": "array",
      "description": "The authenticator type to use during in the second step of a two-step authentication scenario when the risk score is Low. Some values are not supported by all application types. This parameter is deprecated, use the lowRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true,
      "items": {
        "type": "string",
        "description": "The authenticator type to use during in the second step of a two-step authentication scenario when the risk score is Low. Some values are not supported by all application types. This parameter is deprecated, use the lowRiskAuthenticationFlow attribute with v2 APIs.",
        "deprecated": true,
        "enum": [
          "NONE",
          "KBA",
          "TEMP_ACCESS_CODE",
          "OTP",
          "GRID",
          "TOKEN",
          "TOKENCR",
          "TOKENPUSH",
          "FIDO",
          "USER_CERTIFICATE",
          "SMARTCREDENTIALPUSH",
          "FACE",
          "PASSTHROUGH",
          "MAGICLINK"
        ]
      }
    },
    "lowRiskThreshold": {
      "maximum": 100,
      "minimum": 0,
      "type": "integer",
      "description": "Risk scores below this value are considered Low risk.",
      "format": "int32"
    },
    "machineContext": {
      "required": [
        "denyAccess",
        "riskLimit",
        "riskPoint"
      ],
      "type": "object",
      "properties": {
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "riskLimit": {
          "type": "integer",
          "description": "The risk points apply if the machine authenticator risk is below or equal to this value.",
          "format": "int32"
        },
        "riskPoint": {
          "maximum": 100,
          "minimum": 0,
          "type": "integer",
          "description": "The number of risk points that apply if this context applies.",
          "format": "int32"
        }
      },
      "description": "Represents a Machine Authenticator authentication context. When defined, a Machine Authentication authenticator is expected in the  authentication request. Risk will apply if the machine authentication authenticator is not present or if the risk for the machine authentication authentication is greater than the risk limit define for the Machine context.",
      "title": "MachineContext"
    },
    "mediumRiskAuthenticationFlow": {
      "type": "string",
      "description": "The UUID of the authentication flow to use when the risk score is Medium. Required with v2 APIs."
    },
    "mediumRiskEnableSmartLogin": {
      "type": "boolean",
      "description": "A flag indicating if Smart Login is enabled for Medium risk.This parameter is deprecated, use the mediumRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true
    },
    "mediumRiskFirstStep": {
      "type": "string",
      "description": "The authenticator type to use in the first step of a two-step authentication scenario when the risk score is Medium. Only the values NONE, EXTERNAL, PASSWORD or DENY should be used for mediumRiskFirstStep. Other values are defined for backwards compatibility.  Some values are not supported by all application types. This parameter is deprecated, use the mediumRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true,
      "enum": [
        "NONE",
        "EXTERNAL",
        "PASSWORD",
        "KBA",
        "OTP",
        "TOKEN",
        "TOKENPUSH",
        "SMARTCREDENTIALPUSH",
        "IDP",
        "PASSKEY",
        "SMART_LOGIN",
        "USER_CERTIFICATE",
        "FACE",
        "DENY",
        "MAGICLINK"
      ]
    },
    "mediumRiskSecondStep": {
      "type": "array",
      "description": "The authenticator type to use during in the second step of a two-step authentication scenario when the risk score is Medium. Some values are not supported by all application types.This parameter is deprecated, use the mediumRiskAuthenticationFlow attribute with v2 APIs.",
      "deprecated": true,
      "items": {
        "type": "string",
        "description": "The authenticator type to use during in the second step of a two-step authentication scenario when the risk score is Medium. Some values are not supported by all application types.This parameter is deprecated, use the mediumRiskAuthenticationFlow attribute with v2 APIs.",
        "deprecated": true,
        "enum": [
          "NONE",
          "KBA",
          "TEMP_ACCESS_CODE",
          "OTP",
          "GRID",
          "TOKEN",
          "TOKENCR",
          "TOKENPUSH",
          "FIDO",
          "USER_CERTIFICATE",
          "SMARTCREDENTIALPUSH",
          "FACE",
          "PASSTHROUGH",
          "MAGICLINK"
        ]
      }
    },
    "mediumRiskThreshold": {
      "maximum": 100,
      "minimum": 0,
      "type": "integer",
      "description": "Risk scores below this value are considered Medium risk. Risk scores equal or greater than this value are considered High risk.",
      "format": "int32"
    },
    "name": {
      "type": "string",
      "description": "The name of the resource rule."
    },
    "removeDateTimeContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeDateTimeContext is set to true, the existing date time context is removed. This attribute is ignored when creating a resource rule."
    },
    "removeDeviceCertificateContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeDeviceCertificateContext is set to true, the existing device certificate context is removed. This attribute is ignored when creating a resource rule."
    },
    "removeIPContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeIPContext is set to true, the existing IP context is removed. This attribute is ignored when creating a resource rule."
    },
    "removeKBAContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeKBAContext is set to true, the existing KBA context is removed. This attribute is ignored when creating a resource rule."
    },
    "removeLocationContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeLocationContext is set to true, the existing location context is removed. This attribute is ignored when creating a resource rule."
    },
    "removeLocationHistoryContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeLocationHistoryContext is set to true, the existing location history context is removed. This attribute is ignored when creating a resource rule."
    },
    "removeMachineContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeMachineContext is set to true, the existing machine context is removed. This attribute is ignored when creating a resource rule."
    },
    "removeTravelVelocityContext": {
      "type": "boolean",
      "description": "When updating a resource rule, if removeTravelVelocityContext is set to true, the existing travel velocity context is removed. This attribute is ignored when creating a resource rule."
    },
    "resourceId": {
      "type": "string",
      "description": "The UUID of the resource to which this resource rule is assigned. This value is only used when creating a resource rule."
    },
    "riskEngineContexts": {
      "type": "array",
      "description": "If risk engine rules are defined, the transaction contexts specify the level at which risk is applied to the authentication request if the corresponding risk engine rules trigger risk. If set to null, no changes are made. If set to an empty set, transaction contexts are removed.",
      "items": {
        "required": [
          "denyAccess",
          "name",
          "riskLimit",
          "riskPoint",
          "transactionRuleRisks"
        ],
        "type": "object",
        "properties": {
          "denyAccess": {
            "type": "boolean",
            "description": "If true, the resource rule evaluating the context will return Access Denied."
          },
          "name": {
            "type": "string",
            "description": "The name of this transaction context."
          },
          "riskLimit": {
            "type": "integer",
            "description": "The risk points apply if the accumulated risk of each configured transaction rule is above this value.",
            "format": "int32"
          },
          "riskPoint": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer",
            "description": "The number of risk points that apply if this context applies.",
            "format": "int32"
          },
          "transactionRuleRisks": {
            "type": "array",
            "description": "The transaction rules associated with this context.",
            "items": {
              "required": [
                "riskScore",
                "transactionRuleId"
              ],
              "type": "object",
              "properties": {
                "riskScore": {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer",
                  "description": "The risk score that applies if this transaction rule is triggered.",
                  "format": "int32"
                },
                "transactionRuleId": {
                  "type": "string",
                  "description": "The id of the transaction rule associated with this risk definition."
                }
              },
              "description": "Information associated with the risk of a specific transaction rule within a transaction context.",
              "title": "TransactionRuleRisk"
            }
          }
        },
        "description": "The transaction context specifies transaction rules. Risk is applied to the authentication 1if the accumulated risk score of the transaction rules is above the risk limit.",
        "title": "TransactionContext"
      }
    },
    "skipSecondFactorIfUserNotExist": {
      "type": "boolean",
      "description": "A flag indicating if second factor will be skipped if user doesn't exist when the first factor was EXTERNAL."
    },
    "strictAccess": {
      "type": "boolean",
      "description": "A flag indicating if this resource rule enforces strict access. Strict access means that if this rule denies access, the user is denied access even if other resource rules allow access.",
      "example": true
    },
    "transactionContexts": {
      "type": "array",
      "description": "If transaction details are specified during an authentication request, the transaction contexts specify the level at which risk is applied to the authentication request if the corresponding transaction rules trigger risk. A maximum of two are allowed. If set to null, no changes are made. If set to an empty set, transaction contexts are removed.",
      "items": {
        "required": [
          "denyAccess",
          "name",
          "riskLimit",
          "riskPoint",
          "transactionRuleRisks"
        ],
        "type": "object",
        "properties": {
          "denyAccess": {
            "type": "boolean",
            "description": "If true, the resource rule evaluating the context will return Access Denied."
          },
          "name": {
            "type": "string",
            "description": "The name of this transaction context."
          },
          "riskLimit": {
            "type": "integer",
            "description": "The risk points apply if the accumulated risk of each configured transaction rule is above this value.",
            "format": "int32"
          },
          "riskPoint": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer",
            "description": "The number of risk points that apply if this context applies.",
            "format": "int32"
          },
          "transactionRuleRisks": {
            "type": "array",
            "description": "The transaction rules associated with this context.",
            "items": {
              "required": [
                "riskScore",
                "transactionRuleId"
              ],
              "type": "object",
              "properties": {
                "riskScore": {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer",
                  "description": "The risk score that applies if this transaction rule is triggered.",
                  "format": "int32"
                },
                "transactionRuleId": {
                  "type": "string",
                  "description": "The id of the transaction rule associated with this risk definition."
                }
              },
              "description": "Information associated with the risk of a specific transaction rule within a transaction context.",
              "title": "TransactionRuleRisk"
            }
          }
        },
        "description": "The transaction context specifies transaction rules. Risk is applied to the authentication 1if the accumulated risk score of the transaction rules is above the risk limit.",
        "title": "TransactionContext"
      }
    },
    "travelVelocityContext": {
      "required": [
        "denyAccess",
        "riskPoint"
      ],
      "type": "object",
      "properties": {
        "denyAccess": {
          "type": "boolean",
          "description": "If true, the resource rule evaluating the context will return Access Denied."
        },
        "riskPoint": {
          "maximum": 100,
          "minimum": 0,
          "type": "integer",
          "description": "The number of risk points that apply if this context applies.",
          "format": "int32"
        }
      },
      "description": "Travel velocity checks to see if the time between authentications at different locations means the user has traveled faster than a given velocity. If the velocity is exceeded, risk applies.",
      "title": "TravelVelocityContext"
    }
  },
  "description": "Parameters defining the new resource rule including the resource to which it applies.",
  "title": "ResourceRuleParms"
}
```

## Responses

### 200

Successful

### 400

Bad Request

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 401

Access denied

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 403

Forbidden

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 404

Not Found

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 409

Conflict

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

## Security

Requirements

```json
[
  {
    "AdminAPIAuthentication": [
      "CONTEXTRULES:EDIT"
    ]
  }
]
```
