# Visitor methods: update, delete

URL: /code/sdk/visitor/records-update · Id: `page:code/sdk/visitor/records-update`

> The Visitor Verbs update, delete 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.update
Changes the given properties of a Visitor. [Verb page](/business/nouns/visitor/update?interface=sdk).

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

Emits `Visitor.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Visitor. |
| `firstSeenAt` | `datetime` | No | When the first request arrived. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The 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.update({ id: 'visitor_M5gHadysq9', firstSeenAt: '2026-10-22T12:00:00Z' })
```

### Visitor.delete
Deletes a Visitor: a soft delete that keeps its history, undone by `Thing.restore`. [Verb page](/business/nouns/visitor/delete?interface=sdk).

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

Emits `Visitor.deleted`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Visitor. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `visitor` | [Visitor](/business/nouns/visitor) | Yes | The 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.delete({ id: 'visitor_M5gHadysq9' })
```