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

# Cancel a job

> A queued job leaves the line and a running one is stopped; both then read as failed with JOB_CANCELLED. A finished job is removed from the server.



## OpenAPI

````yaml /openapi.json delete /v1/jobs/{id}
openapi: 3.1.0
info:
  title: bapsolver API
  version: 0.2.0
  description: >-
    Submit a token job for a page and its public reCAPTCHA v3 site key, then
    poll the job for the token.
servers:
  - url: https://api.bapsolver.xyz
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Jobs
    description: Create, read, list and cancel token jobs.
  - name: Service
    description: Service health.
paths:
  /v1/jobs/{id}:
    delete:
      tags:
        - Jobs
      summary: Cancel a job
      description: >-
        A queued job leaves the line and a running one is stopped; both then
        read as failed with JOB_CANCELLED. A finished job is removed from the
        server.
      operationId: cancelJob
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The job as it was left.
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
                description: >-
                  Server-generated correlation identifier; caller-supplied
                  identifiers are ignored.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    const: true
                  requestId:
                    type: string
                    format: uuid
                    description: >-
                      Server-generated correlation identifier; caller-supplied
                      identifiers are ignored.
                  data:
                    $ref: '#/components/schemas/Job'
                required:
                  - ok
                  - requestId
                  - data
                additionalProperties: false
              examples:
                cancelled:
                  value:
                    ok: true
                    requestId: 0f6c1d2e-8a4b-4c3d-9e1f-2a3b4c5d6e7f
                    data:
                      id: 3b1f7c9a-2d4e-4f6a-8b0c-1d2e3f4a5b6c
                      kind: recap_v3
                      url: https://www.example.com/login
                      siteKey: YOUR_SITE_KEY
                      action: login
                      status: failed
                      createdAt: '2026-10-25T09:30:00.000Z'
                      finishedAt: '2026-10-25T09:30:01.000Z'
                      error:
                        code: JOB_CANCELLED
                        message: The job was cancelled
        '400':
          description: >-
            Invalid request: an unknown field or kind, a wrong type, a proxy on
            a kind that takes none or missing on one that needs it, a bad URL or
            action.
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
                description: >-
                  Server-generated correlation identifier; caller-supplied
                  identifiers are ignored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Bearer credentials are missing or invalid.
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
                description: >-
                  Server-generated correlation identifier; caller-supplied
                  identifiers are ignored.
            WWW-Authenticate:
              schema:
                const: Bearer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No such job (it may have expired or been forgotten).
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
                description: >-
                  Server-generated correlation identifier; caller-supplied
                  identifiers are ignored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: The JSON request body exceeds 1 MiB.
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
                description: >-
                  Server-generated correlation identifier; caller-supplied
                  identifiers are ignored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: The request rate or the job queue limit was reached.
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
                description: >-
                  Server-generated correlation identifier; caller-supplied
                  identifiers are ignored.
            Retry-After:
              schema:
                type: integer
                minimum: 1
              description: Seconds before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Unexpected server failure.
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
                description: >-
                  Server-generated correlation identifier; caller-supplied
                  identifiers are ignored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Job:
      type: object
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - recap_v3
            - recap_v3_enterprise
            - recap_v3_proxy
            - recap_v3_enterprise_proxy
        url:
          type: string
        siteKey:
          type: string
        action:
          type: string
        status:
          type: string
          enum:
            - queued
            - running
            - done
            - failed
          description: >-
            Poll until done or failed (GET with ?wait=N holds the request until
            then). A token is good for about two minutes.
        createdAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
        finishedAt:
          type: string
          format: date-time
        result:
          type: object
          properties:
            token:
              type: string
              maxLength: 32768
            expiresAt:
              type:
                - string
                - 'null'
              format: date-time
              description: >-
                When the token stops being accepted: the validity the response
                gave, counted from the job start, so never later than the real
                moment.
            userAgent:
              type: string
              description: >-
                The user agent the token was made as: send it in each request to
                the site.
            acceptLanguage:
              type: string
              description: The Accept-Language the token was made with.
            secUa:
              type: string
              description: >-
                The sec-ch-ua header the token was made with; absent for a
                device that sends no client hints.
            secUaMobile:
              type: string
              description: The sec-ch-ua-mobile header; absent with secUa.
            secUaPlatform:
              type: string
              description: The sec-ch-ua-platform header; absent with secUa.
          required:
            - token
            - expiresAt
            - userAgent
            - acceptLanguage
          additionalProperties: false
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                A stable code: JOB_CANCELLED, JOB_TIMEOUT or SHUTTING_DOWN from
                the queue, else the code of the run that failed, such as
                SANDBOX_SOLVE_FAILED, UPSTREAM_TIMEOUT or
                PROTOCOL_EXECUTION_FAILED.
            message:
              type: string
          required:
            - code
            - message
          additionalProperties: false
      required:
        - id
        - kind
        - url
        - siteKey
        - action
        - status
        - createdAt
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        ok:
          const: false
        requestId:
          type: string
          format: uuid
          description: >-
            Server-generated correlation identifier; caller-supplied identifiers
            are ignored.
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
            message:
              type: string
              description: Human-readable explanation without credentials.
            details:
              type: object
          required:
            - code
            - message
          additionalProperties: false
      required:
        - ok
        - requestId
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API token. Send it on every /v1 request as `Authorization: Bearer
        <API_TOKEN>`.

````

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