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

# Cancel a tap intent with this tap

> For a tap page you host yourself: the person who tapped declines the tap intent, and Endstate sends `tap_intent.canceled`. Authorized by the tap session token alone. It takes no code. An approval cannot be canceled: the cancel is refused with `tap_intent.already_approved`, with `tap_intent.already_consumed` once it was consumed, or with `tap_intent.expired` once the approval lapsed.



## OpenAPI

````yaml /openapi.json post /v1/units/{unit_id}/tap-intents/{tap_intent_id}/cancel
openapi: 3.1.0
info:
  title: Endstate API
  version: 0.1.0
  description: Endstate developer API for chip verification and ownership workflows.
servers:
  - url: https://api2.endstate.io
    description: Production
  - url: https://api-staging.endstate.io
    description: Staging
security: []
paths:
  /v1/units/{unit_id}/tap-intents/{tap_intent_id}/cancel:
    post:
      tags:
        - Tap intents
      summary: Cancel a tap intent with this tap
      description: >-
        For a tap page you host yourself: the person who tapped declines the tap
        intent, and Endstate sends `tap_intent.canceled`. Authorized by the tap
        session token alone. It takes no code. An approval cannot be canceled:
        the cancel is refused with `tap_intent.already_approved`, with
        `tap_intent.already_consumed` once it was consumed, or with
        `tap_intent.expired` once the approval lapsed.
      operationId: cancelUnitTapIntent
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: unit_id
          in: path
        - schema:
            type: string
            pattern: ^tapi_[0-9a-f]{32}$
            example: tapi_3f9c1b7a2d4e4f60a1b2c3d4e5f60718
          required: true
          name: tap_intent_id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            example: {}
            schema:
              $ref: '#/components/schemas/CancelTapIntentWithTapRequest'
      responses:
        '200':
          description: The tap intent, canceled.
          content:
            application/json:
              example:
                id: tapi_3f9c1b7a2d4e4f60a1b2c3d4e5f60718
                status: canceled
                redirect_url: null
              schema:
                $ref: '#/components/schemas/TapIntentOutcome'
        '400':
          description: >-
            The request was malformed or failed validation.


            | Error code | When |

            | --- | --- |

            | `validation.failed` | The request failed schema validation. See
            `error.details` for per-field issues. |
          x-error-codes:
            - validation.failed
          content:
            application/json:
              examples:
                validation.failed:
                  summary: >-
                    The request failed schema validation. See `error.details`
                    for per-field issues.
                  value:
                    error:
                      code: validation.failed
                      message: >-
                        The request failed schema validation. See
                        `error.details` for per-field issues.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/validation-failed
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Authentication failed.


            | Error code | When |

            | --- | --- |

            | `auth.unauthorized` | Credential is missing or malformed. |

            | `session_token.invalid_or_expired` | The session token is unknown,
            expired, or has been revoked. |
          x-error-codes:
            - auth.unauthorized
            - session_token.invalid_or_expired
          content:
            application/json:
              examples:
                auth.unauthorized:
                  summary: Credential is missing or malformed.
                  value:
                    error:
                      code: auth.unauthorized
                      message: Credential is missing or malformed.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/auth-unauthorized
                session_token.invalid_or_expired:
                  summary: The session token is unknown, expired, or has been revoked.
                  value:
                    error:
                      code: session_token.invalid_or_expired
                      message: >-
                        The session token is unknown, expired, or has been
                        revoked.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: >-
                        https://docs.endstate.io/errors/session-token-invalid-or-expired
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Authenticated, but not permitted.


            | Error code | When |

            | --- | --- |

            | `auth.forbidden` | Credential is valid but does not have access to
            the requested resource or action. |

            | `session_token.wrong_chip` | The session token is bound to a
            different chip than the one in the request. |
          x-error-codes:
            - auth.forbidden
            - session_token.wrong_chip
          content:
            application/json:
              examples:
                auth.forbidden:
                  summary: >-
                    Credential is valid but does not have access to the
                    requested resource or action.
                  value:
                    error:
                      code: auth.forbidden
                      message: >-
                        Credential is valid but does not have access to the
                        requested resource or action.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/auth-forbidden
                session_token.wrong_chip:
                  summary: >-
                    The session token is bound to a different chip than the one
                    in the request.
                  value:
                    error:
                      code: session_token.wrong_chip
                      message: >-
                        The session token is bound to a different chip than the
                        one in the request.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/session-token-wrong-chip
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The resource does not exist within your organization.


            | Error code | When |

            | --- | --- |

            | `tap_intent.not_found` | No tap intent with that id exists for
            this credential's environment. |
          x-error-codes:
            - tap_intent.not_found
          content:
            application/json:
              examples:
                tap_intent.not_found:
                  summary: >-
                    No tap intent with that id exists for this credential's
                    environment.
                  value:
                    error:
                      code: tap_intent.not_found
                      message: >-
                        No tap intent with that id exists for this credential's
                        environment.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/tap-intent-not-found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The request conflicts with the resource's current state.


            | Error code | When |

            | --- | --- |

            | `tap_intent.already_approved` | The tap intent is already
            approved, by another tap or with another code. An approved tap
            intent cannot be canceled: consume it or let it lapse. |

            | `tap_intent.already_consumed` | The tap intent was already
            consumed by another request. `details.consumed_at` says when. Do not
            act on it; open a new tap intent if you still need an approval. |

            | `tap_intent.expired` | The tap intent expired: nobody approved it
            in time, or it was approved and not consumed by `use_by`. Open a new
            one. |

            | `tap_intent.tap_not_matched` | The tap cannot confirm this tap
            intent: it is not a tap of the unit made while the tap intent was
            open, or it is more than 10 minutes old. Tap the item again. |
          x-error-codes:
            - tap_intent.already_approved
            - tap_intent.already_consumed
            - tap_intent.expired
            - tap_intent.tap_not_matched
          content:
            application/json:
              examples:
                tap_intent.already_approved:
                  summary: >-
                    The tap intent is already approved, by another tap or with
                    another code. An approved tap intent cannot be canceled:
                    consume it or let it lapse.
                  value:
                    error:
                      code: tap_intent.already_approved
                      message: >-
                        The tap intent is already approved, by another tap or
                        with another code. An approved tap intent cannot be
                        canceled: consume it or let it lapse.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: >-
                        https://docs.endstate.io/errors/tap-intent-already-approved
                tap_intent.already_consumed:
                  summary: >-
                    The tap intent was already consumed by another request.
                    `details.consumed_at` says when. Do not act on it; open a
                    new tap intent if you still need an approval.
                  value:
                    error:
                      code: tap_intent.already_consumed
                      message: >-
                        The tap intent was already consumed by another request.
                        `details.consumed_at` says when. Do not act on it; open
                        a new tap intent if you still need an approval.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: >-
                        https://docs.endstate.io/errors/tap-intent-already-consumed
                tap_intent.expired:
                  summary: >-
                    The tap intent expired: nobody approved it in time, or it
                    was approved and not consumed by `use_by`. Open a new one.
                  value:
                    error:
                      code: tap_intent.expired
                      message: >-
                        The tap intent expired: nobody approved it in time, or
                        it was approved and not consumed by `use_by`. Open a new
                        one.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/tap-intent-expired
                tap_intent.tap_not_matched:
                  summary: >-
                    The tap cannot confirm this tap intent: it is not a tap of
                    the unit made while the tap intent was open, or it is more
                    than 10 minutes old. Tap the item again.
                  value:
                    error:
                      code: tap_intent.tap_not_matched
                      message: >-
                        The tap cannot confirm this tap intent: it is not a tap
                        of the unit made while the tap intent was open, or it is
                        more than 10 minutes old. Tap the item again.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: >-
                        https://docs.endstate.io/errors/tap-intent-tap-not-matched
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: |-
            Too many requests.

            | Error code | When |
            | --- | --- |
            | `rate_limit.exceeded` | Per-key rate limit exceeded. |
          x-error-codes:
            - rate_limit.exceeded
          content:
            application/json:
              examples:
                rate_limit.exceeded:
                  summary: Per-key rate limit exceeded.
                  value:
                    error:
                      code: rate_limit.exceeded
                      message: Per-key rate limit exceeded.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/rate-limit-exceeded
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: >-
            Something went wrong on our end.


            | Error code | When |

            | --- | --- |

            | `internal.error` | An unexpected server error occurred. Retry with
            exponential backoff and include `request_id` in any support request.
            |
          x-error-codes:
            - internal.error
          content:
            application/json:
              examples:
                internal.error:
                  summary: >-
                    An unexpected server error occurred. Retry with exponential
                    backoff and include `request_id` in any support request.
                  value:
                    error:
                      code: internal.error
                      message: >-
                        An unexpected server error occurred. Retry with
                        exponential backoff and include `request_id` in any
                        support request.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/internal-error
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            The service cannot do this right now. See the error code.


            | Error code | When |

            | --- | --- |

            | `tap_intent.busy` | The tap intent is being changed by another
            request. Retry. |
          x-error-codes:
            - tap_intent.busy
          content:
            application/json:
              examples:
                tap_intent.busy:
                  summary: The tap intent is being changed by another request. Retry.
                  value:
                    error:
                      code: tap_intent.busy
                      message: >-
                        The tap intent is being changed by another request.
                        Retry.
                      request_id: req_8e1a7f50-90ab-4cde-f012-3456789abcde
                      doc_url: https://docs.endstate.io/errors/tap-intent-busy
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - SessionTokenBearer: []
components:
  schemas:
    CancelTapIntentWithTapRequest:
      type: object
      properties: {}
      additionalProperties: false
    TapIntentOutcome:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - approved
            - canceled
        redirect_url:
          type:
            - string
            - 'null'
          description: >-
            Where to send the person after they confirm, with `tap_intent=<id>`
            added. Null after a cancel and when the tap intent has no redirect
            URL.
      required:
        - id
        - status
        - redirect_url
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              anyOf:
                - $ref: '#/components/schemas/ErrorCode'
                - type: string
              description: >-
                Stable, namespaced error code. The `ErrorCode` catalogue lists
                every code defined today; handle an unrecognized value as a
                generic failure rather than throwing, since codes are added over
                time.
              example: chip.not_found
            message:
              type: string
              description: >-
                Human-readable description, for logs and debugging. Wording may
                change without notice - never parse or match against it.
              example: Chip not found
            request_id:
              type: string
              description: >-
                Identifier for this request, matching the `X-Request-Id`
                response header. Log it and include it in any support request.
              example: req_8e1a7f50-90ab-4cde-f012-3456789abcde
            doc_url:
              type: string
              description: Documentation page for this error code.
              example: https://docs.endstate.io/errors/chip-not-found
            details:
              $ref: '#/components/schemas/ValidationErrorDetails'
          required:
            - code
            - message
            - request_id
            - doc_url
      required:
        - error
      description: >-
        Every error response, regardless of endpoint or HTTP status, uses this
        envelope.
    ErrorCode:
      type: string
      enum:
        - environment.conflict
        - environment.invalid_configuration
        - organization.changed
        - validation.failed
        - auth.unauthorized
        - auth.forbidden
        - session_token.invalid_or_expired
        - session_token.wrong_chip
        - wallet_session.invalid_or_expired
        - not_found.resource
        - rate_limit.exceeded
        - chip.not_found
        - chip.invalid_e_value
        - chip.already_scanned
        - quota.exceeded
        - chip.not_a_test_chip
        - unit.not_found
        - unit.already_exists
        - unit.not_minted
        - collection.not_found
        - collection.already_exists
        - collection.not_active
        - collection_backfill.blocked
        - organization.not_found
        - chip.already_paired
        - chip.key_unusable
        - chip.mac_required
        - chip.bulk_mixed_collections
        - chip.bulk_pending
        - unit.issuance_pending
        - claim.owner_unknown
        - claim.already_to_recipient
        - claim.in_progress
        - claim.locked
        - claim.unit_vaulted
        - claim.unit_held
        - claim.tap_required
        - claim.not_found
        - chip_replacement.locked
        - chip_replacement.in_progress
        - chip_replacement.not_found
        - transfer.owner_unknown
        - transfer.already_to_recipient
        - transfer.in_progress
        - transfer.not_found
        - submission.not_executable
        - vault.not_found
        - vault.already_exists
        - vault.provisioning_failed
        - vault.not_permitted
        - vault.unavailable
        - vault.challenge_invalid
        - vault.address_in_use
        - vault.key_conflict
        - vault.signer_unauthorized
        - vault_connection.not_found
        - vault_connection.not_active
        - vault_connection.already_exists
        - vault_connection.conflict
        - vault.in_progress
        - vault.owner_changed
        - vault.request_not_found
        - vault.request_not_pending
        - vault.consent_invalid
        - vault.consent_used
        - vault.consent_outdated
        - vault.request_rejected
        - vault.request_expired
        - vault.reference_taken
        - tap_intent.not_found
        - tap_intent.disabled
        - tap_intent.too_many_open
        - tap_intent.unit_vaulted
        - tap_intent.redirect_origin_not_allowed
        - tap_intent.expired
        - tap_intent.canceled
        - tap_intent.already_approved
        - tap_intent.already_consumed
        - tap_intent.not_approved
        - tap_intent.action_mismatch
        - tap_intent.tap_not_matched
        - tap_intent.code_required
        - tap_intent.code_incorrect
        - tap_intent.code_attempts_exhausted
        - tap_intent.code_unavailable
        - tap_intent.busy
        - idempotency.key_conflict
        - idempotency.in_progress
        - internal.error
        - webhook_endpoint.not_found
        - webhook_endpoint.deleted
        - webhook_endpoint.limit_reached
        - webhook_endpoint.url_refused
        - webhook_endpoint.signing_unavailable
        - webhook_event_type.unknown
        - webhook_event.not_found
        - webhook_endpoint.disabled
        - webhook_delivery.in_progress
        - webhook_endpoint.not_subscribed
      description: >-
        Stable, namespaced error code in `<resource>.<reason>` form. Branch on
        this rather than on `message` or the HTTP status. This is the catalogue
        as of this spec revision, not a closed set - see
        `ErrorResponse.error.code`.
      example: chip.not_found
    ValidationErrorDetails:
      type: object
      properties:
        formErrors:
          type: array
          items:
            type: string
          description: Issues that apply to the request as a whole rather than one field.
          example: []
        fieldErrors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation issues keyed by the field that failed.
          example:
            name:
              - 'Invalid input: expected string, received undefined'
      required:
        - formErrors
        - fieldErrors
      description: Per-field validation detail. Present only on `validation.failed`.
  securitySchemes:
    SessionTokenBearer:
      type: http
      scheme: bearer
      bearerFormat: end_sess
      description: >-
        Use `Authorization: Bearer end_sess_*` for V2 browser session tokens
        (e.g. `end_sess_ZW5kc3RhdGUtZXhhbXBsZS1zZXNzaW9uLXRva2VuAAA`).

````

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