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

# Search assets and targets

> Search assets and targets



## OpenAPI

````yaml /api-reference/openapi.json get /api/search
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/search:
    get:
      tags:
        - Search
      summary: Search assets and targets
      description: Search assets and targets
      operationId: SearchController_searchAssetsTargets
      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: true
          in: query
          schema:
            type: string
        - name: workspaceId
          required: true
          in: query
          schema:
            type: string
        - name: isSaveHistory
          required: false
          in: query
          schema:
            type: boolean
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponseDto'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    SearchResponseDto:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/SearchData'
        total:
          type: number
        page:
          type: number
        limit:
          type: number
        pageCount:
          type: number
        hasNextPage:
          type: boolean
      required:
        - data
        - total
        - page
        - limit
        - pageCount
        - hasNextPage
    SearchData:
      type: object
      properties:
        assets:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
        targets:
          type: array
          items:
            $ref: '#/components/schemas/Target'
      required:
        - assets
        - targets
    Asset:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        value:
          type: string
        targetId:
          type: string
        isPrimary:
          type: boolean
        dnsRecords:
          type: object
        isEnabled:
          type: boolean
      required:
        - id
        - createdAt
        - updatedAt
        - value
        - targetId
        - isPrimary
        - dnsRecords
        - isEnabled
    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 * *

````