---
updatedAt: 2026-04-23T18:12:51.000Z
agentTools:
  siteIndex: https://developers.pismo.io/llms.txt
  projectIndex: https://developers.pismo.io/pismo-docs/llms.txt
---

# Delete key

Deletes a user DICT key entry.

On PSP timeout, a `202 Accepted` response is returned and the process continues asynchronously, eventually emitting a success or error event.

This endpoint generates a <a href="https://developers.pismo.io/events/docs/pix-dict-key-status-change-1" >Pix key status changed</a> event.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Instant payments - Pix management",
    "description": "API responsible for providing Pix operations (related to DICT) via integrating with external providers",
    "contact": {
      "name": "API Support",
      "url": "https://developers.pismo.io/support/"
    },
    "license": {
      "name": "Copyright Pismo"
    },
    "version": "0.0.1"
  },
  "servers": [
    {
      "url": "https://sandbox.pismolabs.io/pix-dict",
      "description": "Sandbox API server for testing."
    }
  ],
  "tags": [
    {
      "name": "Keys",
      "description": "Manage DICT keys endpoints"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "parameters": {
      "AuthHeader": {
        "in": "header",
        "name": "Authorization",
        "required": true,
        "description": "Account token - token encoded with a Pismo account ID. Tokens can expire quickly, which can result in a <b>401 Unauthorized</b> message.",
        "schema": {
          "type": "string",
          "example": "Bearer eyJhbGci...IUzUx"
        }
      },
      "IdempotencyKeyHeader": {
        "name": "Idempotency-Key",
        "in": "header",
        "description": "A unique UUID identifier to ensure the operation remains idempotent, allowing for operation repitition without causing unintended effects or duplication. An idempotent operation is one that can be applied multiple times, yet the outcome remains the same. it ensures that network errors, retries, or failures can occur without introducing inconsistencies.\n",
        "required": true,
        "schema": {
          "type": "string"
        },
        "example": "550e8400-e29b-41d4-a716-446655440000"
      }
    },
    "headers": {
      "XCidResponseHeader": {
        "description": "Request tracking identifier.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "DeleteReason": {
        "type": "string",
        "description": "Delete key reason for request.",
        "example": "USER_REQUESTED",
        "enum": [
          "USER_REQUESTED",
          "ACCOUNT_CLOSURE",
          "RECONCILIATION",
          "FRAUD",
          "RFB_VALIDATION"
        ]
      },
      "Key": {
        "type": "string",
        "description": "Value, based on a key's type, used to encrypt Pix key.",
        "maxLength": 77,
        "example": "al_fresco@bourdain.com"
      },
      "KeyType": {
        "type": "string",
        "description": "User information that can be used to create a Pix key:\n* `CPF` - Cadastro de Pessoas Fisicas (Indiviual Taxpayer Registry) number. Similar to a Social Security number in the US. \n* `CNPJ` - Cadastro Nacional de Pessoa Juridica (National Registry of Legal Entities) number. Unique ID for legal entities, such as companies and organizations, in Brazil\n* `EMAIL` - Email \n* `PHONE` - Phone number\n* `EVP` - Endereco de pagamento virtual (virtual payment address). A randomly-generated UUID number.\n",
        "enum": [
          "CPF",
          "CNPJ",
          "PHONE",
          "EMAIL",
          "EVP"
        ],
        "example": "EMAIL"
      },
      "message.DetailMessage": {
        "type": "object",
        "properties": {
          "external": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/message.ExternalMessage"
            }
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/message.ParameterMessage"
            }
          },
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/message.PayloadMessage"
            }
          }
        }
      },
      "message.ExternalMessage": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "example": "PBE315"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "Generic error"
          }
        }
      },
      "message.Message": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "example": "EPDA0001"
          },
          "details": {
            "$ref": "#/components/schemas/message.DetailMessage"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "User not found"
          }
        }
      },
      "message.ParameterMessage": {
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Parameter in error",
            "example": "query parameter"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "Generic error"
          }
        }
      },
      "message.PayloadMessage": {
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Field in error",
            "example": "Entity.field"
          },
          "message": {
            "type": "string",
            "description": "Error messsage",
            "example": "Generic error"
          }
        }
      },
      "presenter.DeleteRequest": {
        "type": "object",
        "required": [
          "key",
          "key_type",
          "reason"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "key_type": {
            "$ref": "#/components/schemas/KeyType"
          },
          "reason": {
            "$ref": "#/components/schemas/DeleteReason"
          }
        }
      }
    },
    "responses": {
      "202Accepted": {
        "description": "Accepted",
        "headers": {
          "x-cid": {
            "$ref": "#/components/headers/XCidResponseHeader"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/message.Message"
            },
            "examples": {
              "Request accepted and will processed async": {
                "value": {
                  "code": "EPDA0169",
                  "message": "Request was accepted and gonna be processed asynchronously"
                }
              }
            }
          }
        }
      },
      "401Unauthorized": {
        "description": "Unauthorized",
        "headers": {
          "x-cid": {
            "$ref": "#/components/headers/XCidResponseHeader"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/message.Message"
            },
            "examples": {
              "Provider service error": {
                "value": {
                  "code": "EPDG0013",
                  "message": "Unauthorized access to the provider service"
                }
              }
            }
          }
        }
      },
      "403Forbidden": {
        "description": "Forbidden",
        "headers": {
          "x-cid": {
            "$ref": "#/components/headers/XCidResponseHeader"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/message.Message"
            },
            "examples": {
              "EPDA0009": {
                "summary": "Missing required header 'x-tenant'",
                "value": {
                  "code": "EPDA0009",
                  "message": "Missing required header 'x-tenant'"
                }
              },
              "EPDA0010": {
                "summary": "Missing required header 'x-account-id'",
                "value": {
                  "code": "EPDA0010",
                  "message": "Missing required header 'x-account-id'"
                }
              },
              "EPDA0152": {
                "summary": "Missing required param 'id'",
                "value": {
                  "code": "EPDA0152",
                  "message": "Missing required param 'id'"
                }
              }
            }
          }
        }
      },
      "429TooManyRequests": {
        "description": "Too many requests",
        "headers": {
          "x-cid": {
            "$ref": "#/components/headers/XCidResponseHeader"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/message.Message"
            }
          }
        }
      },
      "502BadGateway": {
        "description": "Bad Gateway",
        "headers": {
          "x-cid": {
            "$ref": "#/components/headers/XCidResponseHeader"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/message.Message"
            },
            "examples": {
              "Provider authentication service error": {
                "value": {
                  "code": "EPDG0020",
                  "message": "Provider authentication service is unable to complete the request"
                }
              }
            }
          }
        }
      },
      "504GatewayTimeout2": {
        "description": "Gateway Timeout",
        "headers": {
          "x-cid": {
            "$ref": "#/components/headers/XCidResponseHeader"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/message.Message"
            },
            "examples": {
              "Service timeout": {
                "value": {
                  "code": "EPDA0000",
                  "message": "Timeout while executing the request"
                }
              },
              "Provider timeout": {
                "value": {
                  "code": "EPDG0000",
                  "message": "Timeout while executing the request"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  },
  "paths": {
    "/v2/pix/keys/delete": {
      "post": {
        "summary": "Delete key",
        "description": "Deletes a user DICT key entry.\n\nOn PSP timeout, a `202 Accepted` response is returned and the process continues asynchronously, eventually emitting a success or error event.\n\nThis endpoint generates a <a href=\"https://developers.pismo.io/events/docs/pix-dict-key-status-change-1\" >Pix key status changed</a> event.\n",
        "operationId": "post-v2-pix-keys-delete",
        "tags": [
          "Keys"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AuthHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "requestBody": {
          "description": "Delete the key.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/presenter.DeleteRequest"
              },
              "examples": {
                "CPF Key Exclusion": {
                  "value": {
                    "key": "97361452043",
                    "key_type": "CPF",
                    "reason": "USER_REQUESTED"
                  }
                },
                "CNPJ Key Exclusion": {
                  "value": {
                    "key": "73901114000186",
                    "key_type": "CNPJ",
                    "reason": "USER_REQUESTED"
                  }
                },
                "Email Key Exclusion": {
                  "value": {
                    "key": "email@email.com",
                    "key_type": "EMAIL",
                    "reason": "USER_REQUESTED"
                  }
                },
                "Phone Key Exclusion": {
                  "value": {
                    "key": "+5511987654321",
                    "key_type": "PHONE",
                    "reason": "USER_REQUESTED"
                  }
                },
                "EVP Key Exclusion": {
                  "value": {
                    "key": "8d33a43c-0d22-4974-9652-30c80f2d6b0e",
                    "key_type": "EVP",
                    "reason": "USER_REQUESTED"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/202Accepted"
          },
          "204": {
            "description": "No Content",
            "headers": {
              "x-cid": {
                "$ref": "#/components/headers/XCidResponseHeader"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "x-cid": {
                "$ref": "#/components/headers/XCidResponseHeader"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/message.Message"
                },
                "examples": {
                  "Invalid binding": {
                    "value": {
                      "code": "EPDA0002",
                      "message": "Failed to unmarshal request body"
                    }
                  },
                  "Validate errors": {
                    "value": {
                      "code": "EPDA0003",
                      "message": "There are invalid fields when trying to validate request body",
                      "details": {
                        "payload": [
                          {
                            "field": "DeleteKeyRequest.reason",
                            "message": "Field validation for 'reason' failed on the 'oneof' tag"
                          }
                        ]
                      }
                    }
                  },
                  "Invalid key type": {
                    "value": {
                      "code": "EPDA0038",
                      "message": "Invalid key type"
                    }
                  },
                  "Invalid CPF Key": {
                    "value": {
                      "code": "EPDA0039",
                      "message": "Invalid CPF"
                    }
                  },
                  "Invalid CNPJ Key": {
                    "value": {
                      "code": "EPDA0040",
                      "message": "Invalid CNPJ"
                    }
                  },
                  "Invalid Email Key": {
                    "value": {
                      "code": "EPDA0042",
                      "message": "Invalid EMAIL"
                    }
                  },
                  "Invalid Phone Key": {
                    "value": {
                      "code": "EPDA0041",
                      "message": "Invalid PHONE"
                    }
                  },
                  "Invalid EVP Key": {
                    "value": {
                      "code": "EPDA0043",
                      "message": "Invalid EVP"
                    }
                  },
                  "Missing tenant header": {
                    "value": {
                      "code": "EPDG0001",
                      "message": "Missing x-tenant header"
                    }
                  },
                  "Provider service error request": {
                    "value": {
                      "code": "EPDG0011",
                      "message": "Bad request while accessing the provider service",
                      "details": {
                        "external": [
                          {
                            "code": "PBE353",
                            "message": "Entity not found"
                          }
                        ]
                      }
                    }
                  },
                  "Invalid provider service response": {
                    "value": {
                      "code": "EPDG0018",
                      "message": "Provider service returned a status {http_status} which was not expected"
                    }
                  },
                  "Provider authentication service error request": {
                    "value": {
                      "code": "EPDG0019",
                      "message": "Provider authentication service rejected request due to a client payload misconfiguration"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "x-cid": {
                "$ref": "#/components/headers/XCidResponseHeader"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/message.Message"
                },
                "examples": {
                  "Account not found": {
                    "value": {
                      "code": "EPDA0024",
                      "message": "Account not found for ID {account_id}"
                    }
                  },
                  "Key not found": {
                    "value": {
                      "code": "EPDA0026",
                      "message": "Key not found"
                    }
                  },
                  "Provider service error": {
                    "value": {
                      "code": "EPDG0014",
                      "message": "Resource not found on the provider service",
                      "details": {
                        "external": [
                          {
                            "code": "PBE353",
                            "message": "Entity not found"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "x-cid": {
                "$ref": "#/components/headers/XCidResponseHeader"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/message.Message"
                },
                "examples": {
                  "Key has open claim": {
                    "value": {
                      "code": "EPDA0027",
                      "message": "Key has open claim"
                    }
                  },
                  "Invalid account ID (User requested reason only)": {
                    "value": {
                      "code": "EPDA0028",
                      "message": "Account status blocked or cancelled"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/429TooManyRequests"
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "x-cid": {
                "$ref": "#/components/headers/XCidResponseHeader"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/message.Message"
                },
                "examples": {
                  "Provider service communication error": {
                    "value": {
                      "code": "EPDA0029",
                      "message": "Internal errors while attempting to communicate with the provider service"
                    }
                  },
                  "Invalid client error": {
                    "value": {
                      "code": "EPDG0005",
                      "message": "Invalid Pix provider '{provider_name}'"
                    }
                  },
                  "Failed marshalling object": {
                    "value": {
                      "code": "EPDG0006",
                      "message": "Failed to marshal JSON object"
                    }
                  },
                  "Failed unmarshalling object": {
                    "value": {
                      "code": "EPDG0007",
                      "message": "Failed to unmarshal JSON object"
                    }
                  },
                  "Error reading response data": {
                    "value": {
                      "code": "EPDG0010",
                      "message": "I/O error while reading response data: '{details}'"
                    }
                  },
                  "Provider service error": {
                    "value": {
                      "code": "EPDG0016",
                      "message": "Provider service returned an internal error while trying to access the resource",
                      "details": {
                        "external": [
                          {
                            "code": "PBE315",
                            "message": "Generic error"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/502BadGateway"
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "x-cid": {
                "$ref": "#/components/headers/XCidResponseHeader"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/message.Message"
                },
                "examples": {
                  "Provider service unavailable": {
                    "value": {
                      "code": "EPDG0017",
                      "message": "Provider service resource is unavailable"
                    }
                  },
                  "Provider authentication service unavailable": {
                    "value": {
                      "code": "EPDG0021",
                      "message": "Provider authentication service is unavailable"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "$ref": "#/components/responses/504GatewayTimeout2"
          }
        }
      }
    }
  }
}
```