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

# Create multiple targets in bulk

> Creates multiple security testing targets in a single request, skipping any duplicates that already exist in the workspace. Supports both DOMAIN (root domain) and CIDR (/24 range only) types. Returns detailed results including created targets and skipped values.



## OpenAPI

````yaml /api-reference/openapi.json post /api/targets/bulk
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/bulk:
    post:
      tags:
        - Targets
      summary: Create multiple targets in bulk
      description: >-
        Creates multiple security testing targets in a single request, skipping
        any duplicates that already exist in the workspace. Supports both DOMAIN
        (root domain) and CIDR (/24 range only) types. Returns detailed results
        including created targets and skipped values.
      operationId: TargetsController_createMultipleTargets
      parameters:
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMultipleTargetsDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkTargetResultDto'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    CreateMultipleTargetsDto:
      type: object
      properties:
        targets:
          description: >-
            Array of target values to create. Supports DOMAIN (root domain),
            CIDR (/24 range only), and IP (single IP address) types.
          example:
            - value: example.com
              type: DOMAIN
            - value: 192.168.1.0/24
              type: CIDR
            - value: 8.8.8.8
              type: IP
          type: array
          items:
            $ref: '#/components/schemas/CreateTargetDto'
      required:
        - targets
    BulkTargetResultDto:
      type: object
      properties:
        created:
          description: List of successfully created targets
          type: array
          items:
            $ref: '#/components/schemas/Target'
        skipped:
          description: List of target values that were skipped (already exist)
          example:
            - existing.com
            - duplicate.com
          type: array
          items:
            type: string
        totalRequested:
          type: number
          description: Total number of targets requested to create
          example: 10
        totalCreated:
          type: number
          description: Total number of targets successfully created
          example: 8
        totalSkipped:
          type: number
          description: Total number of targets skipped (duplicates)
          example: 2
      required:
        - created
        - skipped
        - totalRequested
        - totalCreated
        - totalSkipped
    CreateTargetDto:
      type: object
      properties:
        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
          default: DOMAIN
          allOf:
            - $ref: '#/components/schemas/TargetType'
      required:
        - value
    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 * *

````