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

# Cancelling Jobs

> Cancel a single job, multiple jobs at once, or an entire batch

You can cancel jobs at any point while they are still in a cancellable state - `queued` or `pending`. Jobs that are actively rendering (`render:dorender`) or already in a terminal state (`finished`, `error`, `manually_cancelled`) cannot be cancelled.

Cancellation cascades automatically - if you cancel a parent job, its child jobs are cancelled too. If you cancel a child job, the parent and any sibling jobs that were waiting on it are also cancelled.

## Cancel a Single Job

<CodeGroup>
  ```bash Request theme={null}
  curl -X PATCH https://api.nexrender.com/api/v2/jobs/01JTRDF7HCR8QAHYW8GPCP4S9Y/cancel \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```json Response theme={null}
  [
    {
      "id": "01JTRDF7HCR8QAHYW8GPCP4S9Y",
      "status": "manually_cancelled",
      "outputUrl": "https://nx1-outputs-eu.nexrender.com/.../job.mp4"
    }
  ]
  ```
</CodeGroup>

The response is an array of all jobs cancelled by the request - including any parent, child, or sibling jobs that were cascaded as a result.

## Cancel Multiple Jobs

To cancel several jobs in one call, use `POST /jobs/cancel` with a list of job IDs.

<CodeGroup>
  ```bash Request theme={null}
  curl -X POST https://api.nexrender.com/api/v2/jobs/cancel \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "jobs": [
        "01JTRDF7HCR8QAHYW8GPCP4S9Y",
        "01JTRGF9KDR4MAHZW9HPCP5T0Z"
      ]
    }'
  ```

  ```json Response theme={null}
  [
    {
      "id": "01JTRDF7HCR8QAHYW8GPCP4S9Y",
      "status": "manually_cancelled",
      "outputUrl": "https://nx1-outputs-eu.nexrender.com/.../job-a.mp4"
    },
    {
      "id": "01JTRGF9KDR4MAHZW9HPCP5T0Z",
      "status": "manually_cancelled",
      "outputUrl": "https://nx1-outputs-eu.nexrender.com/.../job-b.mp4"
    }
  ]
  ```
</CodeGroup>

You can include up to 1,000 job IDs in a single request. Each ID must be unique. If any of the requested jobs are not found, the API returns a 404.

## Cancel an Entire Batch

To cancel all remaining jobs in a batch, use `POST /batches/:id/cancel`. See the [Batch Jobs](/docs/cloud/jobs/batch_jobs) page for details.

## Cancellation Cascade

When a job is cancelled, Nexrender automatically cancels related jobs on a best-effort basis:

| Cancelled job | What else gets cancelled                                                          |
| ------------- | --------------------------------------------------------------------------------- |
| Parent job    | All child jobs that are still queued or pending                                   |
| Child job     | The parent job (now unresolvable) and any sibling child jobs waiting alongside it |
| Batch job     | Child jobs belonging to that batch job                                            |

All cancelled jobs - both the ones you explicitly requested and any cascaded relatives - are returned in the response array.

## Cancellable States

Only jobs in the following states can be cancelled:

| Status               | Cancellable             |
| -------------------- | ----------------------- |
| `queued`             | Yes                     |
| `pending`            | Yes                     |
| `render:dorender`    | No - actively rendering |
| `finished`           | No - already complete   |
| `error`              | No - already failed     |
| `manually_cancelled` | No - already cancelled  |


## OpenAPI

````yaml PATCH /jobs/{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:
  /jobs/{id}/cancel:
    patch:
      tags:
        - Render Management
      summary: Cancel job
      description: >-
        Cancel a single job by ID. The requested job must be in a cancellable
        state. Related parent, child, or sibling jobs discovered through nesting
        are cancelled on a best-effort basis and included in the response,
        including sibling cascades from child cancellation.
      operationId: cancelJob
      parameters:
        - in: path
          name: id
          required: true
          description: Unique job identifier
          schema:
            type: string
            pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
      responses:
        '200':
          description: >-
            Successfully cancelled the job and any related jobs that were also
            cancellable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobCancellationResponse'
        '400':
          description: Invalid job identifier.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '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: Requested job was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The requested job is not in a cancellable state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    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'
    ErrorResponse:
      type: object
      description: Standard error response format
      properties:
        error:
          type: string
          description: Human-readable error message explaining what went wrong
      required:
        - error
    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

````