---
title: imei
description: Creates an IMEI validation action.
source: /actions/imei/imei.ts
contributors:
  - fabian-hiller
  - Danielwinkelmann
---

import { ApiList, Property } from '~/components';
import { properties } from './properties';

# imei

Creates an [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) validation action.

```ts
const Action = v.imei<TInput, TMessage>(message);
```

## Generics

- `TInput` <Property {...properties.TInput} />
- `TMessage` <Property {...properties.TMessage} />

## Parameters

- `message` <Property {...properties.message} />

### Explanation

With `imei` you can validate the formatting of a string. If the input is not an imei, you can use `message` to customize the error message.

## Returns

- `Action` <Property {...properties.Action} />

## Examples

The following examples show how `imei` can be used.

### IMEI schema

Schema to validate an IMEI.

```ts
const ImeiSchema = v.pipe(v.string(), v.imei('The imei is badly formatted.'));
```

## Related

The following APIs can be combined with `imei`.

### Schemas

<ApiList items={['any', 'custom', 'string']} />

### Methods

<ApiList items={['pipe']} />

### Utils

<ApiList items={['isOfKind', 'isOfType']} />
