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

# Preview scope rules

> Counts the assets a rule set would select, without saving it.



## OpenAPI

````yaml /api-reference/openapi.json post /api/projects/scope-preview
openapi: 3.0.0
info:
  title: Open Attack Surface Management
  description: Open-source platform for cybersecurity Attack Surface Management (ASM)
  version: '1.0'
  contact: {}
servers:
  - url: https://{baseUrl}/api/v1
    variables:
      baseUrl:
        default: localhost:3000
        description: API server hostname with port (e.g. localhost:3000, api.example.com)
security: []
tags: []
externalDocs:
  description: Authentication Docs
  url: auth/docs
paths:
  /api/projects/scope-preview:
    post:
      tags:
        - Projects
      summary: Preview scope rules
      description: Counts the assets a rule set would select, without saving it.
      operationId: ProjectsController_previewScope
      parameters:
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScopePreviewDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScopePreviewResultDto'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    ScopePreviewDto:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/ScopeRuleInputDto'
        projectId:
          type: string
          description: Count hand-picked assets of this project as well
      required:
        - rules
    ScopePreviewResultDto:
      type: object
      properties:
        total:
          type: number
          description: 'Assets in scope: rule matches plus hand-picked'
        ruleAssets:
          type: number
          description: Assets the include/exclude rules select
        perRule:
          description: >-
            Per input rule: assets an include rule matches, or assets an exclude
            rule removes from the includes
          type: array
          items:
            type: number
      required:
        - total
        - ruleAssets
        - perRule
    AppResponseSerialization:
      type: object
      properties: {}
    ScopeRuleInputDto:
      type: object
      properties:
        mode:
          allOf:
            - $ref: '#/components/schemas/ProjectScopeRuleMode'
        type:
          allOf:
            - $ref: '#/components/schemas/ProjectScopeRuleType'
        value:
          type: string
          description: Target id, hostname pattern (`*` wildcards), CIDR, or asset id
          example: '*.example.com'
      required:
        - mode
        - type
        - value
    ProjectScopeRuleMode:
      type: string
      enum:
        - include
        - exclude
    ProjectScopeRuleType:
      type: string
      enum:
        - target
        - hostname
        - cidr
        - asset

````

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