---
title: "LeaveOrganization"
---

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

Path: EZGH Cloud organizations and IAM › organizations

`POST /v1/organizations/{orgId}/leave`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie
- `oauth`, http, header `Authorization`

## Path parameters

- `LeaveOrganization.path.orgId` (string, required)

## Code samples

### cURL

```curl
curl --request POST \
  --url https://orgs.ezghcloud.com/v1/organizations/string/leave \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://orgs.ezghcloud.com/v1/organizations/string/leave';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://orgs.ezghcloud.com/v1/organizations/string/leave"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 204

<No Content>

### 400

InvalidRequest

#### Example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `LeaveOrganization.response.400.error` (object, required)
  - `LeaveOrganization.response.400.error.code` (string, required)
    - one of `"invalid_request"`
  - `LeaveOrganization.response.400.error.message` (string, required)
  - `LeaveOrganization.response.400.error.issues` (array<object>, optional)
    - `LeaveOrganization.response.400.error.issues.path` (string, required)
    - `LeaveOrganization.response.400.error.issues.message` (string, required)

### 401

Unauthenticated

#### Example

```json
{
  "error": {
    "code": "unauthenticated",
    "message": "string"
  }
}
```

- `LeaveOrganization.response.401.error` (object, required)
  - `LeaveOrganization.response.401.error.code` (string, required)
    - one of `"unauthenticated"`
  - `LeaveOrganization.response.401.error.message` (string, required)

### 403

Forbidden | AccessDenied | ForbiddenOrigin

#### Example

```json
{
  "error": {
    "code": "forbidden",
    "message": "string"
  }
}
```

Any of:

- [ForbiddenEncoded](/orgs-api/schemas/ForbiddenEncoded/)
- [AccessDeniedEncoded](/orgs-api/schemas/AccessDeniedEncoded/)
- [ForbiddenOriginEncoded](/orgs-api/schemas/ForbiddenOriginEncoded/)

### 404

NotFound

#### Example

```json
{
  "error": {
    "code": "not_found",
    "message": "string"
  }
}
```

- `LeaveOrganization.response.404.error` (object, required)
  - `LeaveOrganization.response.404.error.code` (string, required)
    - one of `"not_found"`
  - `LeaveOrganization.response.404.error.message` (string, required)

### 409

ManagedByScim

#### Example

```json
{
  "error": {
    "code": "managed_by_scim",
    "message": "string"
  }
}
```

- `LeaveOrganization.response.409.error` (object, required)
  - `LeaveOrganization.response.409.error.code` (string, required)
    - one of `"managed_by_scim"`
  - `LeaveOrganization.response.409.error.message` (string, required)

### 429

TooManyRequests

#### Example

```json
{
  "error": {
    "code": "too_many_requests",
    "message": "string"
  }
}
```

- `LeaveOrganization.response.429.error` (object, required)
  - `LeaveOrganization.response.429.error.code` (string, required)
    - one of `"too_many_requests"`
  - `LeaveOrganization.response.429.error.message` (string, required)

### 500

InternalError

#### Example

```json
{
  "error": {
    "code": "internal_error",
    "message": "string"
  }
}
```

- `LeaveOrganization.response.500.error` (object, required)
  - `LeaveOrganization.response.500.error.code` (string, required)
    - one of `"internal_error"`
  - `LeaveOrganization.response.500.error.message` (string, required)

### 503

Unavailable

#### Example

```json
{
  "error": {
    "code": "unavailable",
    "message": "string"
  }
}
```

- `LeaveOrganization.response.503.error` (object, required)
  - `LeaveOrganization.response.503.error.code` (string, required)
    - one of `"unavailable"`
  - `LeaveOrganization.response.503.error.message` (string, required)


Source: https://docs.ezghcloud.com/orgs-api/organizations/LeaveOrganization/index.md
