> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.flare.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Matching Policies By Identifier Id (Beta)

> Return the matching policies assigned to an identifier of the tenant the caller is acting in, each with its assignment date and `clean_past_events` setting. The result is not paginated, an identifier having at most 10 matching policies, and it is an empty list when the identifier has no policy or does not exist in the tenant.

&#x20;Required API key permission: **Read Tenant**

> [!NOTE]
>
> The List Matching Policies By Identifier Id endpoint is still in beta and is subject to change.


## OpenAPI

````yaml firework-v4-openapi get /firework/v4/matching-policies/by_identifier_id/{identifier_id}
openapi: 3.1.0
info:
  title: Firework API
  version: v4
servers:
  - url: https://api.flare.io
security:
  - BearerAuth: []
tags:
  - name: Audit Logs
    description: Audit trail of actions performed in the platform.
  - name: Credentials
    description: >-
      Leaked credentials: search across all sources or within a tenant, and
      remediate or ignore them.
  - name: Entities
    description: >-
      Threat intelligence entities such as actors, chat channels, forum threads
      and domains, and the relations between them.
  - name: Events
    description: >-
      Events collected by Flare: global search, tenant and identifier feeds,
      event details, actions and saved feed views.
  - name: Identifiers
    description: >-
      Identifiers are the assets a tenant monitors, such as domains, keywords
      and email addresses. Includes recommendations and authorization of
      sensitive identifiers.
  - name: Matching Policies
    description: >-
      Matching policies refine which events match identifiers. Manage policies
      and their assignment to identifiers.
  - name: Sandbox
    description: File uploads and their sandbox analysis.
  - name: Threat Flow
    description: >-
      Threat Flow intelligence requests, generated reports and conversation
      summaries.
