> ## Documentation Index
> Fetch the complete documentation index at: https://docs.searchcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# End Browser Session

> End and release a Browserbase browser session

Public endpoint to clean up browser sessions when the user closes the ranking flow modal or navigates away.

<Note>
  This is a **public endpoint** - no authentication required. Used on the
  searchcompany.ai landing page ranking flow.
</Note>

## Path Parameters

<ParamField path="session_id" type="string" required>
  The session ID returned from the create browser session endpoint
</ParamField>

## Response

<ResponseField name="status" type="string">
  Status of the operation (always "ended" on success)
</ResponseField>

<ResponseField name="session_id" type="string">
  The session ID that was ended
</ResponseField>

## How It Works

1. **Cancel Navigation** - Cancels any in-progress background navigation task
2. **Release Session** - Sends release request to Browserbase API
3. **Clear Cache** - Removes session from internal cache

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://searchcompany-main.up.railway.app/api/browser-session/abc123-def456-ghi789"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "status": "ended",
    "session_id": "abc123-def456-ghi789"
  }
  ```
</ResponseExample>

## Usage on Landing Page

```typescript theme={null}
// Clean up when modal closes
useEffect(() => {
  return () => {
    if (sessionId) {
      endBrowserSession(sessionId);
    }
  };
}, [sessionId]);
```

## Rate Limiting

* **10 requests/minute** per IP address
