---
title: "Retrieves a custom security rule."
method: GET
path: "/subscriptions/{subscriptionUuid}/config/security/custom-rules/{customRuleId}"
tags: ["CDNs"]
---

# Retrieves a custom security rule.

`GET /subscriptions/{subscriptionUuid}/config/security/custom-rules/{customRuleId}`

## Request

- Base URL: `https://api.acquia.com/v3`
- URL: `https://api.acquia.com/v3/subscriptions/{subscriptionUuid}/config/security/custom-rules/{customRuleId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/docs/subscriptions/:subscriptionUuid/config/security/custom-rules/:customRuleId/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves a custom security rule for a subscription.

## Path parameters

- `subscriptionUuid` string, required
- `customRuleId` string, required

## Response `200`

OK

- object
  - `id` integer, required: The unique identifier of the custom security rule.
  - `display_name` string, required: The display name of the custom security rule.
  - `action` 'block' | 'allow' | 'alert', required: The action applied when the rule matches.
  - `priority` integer, required: The priority order for the rule. Lower values are evaluated first. Priorities must be unique within a subscription — creating or updating a rule with a priority already in use replaces the existing rule at that priority.
  - `domains` string[], required: The domains the rule applies to.
  - `paths` string[], required: The paths the rule applies to.
  - `mapped_domains_count` integer: The number of domains the rule is mapped to.
  - `targets` union[], required: Conditions that must match for the rule to fire.
    - union
      - object: Range match for IP or ASN ranges.
        - `attribute` 'source-ip' | 'asn', required: The request attribute the rule inspects.
        - `criteria` 'range', required: How `value` is compared against `attribute`.
        - `value` object, required: Range bounds for IP or ASN ranges.
          - `from` string, required: The start of the range.
          - `to` string, required: The end of the range.
      - object: Value-list match for non-header, non-query attributes.
        - `attribute` 'source-ip' | 'country' | 'method' | 'path' | 'asn', required: The request attribute the rule inspects.
        - `criteria` 'equals' | 'contains' | 'regex', required: How `value` is compared against `attribute`.
        - `value` object, required: A list of candidate values combined with OR.
          - `values` string[], required: The list of values.
      - object: Key-value match for header or query-string attributes.
        - `attribute` 'header' | 'query-string', required: The request attribute the rule inspects.
        - `criteria` 'equals' | 'contains' | 'regex', required: How `value` is compared against `attribute`.
        - `value` object, required: Key-value matchers for header or query-string attributes.
          - `key_value_pairs` object[], required: The list of key-value pairs.
            - `key` string, required: The header or query-parameter name.
            - `value` string, required: The expected value.
  - `created_at` string, date-time, required: The timestamp when the rule was created.
  - `updated_at` string, date-time, required: The timestamp when the rule was last updated.
  - `_links` object, required: HAL links for the resource
    - `self` CDNAPIHalLink, required: HAL link object
      - `href` union, required: The target URI of the link (can be a URI or URI template)
        - string, uri
        - string, uri-template
      - `templated` boolean: Whether the link is a URI template
      - `type` string: Hint about the media type expected when dereferencing the target resource
      - `deprecation` string: A URL to a resource that provides deprecation information
      - `name` string: A secondary key for selecting links
      - `profile` string: A URI that hints about the profile of the target resource
      - `title` string: A human-readable identifier for the link
      - `hreflang` string: The language of the target resource
  - `_embedded` object: Embedded resources (optional)

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api.md) - [All operations](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/acquia/apis/acquia-cloud-platform-api/revisions/508f8f94456d?raw)