paths:
  /firework/v4/matching-policies/by_identifier_id/{identifier_id}:
    get:
      tags:
        - Matching Policies
      summary: List the matching policies of an identifier
      description: >-
        Return the matching policies assigned to an identifier of the tenant the
        caller is acting in, each with its assignment date and
        `clean_past_events` setting. The result is not paginated, an identifier
        having at most 10 matching policies, and it is an empty list when the
        identifier has no policy or does not exist in the tenant.
      operationId: >-
        list_matching_policies_by_identifier_id_matching_policies_by_identifier_id__identifier_id__get
      parameters:
        - name: identifier_id
          in: path
          required: true
          schema:
            type: integer
            description: ID of the identifier.
            title: Identifier Id
          description: ID of the identifier.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MatchingPolicyAssignmentPayload'
                title: >-
                  Response List Matching Policies By Identifier Id Matching
                  Policies By Identifier Id  Identifier Id  Get
        '401':
          description: UNAUTHORIZED
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    properties:
                      code:
                        type: string
                        enum:
                          - UNAUTHORIZED
                      data:
                        anyOf:
                          - additionalProperties: true
                            type: object
                          - type: 'null'
                        title: Data
                      message:
                        anyOf:
                          - type: string
                          - items: {}
                            type: array
                          - type: 'null'
                        title: Message
                    required:
                      - code
                      - data
                      - message
                    title: HTTPError
                    type: object
                required:
                  - error
        '403':
          description: FORBIDDEN
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    properties:
                      code:
                        type: string
                        enum:
                          - FORBIDDEN
                      data:
                        anyOf:
                          - additionalProperties: true
                            type: object
                          - type: 'null'
                        title: Data
                      message:
                        anyOf:
                          - type: string
                          - items: {}
                            type: array
                          - type: 'null'
                        title: Message
                    required:
                      - code
                      - data
                      - message
                    title: HTTPError
                    type: object
                required:
                  - error
        '404':
          description: NOT_FOUND
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    properties:
                      code:
                        type: string
                        enum:
                          - NOT_FOUND
                      data:
                        anyOf:
                          - additionalProperties: true
                            type: object
                          - type: 'null'
                        title: Data
                      message:
                        anyOf:
                          - type: string
                          - items: {}
                            type: array
                          - type: 'null'
                        title: Message
                    required:
                      - code
                      - data
                      - message
                    title: HTTPError
                    type: object
                required:
                  - error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    MatchingPolicyAssignmentPayload:
      properties:
        matching_policy:
          $ref: '#/components/schemas/MatchingPolicyPayload'
          description: The matching policy assigned to the identifier
        assigned_at:
          type: string
          format: date-time
          title: Assigned At
          description: The date and time this policy was assigned to the identifier
        clean_past_events:
          type: boolean
          title: Clean Past Events
          description: Whether this policy has been applied to historical events
      type: object
      required:
        - matching_policy
        - assigned_at
        - clean_past_events
      title: MatchingPolicyAssignmentPayload
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MatchingPolicyPayload:
      properties:
        uuid:
          type: string
          format: uuid4
          title: Uuid
          description: The UUID of the matching policy
        name:
          type: string
          title: Name
          description: The name of the matching policy
        policy_type:
          $ref: '#/components/schemas/MatchingPolicyType'
          description: The type of the matching policy
        value:
          $ref: '#/components/schemas/PolicyReadValue'
          description: The value of the matching policy depending on its type
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time the matching policy was created
        last_updated_at:
          type: string
          format: date-time
          title: Last Updated At
          description: The date and time the matching policy was last updated
      type: object
      required:
        - uuid
        - name
        - policy_type
        - value
        - created_at
        - last_updated_at
      title: MatchingPolicyPayload
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MatchingPolicyType:
      type: string
      enum:
        - INCLUDED_KEYWORDS
        - EXCLUDED_KEYWORDS
        - LUCENE_QUERY
        - ASTP_COOKIES
        - ASTP_DOMAIN
        - LOOKALIKE_STRATEGIES
      title: MatchingPolicyType
    PolicyReadValue:
      anyOf:
        - $ref: '#/components/schemas/KeywordsValue'
        - $ref: '#/components/schemas/LuceneValue'
        - $ref: '#/components/schemas/AstpCookiesReadValue'
        - $ref: '#/components/schemas/AstpDomainValue'
        - $ref: '#/components/schemas/LookalikeMatchStrategiesValue'
    KeywordsValue:
      properties:
        keywords:
          items:
            type: string
          type: array
          title: Keywords
          description: The keywords of the matching policy, at most 50.
      type: object
      required:
        - keywords
      title: KeywordsValue
    LuceneValue:
      properties:
        query:
          type: string
          title: Query
          description: The lucene query of the matching policy
      type: object
      required:
        - query
      title: LuceneValue
    AstpCookiesReadValue:
      properties:
        cookie_names:
          items:
            type: string
          type: array
          title: Cookie Names
          description: The cookie names to monitor, from 1 to 20 names
        match_subdomains:
          type: boolean
          title: Match Subdomains
          description: >-
            Whether this policy will be applied to monitor subdomains of the
            assigned domain identifiers
          default: false
        match_prefix:
          type: boolean
          title: Match Prefix
          description: >-
            Whether the cookie names are matched as prefixes rather than
            exactly. Read-only: it cannot be set through this API.
          default: false
      type: object
      required:
        - cookie_names
      title: AstpCookiesReadValue
    AstpDomainValue:
      properties:
        match_mode:
          $ref: '#/components/schemas/DomainMatchMode'
          description: >-
            The domain match mode for this policy: whether leaked credentials
            match the domain identifier on the email domain, on the
            authentication domain, or on either
          default: email_domain_only
      type: object
      title: AstpDomainValue
    LookalikeMatchStrategiesValue:
      properties:
        match_strategies:
          items:
            $ref: '#/components/schemas/Heuristic'
          type: array
          title: Match Strategies
          description: >-
            The lookalike domain match strategies to monitor: at least one, and
            `various` is not accepted
      type: object
      required:
        - match_strategies
      title: LookalikeMatchStrategiesValue
    DomainMatchMode:
      type: string
      enum:
        - email_domain_only
        - auth_domain_and_email_domain
        - auth_domain_only
      title: DomainMatchMode
    Heuristic:
      type: string
      enum:
        - addition
        - bitsquatting
        - cyrillic
        - dictionary
        - ends-with
        - homoglyph
        - hyphenation
        - insertion
        - omission
        - plural
        - repetition
        - replacement
        - starts-with
        - subdomain
        - tld-swap
        - transposition
        - various
        - vowel-swap
      title: Heuristic
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.