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

# Cancel One Platform Job

> Stop one queued or retrying platform job without removing completed posts from the same batch.

Use this endpoint when one destination in a multi-platform post is still queued or retrying but other destinations have already published.

For example, if Instagram and TikTok completed but YouTube is waiting to retry, cancel the YouTube job ID to stop only that upload. The completed Instagram and TikTok posts stay unchanged.

<Note>
  A failed job is already terminal and cannot be cancelled. Use `GET /api/v1/jobs/{id}` to read its saved failure. To delete an entire grouped post before any destination starts publishing, use `DELETE /api/v1/posts/{id}`.
</Note>


## OpenAPI

````yaml POST /api/v1/jobs/{id}/cancel
openapi: 3.0.3
info:
  title: Mallary API
  version: 1.6.0
  description: >
    Public API for multi-platform publishing, analytics, media upload, and
    webhooks.


    Authentication:

    - Use header `Authorization: Bearer {api_key}`.

    - API key identity is authoritative. Do not use `user_id` to identify a
    caller.


    Connection profiles:

    - Omit `profile_id` to use the authenticated user's default profile.

    - Send the profile's random public `profile_id` when you want to publish,
    list posts, read post analytics or audience counts, list platforms, update
    settings, or disconnect a platform for a non-default profile.

    - Use `GET /api/v1/profiles` to list profile IDs.

    - Per-platform account caps by plan: Free 1, Starter 4, Pro 10, Business 50.


    Rate limits (per user, per minute) depend on subscription plan:

    - plan_id 1: 75 req/min

    - plan_id 2: 150 req/min

    - plan_id 3: 750 req/min

    - plan_id 4: 1500 req/min
servers:
  - url: https://mallary.ai
    description: Production
security:
  - bearerAuth: []
externalDocs:
  description: Full product docs
  url: https://docs.mallary.ai/
paths:
  /api/v1/jobs/{id}/cancel:
    post:
      summary: Cancel one queued platform job
      description: >-
        Cancels only the selected queued or retrying platform job. Other jobs in
        the same multi-platform batch, including completed posts, are preserved.
        Failed jobs are already terminal and remain failed for accurate history.
      operationId: cancelJob
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: Job ID returned by `POST /api/v1/post`.
      responses:
        '200':
          description: >-
            The selected job is cancelled and remains available through `GET
            /api/v1/jobs/{id}`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelJobResponse'
        '400':
          description: Invalid job ID
        '401':
          description: Missing or invalid API key
        '404':
          description: Job not found
        '409':
          description: >-
            The selected platform job is processing, completed, failed, or
            otherwise no longer cancelable
components:
  schemas:
    CancelJobResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - ok
        data:
          type: object
          properties:
            job_id:
              type: integer
            batch_id:
              type: string
              nullable: true
            platform:
              $ref: '#/components/schemas/Platform'
            previous_status:
              type: string
            status:
              type: string
              enum:
                - cancelled
            completed_job_ids_preserved:
              type: array
              items:
                type: integer
    Platform:
      type: string
      description: Supported publishing platform identifier.
      enum:
        - twitter
        - x
        - facebook
        - instagram
        - linkedin
        - youtube
        - tiktok
        - pinterest
        - reddit
        - threads
        - bluesky
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Use `Authorization: Bearer {api_key}`'

````

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