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

# Run API - Cancel

> Cancel a Run that has not finished yet. Runs that belong to a Job cannot be canceled here; terminate the JobRun instead.



## OpenAPI

````yaml post /{workspaceId}/projects/{projectName}/run/{runId}/cancel
openapi: 3.1.0
info:
  title: Intuned Client
  version: 0.0.2
  description: Programmatically trigger automations, manage Jobs, and handle AuthSessions.
  termsOfService: https://intuned.ai/terms
  contact:
    email: founders@intunedhq.com
servers:
  - url: https://app.intuned.io/api/v1/workspace
    description: Base URL for Intuned API.
security:
  - api_key: []
tags:
  - name: projects.jobs
    description: Project Jobs API
  - name: projects.jobs.runs
    description: Project JobRuns API
  - name: projects.runs
    description: Run APIs
  - name: projects.authSessions
    description: Manage AuthSessions
  - name: projects.authSessions.validate
    description: Validate AuthSession
  - name: projects.authSessions.create
    description: Create AuthSession
  - name: projects.authSessions.update
    description: Update AuthSession
  - name: webTasks
    description: Web Tasks API
  - name: agent
    description: Autonomous Intuned Agent sessions
externalDocs:
  description: Find out more about Intuned
  url: https://intunedhq.com/docs/
paths:
  /{workspaceId}/projects/{projectName}/run/{runId}/cancel:
    post:
      tags:
        - projects.runs
      summary: Run API - Cancel
      description: >-
        Cancel a Run that has not finished yet. Runs that belong to a Job cannot
        be canceled here; terminate the JobRun instead.
      operationId: runApiCancel
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          description: >-
            Your workspace ID. [How to find
            it](https://intunedhq.com/docs/main/03-how-to/manage/manage-workspace#how-to-get-your-workspace-id)?
          example: 123e4567-e89b-12d3-a456-426614174000
          in: path
          name: workspaceId
          x-speakeasy-globals-hidden: true
        - schema:
            type: string
          required: true
          description: The name you assigned when creating the Project.
          example: my-project
          in: path
          name: projectName
        - schema:
            format: nanoid
            type: string
          required: true
          description: Run ID
          example: aabbccddeeffggh
          in: path
          name: runId
      responses:
        '200':
          description: >-
            Run canceled successfully. Any pending Runs that depend on this Run
            are canceled with it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  runId:
                    type: string
                    description: Unique identifier for the run, prefixed nanoId (ru_...)
                  status:
                    type: string
                    enum:
                      - canceled
                    description: Status of the Run after cancellation.
                required:
                  - runId
                  - status
              example:
                runId: ru_abc123def456ghi789xyz
                status: canceled
        '400':
          description: >-
            Bad Request. Returned when the Run belongs to a JobRun, which must
            be terminated through the JobRun endpoint instead.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - bad-request
                    description: The request is invalid or malformed
                    externalDocs:
                      description: Find more info here
                      url: >-
                        https://intunedhq.com/docs/main/support/errors#bad-request
                  category:
                    type: string
                    enum:
                      - user
                    description: Errors caused by user actions or input
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#user
                  message:
                    type: string
                  retirable:
                    type: boolean
                    enum:
                      - false
                  details: {}
                  correlationId:
                    type: string
                required:
                  - code
                  - category
                  - message
                  - retirable
                  - correlationId
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                    description: The request requires user authentication
                    externalDocs:
                      description: Find more info here
                      url: >-
                        https://intunedhq.com/docs/main/support/errors#unauthorized
                  category:
                    type: string
                    enum:
                      - user
                    description: Errors caused by user actions or input
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#user
                  message:
                    type: string
                  retirable:
                    type: boolean
                    enum:
                      - false
                  details: {}
                  correlationId:
                    type: string
                required:
                  - code
                  - category
                  - message
                  - retirable
                  - correlationId
        '404':
          description: Not Found. The Run does not exist in this Project.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - not-found
                    description: The requested resource was not found
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#not-found
                  category:
                    type: string
                    enum:
                      - user
                    description: Errors caused by user actions or input
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#user
                  message:
                    type: string
                  retirable:
                    type: boolean
                    enum:
                      - false
                  details: {}
                  correlationId:
                    type: string
                required:
                  - code
                  - category
                  - message
                  - retirable
                  - correlationId
        '409':
          description: >-
            Conflict. The Run already finished and can no longer be canceled.
            This endpoint returns the legacy error body rather than the standard
            error envelope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable description of the conflict.
                    example: Cannot cancel a completed run
                  error:
                    type: string
                    enum:
                      - Conflict
                required:
                  - message
                  - error
components:
  securitySchemes:
    api_key:
      type: apiKey
      description: >-
        API Key used to authenticate your requests. [How to create
        one](/main/03-how-to/manage/manage-api-keys).
      in: header
      name: x-api-key

````