> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# setCredentials()

> Reference for the Embedded API setCredentials() method.

Use `setCredentials()` to change the credentials of the currently authenticated user.

<Info>
  Applies to Web Component, Window API, and PostMessage. Examples on this page
  use the Web Component API shape.
</Info>

## Usage

```typescript theme={null}
await api.setCredentials({ password: "YOUR_NEW_PASSWORD" });
```

## Prerequisites

* User must be authenticated.

## Input validation

* `password`: Required string.
* Password must meet policy requirements:
  * Minimum 8 characters.
  * At least 1 uppercase letter.
  * At least 1 lowercase letter.
  * At least 1 number.
  * At least 1 special character.

## Possible errors

* `UNAUTHORIZED`: User not authenticated.
* `INVALID_PAYLOAD`: Password does not meet requirements.
* `INTERNAL_ERROR`: Failed to update password.

## Returns

`void`

## Related reference

* [API Reference Overview](/assistant/api-reference)
* [auth()](/assistant/api/auth)
