# Organization Policy


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

The Organization Policy is an IAM policy that applies as a first layer across your entire Exoscale organization.

[Read more](https://community.exoscale.com/product/iam/operation/roles-policies/)

## <span data-label="POST" class="pill-POST"></span>reset-iam-organization-policy

Reset IAM Organization Policy

```
POST /iam-organization-policy:reset
```

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `reset-iam-organization-policy`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ResetIAMOrganizationPolicy) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reset_iam_organization_policy) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#resetIamOrganizationPolicy())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reset-iam-organization-policy`

## <span data-label="GET" class="pill-GET"></span>get-iam-organization-policy

Retrieve IAM Organization Policy

```
GET /iam-organization-policy
```

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `default-service-strategy` | string | IAM default service strategy<br/><br/>Allowed values: `allow`, `deny`. |
| `services` | object | IAM services |

<details>
<summary>Example output</summary>

```json
{
  "default-service-strategy": "allow",
  "services": {}
}
```
</details>


SDK reference for `get-iam-organization-policy`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetIAMOrganizationPolicy) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_iam_organization_policy) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getIamOrganizationPolicy())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-iam-organization-policy`

## <span data-label="PUT" class="pill-PUT"></span>update-iam-organization-policy

Update IAM Organization Policy

```
PUT /iam-organization-policy
```

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `default-service-strategy` | string | **yes** | IAM default service strategy<br/><br/>Allowed values: `allow`, `deny`. |
| `services` | object | **yes** | IAM services |

<details>
<summary>Example</summary>

```json
{
  "default-service-strategy": "allow",
  "services": {}
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-iam-organization-policy`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateIAMOrganizationPolicy) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_iam_organization_policy) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateIamOrganizationPolicy(com.exoscale.sdk.model.UpdateIamOrganizationPolicyRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-iam-organization-policy`


