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

# Delete PIX key

> Deletes a PIX key by its value through BACEN DICT (signed deleteEntry), then removes this service's own record of it, if it holds one. A key this service does not hold (for example one rebuilt by the participant's VSync) is still deleted at BACEN. A held key under claim is rejected with 409 SPI-3006 before BACEN is called. When a claim freezes the key while the BACEN deletion is in flight, BACEN has removed the entry but this service keeps its record for the claim flow and answers 409 SPI-3007. A BACEN refusal such as EntryBlocked (judicial block) is relayed with its own token and HTTP status, and nothing local changes. BACEN's own NotFound (the directory holds no entry for the key) is relayed the same way, as 404 with code NotFound; a 404 with code SPI-0010 is a not-found BACEN did not name.



## OpenAPI

````yaml /pt/openapi/v3-current/spi-dict.yaml delete /api/v1/dict/keys
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    OpenAPI 3.1 surface for the DICT (Diretório de Identificadores de Contas
    Transacionais) capability of Lerian SPI, the direct integration between the
    institution and the Brazilian Instant Payment System (SPI/Pix). It covers
    the PIX key lifecycle, portability and ownership claims, the MED 2.0 dispute
    surface (infraction reports, refunds, fraud markers, and funds recoveries),
    antifraud statistics, synchronous DICT reports, and the internal operations
    that keep the key directory consistent.
  license:
    name: Lerian Studio General License
  title: Lerian SPI — DICT API
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security: []
tags:
  - description: 'PIX key lifecycle: register, list, search, lookup, delete, and statistics.'
    name: Keys
  - description: >-
      PIX key portability and ownership claims through their full lifecycle
      (initiate, confirm, reject, cancel, acknowledge, complete).
    name: Claims
  - description: 'DICT infraction reports: list and retrieve.'
    name: Infractions
  - description: 'DICT refund requests: create, list, and retrieve.'
    name: Refunds
  - description: 'PIX fraud markers: create, list, and statistics.'
    name: Fraud Markers
  - description: >-
      Durable MED operation-intent status: the operationId every
      create/lifecycle-transition backlog route returns or references on every
      outcome, queryable independently of the business resource.
    name: Operations
  - description: >-
      Synchronous reports over Lerian SPI's own DICT record: COUNT(*) summaries
      of keys (by type/status) and claims (by type/status + open-past-deadline).
      COUNT-only — DICT holds no money.
    name: Reports
  - description: 'Internal DICT operations: claim deadline processing.'
    name: Internal
  - description: >-
      DICT synchronism checks transported to BACEN for the participant named in
      X-ISPB: sync verification, CID resolution and CID set events, projected
      verbatim.
    name: VSync
paths:
  /api/v1/dict/keys:
    delete:
      tags:
        - Keys
      summary: Delete PIX key
      description: >-
        Deletes a PIX key by its value through BACEN DICT (signed deleteEntry),
        then removes this service's own record of it, if it holds one. A key
        this service does not hold (for example one rebuilt by the participant's
        VSync) is still deleted at BACEN. A held key under claim is rejected
        with 409 SPI-3006 before BACEN is called. When a claim freezes the key
        while the BACEN deletion is in flight, BACEN has removed the entry but
        this service keeps its record for the claim flow and answers 409
        SPI-3007. A BACEN refusal such as EntryBlocked (judicial block) is
        relayed with its own token and HTTP status, and nothing local changes.
        BACEN's own NotFound (the directory holds no entry for the key) is
        relayed the same way, as 404 with code NotFound; a 404 with code
        SPI-0010 is a not-found BACEN did not name.
      operationId: deleteKey
      parameters:
        - description: Idempotency key, max 255 characters
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Idempotency key, max 255 characters
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteKeyRequest'
              description: >-
                PIX key value to delete; a held key is deletable only while
                ACTIVE
        required: true
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Bad Request
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    DeleteKeyRequest:
      additionalProperties: false
      properties:
        keyValue:
          description: >-
            PIX key value identifying the key to delete, in its canonical format
            for the key type. At most 77 characters, the ceiling BACEN publishes
            on a DICT key.
          examples:
            - '12345678901'
          maxLength: 77
          minLength: 1
          type: string
        participantISPB:
          description: >-
            ISPB of the participant the key is bound to. Must be the key's
            stored owning participant and a participant this deployment is
            authorized to act for; any other value is rejected.
          examples:
            - '12345678'
          pattern: ^[0-9A-Z]{8}$
          type: string
        reason:
          description: >-
            Deletion reason reported to BACEN, defaulting to USER_REQUESTED; the
            enum is the set deleteEntry accepts. FRAUD and RFB_VALIDATION are
            MANDATED by DICT 8.4 section 4.1 for a removal forced by
            incompatibility with the Receita Federal registry — FRAUD when the
            name divergence or the irregular CPF/CNPJ is fraud, RFB_VALIDATION
            in the other cases. ACCOUNT_CLOSURE, RECONCILIATION, FRAUD and
            RFB_VALIDATION are participant-initiated (sections 4.4/4.5): no end
            user asks, so requesterTaxId is not demanded for them.
          enum:
            - USER_REQUESTED
            - ACCOUNT_CLOSURE
            - RECONCILIATION
            - FRAUD
            - RFB_VALIDATION
          examples:
            - USER_REQUESTED
          type: string
        requesterTaxId:
          description: >-
            CPF or CNPJ of the END USER asking for the removal. MANDATORY when
            reason is USER_REQUESTED (the default): DICT 8.4 section 4.2 obliges
            the PSP to check that the user requesting the exclusão is the user
            the key is bound to. Omitted for the PSP-initiated reasons —
            ACCOUNT_CLOSURE, RECONCILIATION, FRAUD, RFB_VALIDATION — where no
            end user is asking; supplied on any of them it is still compared
            against the stored owner. A value that does not match the stored
            owner is refused with the same answer as an unauthorized
            participant, so this route cannot be used to discover who owns a
            key.
          examples:
            - '12345678901'
          type: string
      required:
        - keyValue
        - participantISPB
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        correlationId:
          description: Request-scoped correlation identifier echoing X-Request-ID.
          examples:
            - req-7a3f9c2e
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      required:
        - correlationId
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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