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

# Cancel a managed job

> Request cancellation for active child trials without rewriting completed results.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/users/{user_id}/harbor/jobs/{job_id}/cancel
openapi: 3.1.0
info:
  title: Synth API Reference
  version: 2026-08-23.alpha
  description: HTTP API for your account, tasks, datasets, agent runs and usage.
servers:
  - url: https://sprites-gateway.api.synthlabs.ai
    description: Synth API
security: []
tags:
  - name: Identity
    description: Manage customer tokens without exposing internal service credentials.
  - name: Registry
    description: >-
      Create, discover, set visibility, version, execute, and inspect results
      for Harbor-compatible tasks and datasets.
  - name: Managed execution
    description: Validate, run, observe, and retrieve Harbor-compatible managed work.
  - name: Usage
    description: Inspect authoritative current rolling quota.
paths:
  /api/v1/users/{user_id}/harbor/jobs/{job_id}/cancel:
    post:
      tags:
        - Managed execution
      summary: Cancel a managed job
      description: >-
        Request cancellation for active child trials without rewriting completed
        results.
      operationId: cancelManagedJob
      parameters:
        - in: path
          name: user_id
          required: true
          schema:
            format: uuid
            title: User Id
            type: string
        - in: path
          name: job_id
          required: true
          schema:
            format: uuid
            title: Job Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HarborJobCancelRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HarborJobCancelResponse'
          description: Frozen cancellation outcome, including idempotent replay.
        '404':
          description: Harbor job not found in the active owner scope.
        '409':
          description: Job membership is incomplete or lifecycle-inconsistent.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - UserBearer: []
components:
  schemas:
    HarborJobCancelRequest:
      description: >-
        Owner request to atomically cancel cancellable members of one hosted
        job.
      properties:
        reason:
          default: user_requested
          maxLength: 512
          minLength: 1
          title: Reason
          type: string
      title: HarborJobCancelRequest
      type: object
    HarborJobCancelResponse:
      description: Frozen replayable result of one authoritative hosted-job cancellation.
      properties:
        already_terminal_trials:
          title: Already Terminal Trials
          type: integer
        cancelled_trials:
          title: Cancelled Trials
          type: integer
        conflict_trials:
          title: Conflict Trials
          type: integer
        intended_trials:
          title: Intended Trials
          type: integer
        job_id:
          format: uuid
          title: Job Id
          type: string
        propagation_pending:
          title: Propagation Pending
          type: integer
        reason:
          title: Reason
          type: string
        replayed:
          title: Replayed
          type: boolean
        requested_at:
          format: date-time
          title: Requested At
          type: string
      required:
        - job_id
        - reason
        - intended_trials
        - cancelled_trials
        - already_terminal_trials
        - conflict_trials
        - requested_at
        - replayed
        - propagation_pending
      title: HarborJobCancelResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    UserBearer:
      description: Synth customer access token for the current user and organization.
      scheme: bearer
      type: http

````

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