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

# Change a batch's priority or pacing

> Re-order or re-pace a batch that is still queued or in flight. Both fields are optional — send only what you are changing, and an empty body leaves the batch untouched.

- `priority` re-orders the batch's REMAINING work within its own dispatch lane. Work already claimed or sent is never re-ordered, and the boost cannot take capacity from another lane — it only changes the order in which your own account's budget is spent, which is why no elevated role is required.
- `pacing` sets or replaces the release policy and applies from the next release tick: slowing a batch down never recalls work already released, and speeding one up never produces a burst to catch up. A policy that is not strictly slower than the rate your provider budget already allows is rejected rather than quietly clamped, so the policy you set is always the policy in force. Send `remove_pacing: true` to stop pacing a batch entirely.

Explicit JSON `null` is rejected — omit a field to leave it unchanged. A completed, failed, or cancelled batch cannot be changed (409). Cross-tenant access returns 404, never 403.



## OpenAPI

````yaml /openapi.json patch /flows/batches/{batch_id}
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}:
    patch:
      tags:
        - batches
      summary: Change a batch's priority or pacing
      description: >-
        Re-order or re-pace a batch that is still queued or in flight. Both
        fields are optional — send only what you are changing, and an empty body
        leaves the batch untouched.


        - `priority` re-orders the batch's REMAINING work within its own
        dispatch lane. Work already claimed or sent is never re-ordered, and the
        boost cannot take capacity from another lane — it only changes the order
        in which your own account's budget is spent, which is why no elevated
        role is required.

        - `pacing` sets or replaces the release policy and applies from the next
        release tick: slowing a batch down never recalls work already released,
        and speeding one up never produces a burst to catch up. A policy that is
        not strictly slower than the rate your provider budget already allows is
        rejected rather than quietly clamped, so the policy you set is always
        the policy in force. Send `remove_pacing: true` to stop pacing a batch
        entirely.


        Explicit JSON `null` is rejected — omit a field to leave it unchanged. A
        completed, failed, or cancelled batch cannot be changed (409).
        Cross-tenant access returns 404, never 403.
      operationId: patch_batch_flows_batches__batch_id__patch
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            title: Batch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchPatchIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '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 is in a terminal state, so there is nothing left to
            re-order or re-pace
          content:
            application/json:
              example:
                detail: >-
                  Cannot change a completed, failed, or cancelled batch — a
                  terminal batch has nothing left to re-order or re-pace.
        '422':
          description: >-
            The body failed validation — an explicit null on a patchable field,
            an unknown priority, a policy that is not strictly slower than the
            effective provider budget, or `pacing` and `remove_pacing` sent
            together
          content:
            application/json:
              example:
                detail: pacing may not be null — omit it to leave it unchanged.
        '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:
    BatchPatchIn:
      properties:
        priority:
          anyOf:
            - type: string
              enum:
                - normal
                - high
            - type: 'null'
          title: Priority
        pacing:
          anyOf:
            - $ref: '#/components/schemas/BatchPacingPolicyIn'
            - type: 'null'
        remove_pacing:
          type: boolean
          title: Remove Pacing
          default: false
      type: object
      title: BatchPatchIn
      description: >-
        Change a batch that is still queued or in flight.


        `priority` re-orders the batch's remaining work within its own dispatch

        lane; work already sent is untouched. `pacing` sets or replaces the
        release

        policy and applies from the next release tick — slowing a batch down
        never

        recalls work already released, and speeding one up never produces a
        burst

        to make up the difference. To stop pacing a batch entirely send

        `remove_pacing: true` rather than a null `pacing`.


        Every field is optional; send only what you are changing.
      example:
        pacing:
          period_minutes: 15
          records_per_period: 5000
        priority: high
    BatchResponse:
      properties:
        id:
          type: string
          title: Id
        definition_id:
          type: string
          title: Definition Id
        org_id:
          type: string
          title: Org Id
        trigger_id:
          type: string
          title: Trigger Id
        trigger_type:
          type: string
          title: Trigger Type
        trigger_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Trigger Source
        schedule_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule Id
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        status:
          type: string
          enum:
            - pending
            - queued
            - scheduled
            - running
            - paused
            - completed
            - completed_with_errors
            - partially_failed
            - failed
            - cancelled
          title: Status
        record_count:
          type: integer
          title: Record Count
        scheduled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Scheduled At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        priority:
          anyOf:
            - type: string
              enum:
                - normal
                - high
            - type: 'null'
          title: Priority
        pacing:
          anyOf:
            - $ref: '#/components/schemas/PacingPolicy'
            - type: 'null'
      type: object
      required:
        - id
        - definition_id
        - org_id
        - trigger_id
        - trigger_type
        - metadata
        - status
        - record_count
        - scheduled_at
        - started_at
        - completed_at
        - created_at
        - updated_at
      title: BatchResponse
      example:
        completed_at: '2026-07-09T18:00:05Z'
        created_at: '2026-07-09T17:59:59Z'
        definition_id: def_a1b2c3d4
        id: batch_55667788
        metadata:
          campaign: spring-2026
        org_id: org_a1b2c3d4
        record_count: 2
        started_at: '2026-07-09T18:00:00Z'
        status: completed
        trigger_id: trigger_44556677
        trigger_type: api_call
        updated_at: '2026-07-09T18:00:05Z'
    BatchPacingPolicyIn:
      properties:
        records_per_period:
          type: integer
          maximum: 1000000
          minimum: 1
          title: Records Per Period
        period_minutes:
          type: integer
          maximum: 1440
          minimum: 1
          title: Period Minutes
        window:
          anyOf:
            - $ref: '#/components/schemas/BatchDeliveryWindowIn'
            - type: 'null'
      type: object
      required:
        - records_per_period
        - period_minutes
      title: BatchPacingPolicyIn
      description: >-
        A ceiling on how fast a batch is released: N records every M minutes.


        The rate is a hard ceiling over any interval — there is no catch-up
        burst.

        After a pause, an exhausted provider quota or a closed delivery window,

        delivery resumes at the configured rate from that moment and the lost
        time

        is not made up.


        `period_minutes` is a whole number of minutes; pacing finer than a
        minute

        cannot be expressed. Add a `window` to confine delivery to particular
        local

        hours. Released records are ordinary queue work: they may still be
        merged

        with other batches' work bound for the same destination, but this batch

        never delivers faster than its policy allows.
      example:
        period_minutes: 15
        records_per_period: 5000
        window:
          days:
            - monday
            - tuesday
            - wednesday
            - thursday
            - friday
          end_minute_of_day: 1020
          start_minute_of_day: 540
          timezone: America/Denver
    PacingPolicy:
      properties:
        records_per_period:
          type: integer
          minimum: 1
          title: Records Per Period
        period_minutes:
          type: integer
          minimum: 1
          title: Period Minutes
        window:
          anyOf:
            - $ref: '#/components/schemas/DeliveryWindow'
            - type: 'null'
      type: object
      required:
        - records_per_period
        - period_minutes
      title: PacingPolicy
      description: >-
        A ceiling on how fast a batch may be released: N records every M
        minutes.


        The rate is a hard ceiling over any interval — there is no catch-up
        burst.

        After a pause, an exhausted provider quota or a closed delivery window,

        delivery resumes at the configured rate from that moment; the time lost
        is

        not made up.


        `period_minutes` is measured in whole minutes: pacing finer than a
        minute

        cannot be expressed. Add a `window` to confine delivery to particular
        local

        hours.
    BatchDeliveryWindowIn:
      properties:
        timezone:
          type: string
          minLength: 1
          title: Timezone
        start_minute_of_day:
          type: integer
          exclusiveMaximum: 1440
          minimum: 0
          title: Start Minute Of Day
        end_minute_of_day:
          type: integer
          maximum: 1440
          minimum: 1
          title: End Minute Of Day
        days:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Days
      type: object
      required:
        - timezone
        - start_minute_of_day
        - end_minute_of_day
      title: BatchDeliveryWindowIn
      description: >-
        The hours of the day during which a paced batch may deliver.


        `timezone` is a required IANA name such as `America/Denver` — a fixed
        UTC

        offset is wrong for half the year, so a window always states its own
        zone

        and there is no default. `start_minute_of_day` and `end_minute_of_day`
        are

        minutes since local midnight, start inclusive and end exclusive;

        `end_minute_of_day` may be `1440` (local midnight ending the day). A
        window

        that would wrap past midnight is refused. `days` limits delivery to

        particular lowercase weekday names (`monday` … `sunday`); omit it for
        every

        day.


        Records still queued when the window closes are neither dropped nor
        rushed:

        delivery resumes at the same local start time on the next allowed day.
      example:
        days:
          - monday
          - tuesday
          - wednesday
          - thursday
          - friday
        end_minute_of_day: 1020
        start_minute_of_day: 540
        timezone: America/Denver
    DeliveryWindow:
      properties:
        timezone:
          type: string
          title: Timezone
        start_minute_of_day:
          type: integer
          exclusiveMaximum: 1440
          minimum: 0
          title: Start Minute Of Day
        end_minute_of_day:
          type: integer
          maximum: 1440
          minimum: 1
          title: End Minute Of Day
        days:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Days
      type: object
      required:
        - timezone
        - start_minute_of_day
        - end_minute_of_day
      title: DeliveryWindow
      description: >-
        The hours of the day during which a paced batch may deliver.


        `timezone` is a required IANA name such as `America/Denver` — a fixed
        UTC

        offset is wrong for half the year, so there is no default and no
        fallback:

        a window always states its own zone. `start_minute_of_day` and

        `end_minute_of_day` are minutes since local midnight, start inclusive
        and

        end exclusive; `end_minute_of_day` may be `1440` (local midnight ending
        the

        day). A window that would wrap past midnight is rejected. `days` limits
        the

        window to particular lowercase weekday names (`monday` … `sunday`); omit
        it

        for every day.


        Records left over when the window closes are not dropped and are not

        rushed: delivery resumes at the same local start time on the next
        allowed

        day.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````