---
title: "Rotate user secret"
method: POST
path: "/snapTrade/resetUserSecret"
tags: ["Authentication"]
---

# Rotate user secret

`POST /snapTrade/resetUserSecret`

Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.

## Request body

- UserIDandSecret
  - `userId` string — SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
  - `userSecret` string — SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).

## Response `200`

New user secret is generated

- UserIDandSecret
  - `userId` string — SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
  - `userSecret` string — SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).

## Other responses

- `400` — Bad Request. Could be caused by various reasons. Error message is provided in response
- `401` — Failed authentication. Wrong clientId, userId or userSecret provided
- `500` — Unexpected error

---

[API](https://skmtc.net/passiv/apis/snaptrade.md) · [All operations](https://skmtc.net/passiv/apis/snaptrade/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/passiv/snaptrade/revisions/259274f1e845/schema)
