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

# Cancel a retained homology search

> Idempotently cancels a queued or running retained search. Succeeded and failed searches are immutable and return 409; expired searches return 410.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/homology/searches/{homology_search_id}/cancel
openapi: 3.1.0
info:
  description: >-
    Deterministic biological evidence primitives with typed resource, list, and
    error responses. Each operation documents its own response shape,
    provenance, warnings, and transport headers.
  title: Rafflesia API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.rafflesia.ai
security:
  - bearerAuth: []
paths:
  /v1/homology/searches/{homology_search_id}/cancel:
    post:
      tags:
        - Homology
      summary: Cancel a retained homology search
      description: >-
        Idempotently cancels a queued or running retained search. Succeeded and
        failed searches are immutable and return 409; expired searches return
        410.
      operationId: homology_searches_cancel
      parameters:
        - in: path
          name: homology_search_id
          required: true
          schema:
            type: string
        - description: >-
            Optional dated contract pin. Omit to use the current 2026-08-08
            homology contract.
          in: header
          name: Rafflesia-API-Version
          schema:
            description: >-
              Optional dated contract pin. Omit to use the current 2026-08-08
              homology contract.
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: OK
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Bad Request
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Unauthorized
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Payment Required
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Forbidden
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Not Found
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Conflict
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Gone
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Unprocessable Entity
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Too Many Requests
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            RateLimit:
              description: Remaining request capacity and reset interval for this refusal.
              schema:
                type: string
            RateLimit-Policy:
              description: Effective organization request-rate policy for this refusal.
              schema:
                type: string
            Retry-After:
              description: Whole seconds to wait before retrying this query.
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Internal Server Error
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Service Unavailable
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeHomologySearch'
          description: Gateway Timeout
          headers:
            Rafflesia-API-Version:
              schema:
                enum:
                  - '2026-08-08'
                type: string
            Rafflesia-Contract-Digest:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
      x-codeSamples:
        - lang: bash
          source: |
            curl --request POST \
              --url "https://api.rafflesia.ai/v1/homology/searches/{homology_search_id}/cancel" \
              --header "Authorization: Bearer $RAFFLESIA_API_KEY"
