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

# startRecording()

> Reference for the Embedded API startRecording() method.

Use `startRecording()` to begin recording within the current embedded session.

> [!NOTE]
>
> Applies to Web Component, Window API, and PostMessage. Examples on this page
> use the Web Component API shape.

## Usage

```typescript theme={null}
await api.startRecording();
```

## Patient consent

When `consent.enabled` is `true` in [`configureApp()`](https://docs.corti.ai/assistant/api/configure-app#patient-consent), `startRecording()` resolves only after the user confirms consent. Handle the `FORBIDDEN` rejection:

```typescript theme={null}
try {
  await api.startRecording();
} catch (error) {
  // FORBIDDEN: the user declined consent, or the request was superseded or abandoned
}
```

## Prerequisites

* User must be authenticated.
* An interaction must exist.
* The application must be in an interview or session context.

## Input validation

* None

## Possible errors

* `NOT_READY`: Not in interview context or no interaction exists.
* `UNAUTHORIZED`: User not authenticated.
* `NOT_FOUND`: Interaction not found.
* `INTERNAL_ERROR`: Failed to connect to the recording service.
* `FORBIDDEN`: [Patient consent](https://docs.corti.ai/assistant/api/configure-app.md#patient-consent) is enabled and the user declined it, or the request was superseded by a newer start request or dropped, for example by navigating away.

## Returns

`void`

## Related reference

* [API Reference Overview](https://docs.corti.ai/assistant/api-reference.md)
* [createInteraction()](https://docs.corti.ai/assistant/api/create-interaction.md)
* [stopRecording()](https://docs.corti.ai/assistant/api/stop-recording.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.