# Visitor methods: forget, identify, merge

URL: /code/sdk/visitor/verbs · Id: `page:code/sdk/visitor/verbs`

> The Visitor Verbs forget, identify, merge as typed SDK methods, with inputs, result, refusals and an example.

Reference for [Visitor](/business/nouns/visitor), one group of [Visitor methods](/code/sdk/visitor).

### Visitor.forget
Forget masks a person’s captured data across every Event and Recording and suppresses further capture, keeping the records. [Verb page](/business/nouns/visitor/forget?interface=sdk).

```ts
interface VisitorVerbs {
  forget(input: VisitorForgetInput, options?: SB.CallOptions): SB.Call<Visitor>
}
```

Emits [`Visitor.forgotten`](/business/events/Visitor.forgotten).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The Visitor to forget. |
| `request` | `text` | Yes | The privacy request it answers. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The Visitor, masked. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```ts
import { $ } from 'startup-builder'

const visitor = await $.Visitor.forget({ visitor: 'visitor_M5gHadysq9', request: 'Example request' })
```

### Visitor.identify
Identify joins a Visitor to the Contact it turns out to be, so earlier Visits count toward that person. [Verb page](/business/nouns/visitor/identify?interface=sdk).

```ts
interface VisitorVerbs {
  identify(input: VisitorIdentifyInput, options?: SB.CallOptions): SB.Call<VisitorIdentifyOutput>
}
```

Emits [`Visitor.identified`](/business/events/Visitor.identified).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The Visitor. |
| `contact` | [Contact](/business/nouns/contact) | Yes | The Contact or Customer the Visitor is. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `contact` | [Contact](/business/nouns/contact) | Yes | The Contact, with the Visitor’s Visits attached. |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The Visitor, now joined to its Contact. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```ts
import { $ } from 'startup-builder'

const { contact, visitor } = await $.Visitor.identify({ visitor: 'visitor_M5gHadysq9', contact: 'contact_WsrosCQi6J' })
```

### Visitor.merge
Merge joins two Visitor ids that belong to one person and keeps both as aliases. [Verb page](/business/nouns/visitor/merge?interface=sdk).

```ts
interface VisitorVerbs {
  merge(input: VisitorMergeInput, options?: SB.CallOptions): SB.Call<Visitor>
}
```

Emits [`Visitor.merged`](/business/events/Visitor.merged).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The Visitor to merge. |
| `into` | [Visitor](/business/nouns/visitor) | Yes | The Visitor that remains. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The remaining Visitor. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```ts
import { $ } from 'startup-builder'

const visitor = await $.Visitor.merge({ visitor: 'visitor_M5gHadysq9', into: 'visitor_M5gHadysq9' })
```