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

# Requeue a batch's held work

> Put a batch's HELD work back in line to be sent.

When a send's outcome could not be confirmed, that work is held rather than resent: an automatic retry could dial the same people twice. This endpoint is how a person releases that held work once they have decided it is safe. It NEVER runs automatically — nothing in the system requeues held work on its own, and held work waits indefinitely until someone asks.

What happens: the batch's held records go back to `queued` and re-enter the paced queue, taking a fresh share of the provider's rate budget when they are next sent. The batch's counters move with them. Requeueing the same batch again is safe — the second request reports `requeued: 0` because there is nothing left held.

Two refusals, both 409. A batch that was CANCELLED (or has otherwise settled) cannot be requeued: cancelling stops all future sends. And if any held work was sent in the same provider call as another batch's records — which the system does deliberately to use the provider's budget well — the whole request is refused and the response names the other batches, because releasing it would re-send records outside the batch you named. Nothing is requeued in that case; the decision is yours.

A batch with nothing held returns `requeued: 0`, not an error. Requeueing needs no special role: any key for the owning organization can requeue that organization's own batches. Cross-tenant access returns 404, never 403.



## OpenAPI

````yaml /openapi.json post /flows/batches/{batch_id}/requeue
openapi: 3.1.0
info:
  title: GetDialed API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/v1
    description: Production
security: []
paths:
  /flows/batches/{batch_id}/requeue:
    post:
      tags:
        - batches
      summary: Requeue a batch's held work
      description: >-
        Put a batch's HELD work back in line to be sent.


        When a send's outcome could not be confirmed, that work is held rather
        than resent: an automatic retry could dial the same people twice. This
        endpoint is how a person releases that held work once they have decided
        it is safe. It NEVER runs automatically — nothing in the system requeues
        held work on its own, and held work waits indefinitely until someone
        asks.


        What happens: the batch's held records go back to `queued` and re-enter
        the paced queue, taking a fresh share of the provider's rate budget when
        they are next sent. The batch's counters move with them. Requeueing the
        same batch again is safe — the second request reports `requeued: 0`
        because there is nothing left held.


        Two refusals, both 409. A batch that was CANCELLED (or has otherwise
        settled) cannot be requeued: cancelling stops all future sends. And if
        any held work was sent in the same provider call as another batch's
        records — which the system does deliberately to use the provider's
        budget well — the whole request is refused and the response names the
        other batches, because releasing it would re-send records outside the
        batch you named. Nothing is requeued in that case; the decision is
        yours.


        A batch with nothing held returns `requeued: 0`, not an error.
        Requeueing needs no special role: any key for the owning organization
        can requeue that organization's own batches. Cross-tenant access returns
        404, never 403.
      operationId: requeue_batch_flows_batches__batch_id__requeue_post
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            title: Batch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchRequeueResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '404':
          description: >-
            No such batch for this organization (cross-tenant access also
            returns 404)
          content:
            application/json:
              example:
                detail: Batch not found
        '409':
          description: >-
            The batch has been cancelled or has settled, OR some held work spans
            another batch. The cancelled case carries a string `detail`; the
            spanning case carries an object naming the other batches.
          content:
            application/json:
              examples:
                cancelled:
                  value:
                    detail: >-
                      Cannot requeue a batch that has been cancelled or has
                      already settled — cancelling a batch stops all future
                      sends, and work held on it stays held.
                spans_another_batch:
                  value:
                    detail:
                      message: >-
                        Some held work on this batch was sent in the same
                        provider call as another batch's records, so requeueing
                        it would re-send records outside the batch you named. No
                        work was requeued.
                      items:
                        - dq_9f2c1a4b
                      other_batch_ids:
                        - batch_7c1e
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded — retry after the Retry-After header
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
          content:
            application/json:
              example:
                detail: 'Rate limit exceeded: 100 per 1 minute'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    BatchRequeueResponse:
      properties:
        requeued:
          type: integer
          title: Requeued
        rows:
          type: integer
          title: Rows
        items:
          items:
            type: string
          type: array
          title: Items
      type: object
      required:
        - requeued
        - rows
        - items
      title: BatchRequeueResponse
      description: >-
        What a re-drive of a batch's held work actually moved.


        `requeued` counts the held provider calls put back in line and `rows`
        the

        records they carry — both are what the write CONFIRMED, so a repeat of
        the

        same request reports zeroes rather than re-sending anything. `items`

        identifies the calls that moved.
      example:
        items:
          - dq_9f2c1a4b
          - dq_0d7e83aa
        requeued: 2
        rows: 100000
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````