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

# Rotate Session Proxy

> Rotate to a new exit IP while keeping the current provider and location.

## Overview

Requests a fresh exit IP from the same provider and location currently attached to the session. Useful when the current IP has been rate-limited or blocked but you still want the same geography.

To change provider or location, use `PUT /browser/sessions/{id}/proxy`. To go direct, use `DELETE /browser/sessions/{id}/proxy`.

## Path Parameters

<ParamField path="id" type="string" required={true}>
  Browser session ID (UUID).
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/proxy/rotate" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY"
  ```
</CodeGroup>

## Response

### Success Response (200)

<ResponseField name="success" type="boolean">
  True when rotation was requested successfully.
</ResponseField>

<ResponseField name="newIp" type="string">
  New exit IP, when reported by the provider.
</ResponseField>

**Example Response:**

```json theme={null}
{
  "success": true,
  "newIp": "203.0.113.42"
}
```

### Error Responses

| Status | Description                                                      |
| ------ | ---------------------------------------------------------------- |
| `401`  | Unauthorized — invalid or missing API key.                       |
| `404`  | Session not found or not owned by the caller.                    |
| `409`  | Session is not running with a managed proxy — nothing to rotate. |
| `503`  | The proxy provider is temporarily unreachable.                   |

## Notes

* Rotation is best-effort — some providers return a new IP synchronously, others rotate on the next outbound request.
* Rotation does not clear browser cookies, local storage, or open connections. Pair with a fresh session if you need a fully clean slate.
