Consumer Authentication

/

API reference

/

Time-based one-time passcodes (TOTP)

/

Get recovery codes

Get TOTP recovery codes

POSThttps://test.stytch.com/v1/totps/recovery_codes

Retrieve the recovery codes for a TOTP instance tied to a User.


Body parameters


user_id*string

Response fields


status_codeint

request_idstring

user_idstring

totpsarray[objects]
curl --request POST \
  --url https://test.stytch.com/v1/totps/recovery_codes \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6"
  }'

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
  "totps": [
    {
      "totp_id": "totp-test-41920359-8bbb-4fe8-8fa3-aaa83f35f02c",
      "verified": true,
      "recovery_codes": [
        "ckss-2skx-ebow",
        "spbc-424h-usy0",
        "hi08-n5tk-lns5",
        "1n6i-l5na-8axe",
        "aduj-eufq-w6yy",
        "i4l3-dxyt-urmx",
        "ayyi-utb0-gj0s",
        "lz0m-02bi-psbx",
        "l2qm-zrk1-8ujs",
        "c2qd-k7m4-ifmc"
    ]
    }
  ]
}