Caution: If a user loses both their PIN code and the answers to their
Security Questions, they will be permanently locked out of their account,
losing access to all of their wallets and assets.
Prerequisites
Before you begin, make sure you have:- Completed the Create Your First Wallet guide to set up a user and their first wallet.
- Followed the Receive Inbound Transfer guide or Send Outbound Transfer guide to initialize user activity (optional, but helps validate wallet functionality).
- Installed and configured the sample app for your platform (web, iOS, or Android).
-
Registered a callback to handle the Reset PIN flow. This includes:
- Sending the reset PIN request
- Handling the challenge response
- Completing the PIN verification
See the sample app for an example implementation.
Steps
Follow these steps to guide a user through resetting their PIN using the user-controlled wallets SDK:1. Run the Sample App
After you set up one of the web, iOS, or Android sample applications, you can:- Run the sample app and simulator.
- Obtain your App ID. To get the App ID, do one of the following:
- Access the developer console and navigate to the configurator within user-controlled wallets. From there, copy the App ID.
- Make an API request to GET /config/entity and copy the App ID from the response body.
- Add the App ID to the sample app.
2. Acquire a Session Token
Next, you need to acquire a session token. To do this, you make a request to thePOST /users/token
using the previously created userId in Step 1. The userToken is a 60-minute
session token used to initiate requests requiring a user challenge (PIN code
entry). After 60 minutes, the session expires, and a you must generate a new
userToken using the same endpoint.
From this response, you can acquire the encryptionKey and userToken which
you provide in the respective sample app fields. You also use the userToken in
the next step.
Response body
3. Initialize PIN reset and Acquire Challenge ID
Make a request toPUT /user/pin
using the userToken returned from Step 1. This call returns a challengeId,
which is used with the Circle Programmable Wallet SDK to have the user reset
their PIN code.
JSON
4. Reset the PIN in the Sample App
Using the sample application, enter theuserToken and secretKey returned
from Step 1. Enter the challengeId returned from Step 2.
Make sure a callback is registered; otherwise, clicking the Reset PIN button
will have no effect.


5. Check the Challenge Status
Make a requestGET /user/challenges/{id}
using the challengeId received from Step 2 to retrieve the status of the
challenge. Additionally, Circle sends a notification to a
subscribed endpoint once the PIN code reset is
complete. For a full list of possible statuses, see the
Asynchronous States and Statuses guide.
Response Body