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

# Get all targets in a workspace

> Fetches a comprehensive list of all registered security testing targets within the specified workspace for vulnerability management and assessment tracking.



## OpenAPI

````yaml /api-reference/openapi.json get /api/targets
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:
    get:
      tags:
        - Targets
      summary: Get all targets in a workspace
      description: >-
        Fetches a comprehensive list of all registered security testing targets
        within the specified workspace for vulnerability management and
        assessment tracking.
      operationId: TargetsController_getTargetsInWorkspace
      parameters:
        - name: search
          required: false
          in: query
          schema:
            type: string
        - name: page
          required: false
          in: query
          schema:
            example: 1
            type: number
        - name: limit
          required: false
          in: query
          schema:
            example: 10
            type: number
        - name: sortBy
          required: false
          in: query
          schema:
            example: createdAt
            type: string
        - name: sortOrder
          required: false
          in: query
          schema:
            example: DESC
            type: string
        - name: value
          required: false
          in: query
          schema:
            type: string
        - name: type
          required: false
          in: query
          description: Filter by target type (DOMAIN, CIDR, or IP)
          schema:
            $ref: '#/components/schemas/TargetType'
        - name: status
          required: false
          in: query
          description: >-
            Filter by scan status (pending, in_progress, completed, failed,
            cancelled)
          schema:
            $ref: '#/components/schemas/JobStatus'
        - name: scope
          required: false
          in: query
          description: Filter by target scope (INTERNAL or EXTERNAL)
          schema:
            $ref: '#/components/schemas/TargetScopeType'
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetManyGetManyTargetResponseDtoDto'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    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
    TargetScopeType:
      type: string
      enum:
        - INTERNAL
        - EXTERNAL
    GetManyGetManyTargetResponseDtoDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/GetManyTargetResponseDto'
        total:
          type: number
        page:
          type: number
        limit:
          type: number
        hasNextPage:
          type: boolean
        pageCount:
          type: number
      required:
        - data
        - total
        - page
        - limit
        - hasNextPage
        - pageCount
    GetManyTargetResponseDto:
      type: object
      properties:
        id:
          type: string
        value:
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/TargetType'
        reScanCount:
          type: number
        scanSchedule:
          type: string
          enum:
            - disabled
            - 0 0 * * *
            - 0 0 */3 * *
            - 0 0 * * 0
            - 0 0 */14 * *
            - 0 0 1 * *
        status:
          type: string
          enum:
            - RUNNING
            - DONE
          example: DONE
        totalAssetServices:
          type: number
          example: 100
        duration:
          type: number
        lastDiscoveredAt:
          format: date-time
          type: string
        internalNetworkId:
          type: string
      required:
        - id
        - value
        - type
        - reScanCount
        - scanSchedule
        - status
        - totalAssetServices
        - duration
        - lastDiscoveredAt
        - internalNetworkId

````