Delete User password

DELETE
https://test.stytch.com/v1/users/passwords/{password_id}

Delete a password from a User.


Path parameters


password_id*string

The password_id to be deleted.


Response fields


status_codeint

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.


request_idstring

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.


user_idstring

The unique ID of the affected User.


userobject

The user object affected by this API call. See the Get user endpoint for complete response field details.

user_idstring

The unique ID of the affected User.

status_codeint

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.

request_idstring

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.

nameobject

The name of the User. Each field in the name object is optional.

first_namestring

The first name of the user.

middle_namestring

The middle name(s) of the user.

last_namestring

The last name of the user.

trusted_metadataobject

The trusted_metadata field contains an arbitrary JSON object of application-specific data. See the Metadata reference for complete field behavior details.

untrusted_metadataobject

The untrusted_metadata field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and cannot be used to store critical information. See the Metadata reference for complete field behavior details.

emailsarray[objects]

An array of email objects for the User.

email_idstring

The unique ID of a specific email address.

emailstring

The email address.

verifiedboolean

The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User.

phone_numbersarray[objects]

An array of phone number objects linked to the User.

phone_idstring

The unique ID for the phone number.

phone_numberstring

The phone number.

verifiedboolean

The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User.

providersarray[objects]

An array of OAuth provider objects linked to the User.

oauth_user_registration_idstring

The unique ID for an OAuth registration.

provider_subjectstring

The unique identifier for the User within a given OAuth provider. Also commonly called the "sub" or "Subject field" in OAuth protocols.

provider_typestring

Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Facebook, GitHub etc.

profile_picture_urlstring

If available, the profile_picture_url is a url of the User's profile picture set in OAuth identity the provider that the User has authenticated with, e.g. Facebook profile picture.

localestring

If available, the locale is the User's locale set in the OAuth identity provider that the user has authenticated with.

webauthn_registrationsarray[objects]

An array that contains a list of all Passkey or WebAuthn registrations for a given User in the Stytch API.

webauthn_registration_idstring

The unique ID for the Passkey or WebAuthn registration.

domainstring

The domain on which Passkey or WebAuthn registration was started. This will be the domain of your app.

user_agentstring

The user agent of the User.

authenticator_typestring

The authenticator_type string displays the requested authenticator type of the Passkey or WebAuthn device. The two valid types are "platform" and "cross-platform". If no value is present, the Passkey or WebAuthn device was created without an authenticator type preference.

verifiedboolean

The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User.

namestring

The name of the Passkey or WebAuthn registration.

biometric_registrationsarray[objects]

An array that contains a list of all biometric registrations for a given User in the Stytch API.

biometric_registration_idstring

The unique ID for a biometric registration.

verifiedboolean

The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User.

totpsarray[objects]

An array containing a list of all TOTP instances for a given User in the Stytch API.

totp_idstring

The unique ID for a TOTP instance.

verifiedboolean

The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User.

crypto_walletsarray[objects]

An array contains a list of all crypto wallets for a given User in the Stytch API.

crypto_wallet_idstring

The unique ID for a crypto wallet

crypto_wallet_addressstring

The actual blockchain address of the User's crypto wallet.

crypto_wallet_typestring

The blockchain that the User's crypto wallet operates on, e.g. Ethereum, Solana, etc.

verifiedboolean

The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User.

passwordobject

The password object is returned for users with a password.

password_idstring

The unique ID of a specific password

requires_resetboolean

Indicates whether this password requires a password reset

rolesarray[strings]

Roles assigned to this User. See the RBAC guide for more information about role assignment.

created_atstring

The timestamp of the User's creation. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.

statusstring

The status of the User. The possible values are pending and active.

const stytch = require('stytch');

const client = new stytch.Client({
  project_id: 'PROJECT_ID',
  secret: 'SECRET',
});

const params = {
  password_id: "password-test-ca6dbe77-10e5-4403-805a-b117c55c24c6",
};

client.users.deletePassword(params)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });
RESPONSE 200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
  "user": {...}
}
RESPONSE 400
{
  "status_code": 400,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "invalid_password_id",
  "error_message": "The password_id format is invalid.",
  "error_url": "https://stytch.com/docs/api/errors/400"
}
RESPONSE 401
{
  "status_code": 401,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "unauthorized_credentials",
  "error_message": "Unauthorized credentials.",
  "error_url": "https://stytch.com/docs/api/errors/401"
}
RESPONSE 404
{
  "status_code": 404,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "password_not_found",
  "error_message": "The password could not be found.",
  "error_url": "https://stytch.com/docs/api/errors/404"
}
RESPONSE 429
{
  "status_code": 429,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "too_many_requests",
  "error_message": "Too many requests have been made.",
  "error_url": "https://stytch.com/docs/api/errors/429"
}
RESPONSE 500
{
  "status_code": 500,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "internal_server_error",
  "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
  "error_url": "https://stytch.com/docs/api/errors/500"
}

Common Error Types