> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runtype.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runtype.com/_mcp/server.

# Reset the current browser visitor

POST https://api.runtype.com/v1/client/visitor/reset

Explicit widget shutdown/logout lifecycle. Revokes the presented browser visitor when it still resolves, without deleting conversation records. The response is idempotent so it cannot reveal whether a visitor secret was valid. Clear the locally stored secret after success; a later history-capable init creates a clean anonymous visitor. Every response carries `X-History-Identity-Status` (`not_provided` | `admitted` | `ignored`) reporting what the server did with a supplied `X-Identity-Proof`, so a widget can tell a verified action from a browser-scoped one. It is exposed via CORS; it grants no authority.

Reference: https://docs.runtype.com/api-reference/runtype-api/client-runtime/reset-the-current-browser-visitor

## Servers

- `https://api.runtype.com` (Production, default)
- `https://api.runtype-staging.com` (Staging)

## Request

### Query parameters

- `sessionId` (string, required) — Live client session id from /client/init.

### Headers

- `x-visitor-token` (string, optional) — The visitor secret to revoke. Omit when local storage is already empty; reset remains idempotent.

## Response

### 200

Visitor reset accepted.

- `reset` (boolean, required) — Always true after the reset request is accepted, including when the supplied visitor was already expired or revoked.

## Errors

### 400 Bad Request Error

Missing or malformed `sessionId`

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 401 Unauthorized Error

Session expired

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 403 Forbidden Error

Client token inactive or origin mismatch

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 429 Too Many Requests Error

Rate limit exceeded for this client token or session. The response carries a `Retry-After` header.

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 500 Internal Server Error

Internal server error

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 503 Service Unavailable Error

An `X-Identity-Proof` was supplied but end-user identity admission is not enabled for this token owner, so it cannot be evaluated (`identity_proof_not_admitted`). Nothing was read, deleted, or otherwise acted on. Retry without the proof to act at plain browser scope. Distinct from 401 `invalid_identity_proof`, which means the proof WAS evaluated and rejected.

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

## Types

### ErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

## Examples

**Response**

```json
{
  "reset": true
}
```

**SDK Code**

```python
import requests

url = "https://api.runtype.com/v1/client/visitor/reset"

querystring = {"sessionId":"sessionId"}

response = requests.post(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.runtype.com/v1/client/visitor/reset?sessionId=sessionId';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.runtype.com/v1/client/visitor/reset?sessionId=sessionId"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.runtype.com/v1/client/visitor/reset?sessionId=sessionId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.runtype.com/v1/client/visitor/reset?sessionId=sessionId")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/client/visitor/reset?sessionId=sessionId');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/client/visitor/reset?sessionId=sessionId");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/client/visitor/reset?sessionId=sessionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```