<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialSession/deleteCredential(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SecureElementCredential"
    ],
    "preciseIdentifier" : "s:23SecureElementCredential0C7SessionC06deleteC0yyAC0C0VYaKF"
  },
  "title" : "deleteCredential(_:)"
}
-->

# deleteCredential(_:)

Deletes a credential on the Secure Element.

```
func deleteCredential(_ credential: CredentialSession.Credential) async throws
```

## Parameters

`credential`

The credential to delete.

## Discussion

- The most common errors are:
  - [`CredentialSession.ErrorCode.invalidSessionState`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidSessionState): The session isn’t in the [`CredentialSession.State.management`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/management) state.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)