# mv.testHelpersEvents

> The testHelpersEvents methods of @morevoice/sdk: Simulate calls and events in test mode.

Simulate calls and events in test mode. These methods are on `mv.testHelpersEvents`, where `mv` is your client (see [the Node.js SDK](https://docs.morevoice.ai/sdk/node/#connect)). Each one returns the response object and throws when the API answers with an error.

## `create()`

**Send a sample event.** Test mode only. Emits one sample event of `type`: it is stored and delivered to your test-mode webhook endpoints that subscribe to it, signed and retried like any event.

```ts
mv.testHelpersEvents.create(body: TestHelpersEventsCreateData["body"], options?: RequestOptions): Promise<TestHelpersEventsCreateResponse>
```

`POST /test_helpers/events` · [API reference](https://docs.morevoice.ai/api/operations/test_helpers_events_create/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `body.type` | `string` | yes | An event type from the catalogue, e.g. `call.ended`. |
| `options.headers["MoreVoice-Version"]` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |
| `options.headers["Idempotency-Key"]` | `string` | no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |
| `options` | `RequestOptions` | no | `idempotencyKey`, extra `headers` and an abort `signal`: see [retries and idempotency](https://docs.morevoice.ai/sdk/typescript/retries/). |

### Returns

`TestHelperEvent`:

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"test_event"` | Always `test_event`. |
| `id` | `string` | The event's ID: it is stored and delivered like any event. |
| `type` | `string` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |

### Example

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const testHelperEvent = await mv.testHelpersEvents.create({
	type: "call.ended",
});
console.log(testHelperEvent);
```
