> ## 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.

# Replace scope rules

> Saves the rule set and syncs the assets the rules add or no longer select.



## OpenAPI

````yaml /api-reference/openapi.json put /api/projects/{id}/scope-rules
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/{id}/scope-rules:
    put:
      tags:
        - Projects
      summary: Replace scope rules
      description: >-
        Saves the rule set and syncs the assets the rules add or no longer
        select.
      operationId: ProjectsController_replaceScopeRules
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceScopeRulesDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScopeSyncResultDto'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    ReplaceScopeRulesDto:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/ScopeRuleInputDto'
        autoAddAssets:
          type: boolean
      required:
        - rules
    ScopeSyncResultDto:
      type: object
      properties:
        added:
          type: number
        removed:
          type: number
      required:
        - added
        - removed
    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.