<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/DeliveredVerificationCodesManager/consumeOneTimeCode(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:31_AuthenticationServices_SwiftUI33DeliveredVerificationCodesManagerV18consumeOneTimeCodeyy0aB0014ASVerificationL0VYaKF"
  },
  "title" : "consumeOneTimeCode(_:)"
}
-->

# consumeOneTimeCode(_:)

Mark a one-time code as “consumed” by the current process.

```
@MainActor func consumeOneTimeCode(_ oneTimeCode: ASVerificationCode) async throws
```

## Parameters

`oneTimeCode`

The code to mark as consumed.

## Discussion

A code should only be marked as consumed if it was submitted to a service for the purposes of authentication.

Consuming a code will mark a code’s containing message as read in the Messages and Mail apps.
Depending on the user’s preference, this may also delete the code’s containing message.

> Throws: `DeliveredVerificationCodesManager.VerificationError` if the system failed to accept the update.

> Note: Only consume codes that you submit to a service. You should make a best effort to ensure it is accepted before calling this.

---

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)