---
title: "consumeOneTimeCode(_:)"
framework: authenticationservices
role: symbol
role_heading: Instance Method
path: "authenticationservices/asdeliveredverificationcodesmanager/consumeonetimecode(_:)"
---

# consumeOneTimeCode(_:)

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

## Declaration

```swift
func consumeOneTimeCode(_ oneTimeCode: ASVerificationCode) async throws
```

## Parameters

- `oneTimeCode`: The code to mark as consumed.

## Discussion

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. note: ASDeliveredVerificationCodesManager.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.
