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

# Retrieves the next job associated with the given worker that has not yet been started.



## OpenAPI

````yaml /api-reference/openapi.json get /api/jobs-registry/{workerId}/next
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/jobs-registry/{workerId}/next:
    get:
      tags:
        - JobsRegistry
      summary: >-
        Retrieves the next job associated with the given worker that has not yet
        been started.
      operationId: JobsRegistryController_getNextJob
      parameters:
        - name: workerId
          required: true
          in: path
          schema:
            type: string
        - name: worker-token
          in: header
          description: Worker authentication token
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetNextJobResponseDto'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    GetNextJobResponseDto:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        asset:
          $ref: '#/components/schemas/Asset'
        category:
          type: string
          enum:
            - subdomains
            - http_probe
            - ports_scanner
            - vulnerabilities
            - screenshot
            - classifier
            - assistant
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - failed
            - cancelled
            - skipped
        command:
          type: string
      required:
        - id
        - createdAt
        - updatedAt
        - asset
        - category
        - status
        - command
    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

````