components:
  schemas:
    EnvelopeHomologySearch:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/EnvelopeHomologySearch.json
          format: uri
          readOnly: true
          type: string
        data:
          $ref: '#/components/schemas/HomologySearch'
          description: Operation result data. Absent when the operation did not succeed.
        error:
          $ref: '#/components/schemas/APIError'
          description: Structured error information.
        evidence:
          $ref: '#/components/schemas/EvidenceSummary'
          description: Mechanical evidence summary for agent inspection and chaining.
        ok:
          description: Whether the operation succeeded.
          type: boolean
        provenance:
          $ref: '#/components/schemas/Provenance'
          description: Execution provenance.
        warnings:
          description: Non-fatal warnings.
          items:
            $ref: '#/components/schemas/Warning'
          type:
            - array
            - 'null'
      required:
        - ok
        - warnings
        - provenance
      type: object
    HomologySearch:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          type: string
        expires_at:
          description: >-
            RFC 3339 instant after which the retained search and its cursors
            return 410 Gone.
          format: date-time
          type: string
        failure:
          $ref: '#/components/schemas/HomologyFailure'
        id:
          pattern: ^hsrch_[0-9a-f]{64}$
          type: string
        idempotency_key_expires_at:
          description: >-
            RFC 3339 instant through which the create idempotency key is
            guaranteed to replay the original request.
          format: date-time
          type: string
        object:
          enum:
            - homology_search
          type: string
        query:
          $ref: '#/components/schemas/HomologySearchQuerySummary'
        receipt:
          $ref: '#/components/schemas/HomologySearchReceipt'
        result_set:
          $ref: '#/components/schemas/HomologySearchResultSet'
        results:
          $ref: '#/components/schemas/HomologySearchResultsRequest'
        retention_class:
          description: Public retained-resource lifecycle applied to this search.
          enum:
            - standard_30d
          type: string
        specification_sha256:
          type: string
        status:
          enum:
            - queued
            - running
            - succeeded
            - failed
            - canceled
          type: string
        target_space:
          $ref: '#/components/schemas/HomologySearchTargetSpace'
          description: >-
            Authoritative searched target population. For filtered async
            searches this is absent until Tomato has compiled immutable
            eligibility.
        warnings:
          items:
            $ref: '#/components/schemas/Warning'
          type:
            - array
            - 'null'
      required:
        - id
        - object
        - created_at
        - expires_at
        - retention_class
        - idempotency_key_expires_at
        - status
        - query
        - results
        - specification_sha256
        - receipt
        - warnings
      type: object
    APIError:
      additionalProperties: false
      properties:
        code:
          description: Stable specific error code.
          type: string
        details:
          additionalProperties: {}
          description: Additional structured error details.
          type: object
        doc_url:
          description: Stable documentation URL for this error code.
          type: string
        message:
          description: Human-readable error message.
          type: string
        param:
          description: Request field responsible for the error when known.
          type: string
        type:
          description: Stable coarse error category.
          enum:
            - invalid_request_error
            - resource_missing
            - resource_expired
            - conflict_error
            - rate_limit_error
            - authentication_error
            - permission_error
            - billing_error
            - api_error
          type: string
      required:
        - type
        - code
        - message
        - doc_url
      type: object
    EvidenceSummary:
      additionalProperties: false
      properties:
        duration_ms:
          description: >-
            Primary elapsed duration in milliseconds when the response exposes
            one.
          format: int64
          type: integer
        input_refs:
          description: >-
            Input references detected from request fields such as object_id,
            structure_id, target_id, and sequence_id.
          items:
            type: string
          type:
            - array
            - 'null'
        object_refs:
          description: Object ids or object refs visible in the response/provenance.
          items:
            type: string
          type:
            - array
            - 'null'
        output_refs:
          description: Output references detected from response data and generated objects.
          items:
            type: string
          type:
            - array
            - 'null'
        row_count:
          description: >-
            Primary row count or returned row count when the response exposes
            one.
          format: int64
          type: integer
        warnings_count:
          description: Number of non-fatal warnings in the envelope.
          format: int64
          type: integer
      required:
        - warnings_count
      type: object
    Provenance:
      additionalProperties: false
      properties:
        cache_hit:
          description: Whether cached output was reused.
          type: boolean
        created_at:
          description: UTC timestamp.
          type: string
        database_snapshots:
          description: Database snapshots used.
          items:
            $ref: '#/components/schemas/DatabaseSnapshot'
          type:
            - array
            - 'null'
        generated_object_ids:
          description: Object ids created by the operation.
          items:
            type: string
          type:
            - array
            - 'null'
        input_hash:
          description: SHA-256 hash of canonical request input.
          type: string
        operation:
          description: Primitive operation id.
          type: string
        parameters_hash:
          description: SHA-256 hash of parameters.
          type: string
        request_id:
          description: Unique request identifier.
          type: string
        server_version:
          description: Server version.
          type: string
        tool_versions:
          description: Tool versions used.
          items:
            $ref: '#/components/schemas/ToolVersion'
          type:
            - array
            - 'null'
      required:
        - request_id
        - operation
        - created_at
        - server_version
      type: object
    Warning:
      additionalProperties: false
      properties:
        code:
          description: Stable warning code.
          type: string
        details:
          additionalProperties: {}
          description: Additional structured warning details.
          type: object
        message:
          description: Human-readable warning message.
          type: string
      required:
        - code
        - message
      type: object
    HomologyFailure:
      additionalProperties: false
      properties:
        code:
          type: string
        detail:
          type: string
        is_retryable:
          type: boolean
      required:
        - code
        - detail
        - is_retryable
      type: object
    HomologySearchQuerySummary:
      additionalProperties: false
      properties:
        kind:
          enum:
            - protein_sequence
          type: string
        normalization_id:
          minLength: 1
          type: string
        normalized_length:
          format: int64
          maximum: 100000
          minimum: 1
          type: integer
        retention:
          type: string
        sha256:
          pattern: ^sha256:[0-9a-f]{64}$
          type: string
      required:
        - kind
        - normalized_length
        - normalization_id
        - sha256
        - retention
      type: object
    HomologySearchReceipt:
      additionalProperties: false
      properties:
        calibration_id:
          type: string
        canonical_filter_sha256:
          type: string
        corpus_snapshot_id:
          type: string
        database_release_id:
          type: string
        database_residue_count:
          format: int64
          minimum: 0
          type: integer
        database_target_count:
          format: int64
          minimum: 0
          type: integer
        engine:
          type: string
        engine_release:
          type: string
        execution_warnings:
          items:
            type: string
          type:
            - array
            - 'null'
        filter_schema_id:
          type: string
        is_deterministic:
          type: boolean
        is_exhaustive:
          type: boolean
        is_policy_complete:
          type: boolean
        outcome:
          enum:
            - complete_exact
            - complete_for_policy
          type: string
        outcome_receipt_bytes:
          format: int64
          minimum: 0
          type: integer
        outcome_receipt_id:
          type: string
        outcome_receipt_sha256:
          type: string
        result_sha256:
          type: string
        searched_residue_count:
          format: int64
          minimum: 0
          type: integer
        searched_target_count:
          format: int64
          minimum: 0
          type: integer
        semantic_profile_id:
          type: string
        target_space_id:
          type: string
        usage:
          $ref: '#/components/schemas/HomologySearchReceiptUsage'
        work:
          $ref: '#/components/schemas/HomologySearchReceiptWork'
      required:
        - engine
        - database_release_id
        - corpus_snapshot_id
        - semantic_profile_id
        - execution_warnings
        - is_policy_complete
        - is_exhaustive
        - is_deterministic
      type: object
    HomologySearchResultSet:
      additionalProperties: false
      properties:
        canonical_result_id:
          pattern: ^[a-z][a-z0-9_]*_[0-9a-f]{64}$
          type: string
        count:
          format: int64
          type: integer
        expires_at:
          description: >-
            RFC 3339 instant after which this immutable result set is no longer
            retrievable through the retained-search API.
          format: date-time
          type: string
        is_result_limit_reached:
          type: boolean
        object:
          type: string
        sha256:
          type: string
        url:
          type: string
      required:
        - object
        - url
        - count
        - sha256
        - canonical_result_id
        - is_result_limit_reached
        - expires_at
      type: object
    HomologySearchResultsRequest:
      additionalProperties: false
      properties:
        evidence:
          enum:
            - candidate_measurement
            - pairwise_sequence_alignment
          type: string
        limit:
          format: int64
          maximum: 10000
          minimum: 1
          type: integer
        significance:
          enum:
            - not_requested
            - if_available
            - required
          type: string
      required:
        - evidence
        - limit
        - significance
      type: object
    HomologySearchTargetSpace:
      additionalProperties: false
      properties:
        canonical_filter_sha256:
          type: string
        eligible_record_count:
          format: int64
          type: integer
        eligible_residue_count:
          format: int64
          type: integer
        filter_schema_id:
          type: string
        id:
          description: Opaque immutable identity of the exact target population searched.
          type: string
        is_filtered:
          type: boolean
        total_record_count:
          format: int64
          type: integer
        unknown_record_count:
          format: int64
          type: integer
      required:
        - id
        - is_filtered
        - total_record_count
        - eligible_record_count
        - eligible_residue_count
        - unknown_record_count
      type: object
    DatabaseSnapshot:
      additionalProperties: false
      properties:
        digest:
          type: string
        kind:
          type: string
        name:
          type: string
        version:
          type: string
      required:
        - name
        - version
      type: object
    ToolVersion:
      additionalProperties: false
      properties:
        name:
          type: string
        path:
          type: string
        version:
          type: string
      required:
        - name
        - version
      type: object
    HomologySearchReceiptUsage:
      additionalProperties: false
      properties:
        billable_formula_id:
          type: string
        billable_units:
          format: int64
          minimum: 0
          type: integer
        logical_bytes_read:
          format: int64
          minimum: 0
          type: integer
        logical_bytes_returned:
          format: int64
          minimum: 0
          type: integer
        object_reads:
          format: int64
          minimum: 0
          type: integer
        query_pack_bytes:
          format: int64
          minimum: 0
          type: integer
      required:
        - logical_bytes_returned
      type: object
    HomologySearchReceiptWork:
      additionalProperties: false
      properties:
        affine_cells:
          format: int64
          minimum: 0
          type: integer
        affine_pairs:
          format: int64
          minimum: 0
          type: integer
        candidate_pairs:
          format: int64
          minimum: 0
          type: integer
        maxsim_residue_pairs:
          format: int64
          minimum: 0
          type: integer
        returned_result_count:
          format: int64
          minimum: 0
          type: integer
        traceback_pairs:
          format: int64
          minimum: 0
          type: integer
      required:
        - returned_result_count
      type: object
  securitySchemes:
    bearerAuth:
      description: 'A Rafflesia API key, sent as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http

````