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

# Update a target

> Modifies the configuration and properties of an existing security testing target, allowing for dynamic adjustments to assessment parameters.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/targets/{id}
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/targets/{id}:
    patch:
      tags:
        - Targets
      summary: Update a target
      description: >-
        Modifies the configuration and properties of an existing security
        testing target, allowing for dynamic adjustments to assessment
        parameters.
      operationId: TargetsController_updateTarget
      parameters:
        - name: id
          required: true
          in: path
          description: The id of the resource
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTargetDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Target'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    UpdateTargetDto:
      type: object
      properties:
        scanSchedule:
          type: string
          enum:
            - disabled
            - 0 0 * * *
            - 0 0 */3 * *
            - 0 0 * * 0
            - 0 0 */14 * *
            - 0 0 1 * *
      required:
        - scanSchedule
    Target:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        value:
          type: string
          example: example.com
          description: The target value (domain, IP address, or CIDR notation)
        type:
          description: The type of target (DOMAIN, CIDR, or IP)
          example: DOMAIN
          allOf:
            - $ref: '#/components/schemas/TargetType'
        lastDiscoveredAt:
          format: date-time
          type: string
        totalAssetServices:
          type: number
        status:
          allOf:
            - $ref: '#/components/schemas/JobStatus'
        scanSchedule:
          allOf:
            - $ref: '#/components/schemas/CronSchedule'
      required:
        - id
        - createdAt
        - updatedAt
        - value
        - type
        - lastDiscoveredAt
        - totalAssetServices
        - status
        - scanSchedule
    TargetType:
      type: string
      enum:
        - DOMAIN
        - CIDR
        - IP
      description: The type of target (DOMAIN, CIDR, or IP)
    JobStatus:
      type: string
      enum:
        - pending
        - in_progress
        - completed
        - failed
        - cancelled
        - skipped
    CronSchedule:
      type: string
      enum:
        - disabled
        - 0 0 * * *
        - 0 0 */3 * *
        - 0 0 * * 0
        - 0 0 */14 * *
        - 0 0 1 * *

````