# POST /v1/users/me/switch-org - Switch current organization

Source: <https://everruns.com/docs/api/operations/switch_org/>

POST

/v1/users/me/switch-org

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/users/me/switch-org';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"org_id":"org_2f3c1b3e6a9d4c6f8a1d4e9c9b7f21a0"}'
};


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

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/users/me/switch-org \
  --header 'Content-Type: application/json' \
  --data '{ "org_id": "org_2f3c1b3e6a9d4c6f8a1d4e9c9b7f21a0" }'
```

* Production APIapp.everruns.com/api/v1/users/me/switch-org

Sets a cookie with the selected organization. This org will be used for all subsequent requests (including SSE connections via EventSource). The user must be a member of the requested organization.

## Request Bodyrequired

Media typeapplication/json

Request to switch organization

object

**org\_id**

required

Organization public ID to switch to

string

##### Example

```plaintext
org_2f3c1b3e6a9d4c6f8a1d4e9c9b7f21a0
```

## Responses

### 200

Organization switched successfully

Media typeapplication/json

Response from switch org endpoint

object

**org\_id**

required

The organization ID that was switched to

string

**success**

required

Whether the switch was successful

boolean

##### Examplegenerated

```json
{
  "org_id": "example",
  "success": true
}
```

### 400

Invalid organization ID format

### 401

Unauthorized

### 404

Organization not found or user is not a member