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

# Cancel batch jobs

> Attempt to cancel every top-level job belonging to the batch. Batch cancellation is best effort: jobs already cancelled or already in progress are skipped, while related parent, child, or sibling jobs discovered through nesting are cancelled when possible, including sibling cascades from child cancellation.



## OpenAPI

````yaml /openapi.json post /batches/{id}/cancel
openapi: 3.0.4
info:
  title: Nexrender API
  version: '2.0'
  description: >
    REST API for the Nexrender cloud rendering platform, enabling programmatic
    control over After Effects template processing, job management, and asset
    handling.


    Features include:


    - Template upload and management (AEP, MOGRT, ZIP files)

    - Job creation and status monitoring with real-time progress

    - Job nesting for multi-composition renders (parent/child jobs)

    - Job stitching to combine multiple videos into one

    - Batch job creation for submitting up to 1000 jobs at once

    - Font library management for typography consistency

    - Secret management for secure API key storage

    - Webhook notifications for job lifecycle events

    - Asset injection for dynamic content replacement


    Authentication is required for all endpoints using Bearer token
    authorization.
servers:
  - url: https://api.nexrender.com/api/v2
    description: Production API server
security:
  - apiToken: []
paths:
  /batches/{id}/cancel:
    post:
      tags:
        - Batch Management
      summary: Cancel batch jobs
      description: >-
        Attempt to cancel every top-level job belonging to the batch. Batch
        cancellation is best effort: jobs already cancelled or already in
        progress are skipped, while related parent, child, or sibling jobs
        discovered through nesting are cancelled when possible, including
        sibling cascades from child cancellation.
      operationId: cancelBatch
      parameters:
        - in: path
          name: id
          required: true
          description: Unique batch identifier in ULID format
          schema:
            type: string
            pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
      responses:
        '200':
          description: Best-effort batch cancellation completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCancellationResponse'
        '400':
          description: Invalid batch ID format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized - invalid or missing API token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - team not accessible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Batch not found - no top-level jobs exist with this batch ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BatchCancellationResponse:
      type: object
      description: >-
        Best-effort cancellation summary for a batch. Counts refer to the
        top-level jobs stored under the batch ID; cancelledJobs includes all
        unique jobs actually cancelled, including cascaded relatives.
      properties:
        batchId:
          type: string
          description: Unique batch identifier.
        status:
          type: string
          enum:
            - cancelled
            - partial
            - unchanged
          description: >-
            cancelled when every top-level batch job was cancelled, partial when
            some were skipped, unchanged when none were cancellable.
        totalJobs:
          type: integer
          description: Total number of top-level jobs in the batch.
        cancelledCount:
          type: integer
          description: Number of top-level jobs cancelled by the request.
        skippedCount:
          type: integer
          description: >-
            Number of top-level jobs skipped because they were already missing
            or not in a cancellable state.
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/BatchCancellationJobResult'
        cancelledJobs:
          $ref: '#/components/schemas/JobCancellationResponse'
      required:
        - batchId
        - status
        - totalJobs
        - cancelledCount
        - skippedCount
        - jobs
        - cancelledJobs
    ValidationErrorResponse:
      type: object
      description: Validation error response with detailed field information
      properties:
        error:
          type: string
          description: Main error message
        details:
          type: array
          description: Array of specific validation errors for individual fields
          items:
            type: object
            properties:
              field:
                type: string
                description: Field name that failed validation
              message:
                type: string
                description: Specific validation error for this field
    ErrorResponse:
      type: object
      description: Standard error response format
      properties:
        error:
          type: string
          description: Human-readable error message explaining what went wrong
      required:
        - error
    BatchCancellationJobResult:
      type: object
      description: Cancellation result for a top-level job belonging to the batch.
      properties:
        index:
          type: integer
          description: Zero-based index of the job within the batch.
        id:
          type: string
          description: Unique identifier of the top-level batch job.
        result:
          type: string
          enum:
            - cancelled
            - skipped
          description: Whether the top-level batch job was cancelled or skipped.
        status:
          type: string
          description: >-
            Current state of the top-level job after the cancellation attempt.
            Manually cancelled jobs are returned as `manually_cancelled`.
        reason:
          type: string
          description: Human-readable explanation for skipped jobs.
      required:
        - index
        - id
        - result
        - status
    JobCancellationResponse:
      type: array
      description: >-
        Jobs cancelled by the request, including any related parent, child, or
        sibling jobs cancelled as part of the same operation. Cancelling a child
        may trigger sibling cascades when those related jobs are still
        cancellable.
      items:
        $ref: '#/components/schemas/Job'
    Job:
      type: object
      description: Render job with current status, progress, and detailed statistics
      properties:
        id:
          type: string
          description: Unique job identifier used for tracking and API operations
        templateId:
          type: string
          description: >-
            Reference to the template used for this job (null if template was
            not used)
          nullable: true
        status:
          type: string
          description: >-
            Current job status (queued, render:dorender, finished, error, etc.).
            Manually cancelled jobs are normalized to `manually_cancelled` in v2
            responses even though they are stored internally as `error`.
        progress:
          type: number
          format: float
          description: Render progress as a percentage (0.0 to 100.0)
        stats:
          type: object
          description: Detailed timing and metadata statistics for the job
          properties:
            createdAt:
              type: string
              format: date-time
              description: ISO timestamp when the job was initially created
            updatedAt:
              type: string
              format: date-time
              description: ISO timestamp of the most recent job status update
            startedAt:
              type: string
              format: date-time
              nullable: true
              description: ISO timestamp when job processing began (null if not started)
            finishedAt:
              type: string
              format: date-time
              nullable: true
              description: >-
                ISO timestamp when job completed successfully (null if not
                finished)
            errorAt:
              type: string
              format: date-time
              nullable: true
              description: ISO timestamp when job encountered an error (null if no error)
            totalAssets:
              type: integer
              description: Total number of assets included in this job
            renderDuration:
              type: number
              format: float
              nullable: true
              description: Total render time in seconds (null if not completed)
            error:
              type: string
              nullable: true
              description: Error message if job failed (null if successful)
        outputUrl:
          type: string
          nullable: true
          description: URL to the rendered content
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      description: >
        Bearer token authentication using API tokens for team-based access
        control.


        You can generate your own API token at:
        https://app.nexrender.com/settings/api-tokens

````