> ## 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.

# auth()

> Reference for the Embedded API auth() method.

Use `auth()` to authenticate the current user session with the embedded Assistant.

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

## Usage

```typescript theme={null}
const user = await api.auth({
  access_token: string,
  refresh_token: string,
  id_token: string,
  token_type: string,
});
```

## Prerequisites

* None

## Input validation

* All fields (`access_token`, `refresh_token`, `id_token`, `token_type`) are required.
* Tokens must be valid JWT strings.

## Possible errors

* `INVALID_PAYLOAD`: Missing required authentication fields.
* `UNAUTHORIZED`: Invalid or expired tokens.
* `INTERNAL_ERROR`: Authentication service unavailable.

## Returns

```typescript theme={null}
{
  id: string,
  email: string
}
```

## Related reference

* [API Reference Overview](/assistant/api-reference)
* [createInteraction()](/assistant/api/create-interaction)
