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

# Bulk delete jobs

> Delete up to 100 jobs in one request using DELETE /dn/jobs. The API returns per-row results, and partial failures include a deletion_failed code with specific error reasons.

This endpoint removes up to 100 jobs in a single request. Provide an array of objects that each identify a job by `do_number` (and optionally `date` and `type`). The API returns a per-row `ok` status so you can see exactly which deletions succeeded and which failed, along with the reason for any failure.

For deleting a single job, see [Delete job](/api-reference/jobs/delete). To update jobs in bulk, see [Bulk update](/api-reference/jobs/bulk-update).


## OpenAPI

````yaml DELETE /dn/jobs
openapi: 3.0.3
info:
  title: Detrack REST API v2
  version: '2.0'
  description: >-
    Detrack REST API v2. Checked against detrack-webapp origin/main (production)
    on 2026-09-29: dn_jobs.rb @ d246ad006, dn_depots.rb @ 2a5f387, dn_routes.rb
    @ 50a73a9, app_helper.rb @ d745ad2, dn_jobs_helper.rb @ d296e30,
    job_decorator.rb @ 3041da7, run_location_decorator.rb @ 0f0274d,
    vehicle_route_plan_decorator.rb and tsp_route_decorator.rb @ 7d1f3ef,
    data_export.rb @ ed4e135.
servers:
  - url: https://app.detrack.com/api/v2
security:
  - apiKey: []
tags:
  - name: Jobs
    description: Deliveries and collections.
  - name: Depots
    description: Saved warehouse and pickup locations.
  - name: Routes
    description: Optimized multi-stop plans across vehicles.
paths:
  /dn/jobs:
    delete:
      tags:
        - Jobs
      summary: Bulk delete jobs
      description: Deletes up to 100 jobs.
      operationId: bulkDeleteJobs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: array
                  description: >-
                    Only the first 100 items are processed. Any beyond that are
                    ignored without an error.
                  items:
                    $ref: '#/components/schemas/JobRef'
      responses:
        '200':
          description: Every row was deleted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobRowResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          description: >-
            Some rows weren't deleted. Rows that succeeded are still deleted.
            `errors` has `not_found` or `undeletable` for each failed row.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: deletion_failed
                  message:
                    type: string
                    example: Deletion failed
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobRowError'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobRowResult'
        default:
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    JobRef:
      type: object
      required:
        - do_number
      properties:
        do_number:
          type: string
          example: DO-10001
        date:
          type: string
          format: date
          nullable: true
          example: '2026-09-15'
        type:
          type: string
          enum:
            - Delivery
            - Collection
          nullable: true
          example: Delivery
    JobRowResult:
      allOf:
        - $ref: '#/components/schemas/JobRef'
        - type: object
          properties:
            ok:
              type: boolean
              example: true
    JobRowError:
      allOf:
        - $ref: '#/components/schemas/JobRef'
        - type: object
          properties:
            field:
              type: string
              description: Present for field validation errors.
              example: job_sequence
            codes:
              type: array
              items:
                type: string
              example:
                - not_found
    Error:
      type: object
      properties:
        code:
          type: string
          example: not_found
        message:
          type: string
          example: Could not find job with this DO number
  responses:
    BadRequest:
      description: The request body isn't valid JSON.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: invalid_json_format
    Unauthorized:
      description: >-
        The API key is missing or invalid. A missing `X-API-KEY` returns `{
        "error": "Missing Authorization header" }`; an invalid key returns `{
        "code": "invalid_key", "message": "Invalid key" }`.
      content:
        application/json:
          schema:
            oneOf:
              - type: object
                title: Missing key
                required:
                  - error
                properties:
                  error:
                    type: string
                    example: Missing Authorization header
              - type: object
                title: Invalid key
                required:
                  - code
                properties:
                  code:
                    type: string
                    example: invalid_key
                  message:
                    type: string
                    example: Invalid key
          example:
            code: invalid_key
            message: Invalid key
    Forbidden:
      description: Your API key's user doesn't have permission for this action.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: forbidden
          example:
            code: forbidden
    ServerError:
      description: >-
        Unexpected server error. Retry with exponential backoff, and contact
        Detrack support if it persists.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Detrack API key, from **Integrations > API Key** in the dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.