# Manage & Operate › Identity & Access Management › Policies › Permissions Groups API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Manage & Operate product's sections: https://developers.eu.ovhcloud.com/reference/manage-operate/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/policies/permissions-groups/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/identity-access-management/policies/permissions-groups.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/identity-access-management/policies/permissions-groups.json?format=openapi3

## Operations

- `GET /iam/permissionsGroup` — List permissions groups
- `GET /iam/permissionsGroup/{permissionsGroupURN}` — Get a permissions group
- `POST /iam/permissionsGroup` — Create a permissions group
- `DELETE /iam/permissionsGroup/{permissionsGroupURN}` — Delete a permissions group
- `PUT /iam/permissionsGroup/{permissionsGroupURN}` — Update a permissions group

## List permissions groups

`GET /v2/iam/permissionsGroup`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/policies/permissions-groups/#get-iam-permissionsgroup

**Status:** Stable production version  
**IAM actions:** `account:apiovh:iam/permissionsGroup/get`

Returns the permissions groups of the account, and the platform (`ovh`) groups reusable in policies.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | iam.PermissionsGroup[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation time |
| `description` | string | yes | Description of the permissions group |
| `id` | string (uuid) | read-only | Identifier of the permissions group |
| `name` | string | yes | Name of the permissions group |
| `owner` | string | read-only | Owner of the permissions group |
| `permissions` | iam.policy.Permissions | yes | Permissions granted when using this permissions group |
| `permissions.allow` | iam.policy.Action[] |  | List of allowed actions |
| `permissions.allow[].action` | string | yes | Name of the action |
| `permissions.deny` | iam.policy.Action[] |  | Actions to deny the access to |
| `permissions.deny[].action` | string | yes | Name of the action |
| `permissions.except` | iam.policy.Action[] |  | Actions to filter from the allowed list |
| `permissions.except[].action` | string | yes | Name of the action |
| `updatedAt` | string (date-time) | read-only | Last update time |
| `urn` | string | read-only | Unique resource name used in policies to include this permissions group |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "owner": "string",
    "permissions": {
      "allow": [
        {
          "action": "string"
        }
      ],
      "deny": [
        {
          "action": "string"
        }
      ],
      "except": [
        {
          "action": "string"
        }
      ]
    },
    "updatedAt": "2024-01-01T12:00:00Z",
    "urn": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/iam/permissionsGroup" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/iam/permissionsGroup")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/iam/permissionsGroup");

print_r($result);
?>
```

## Get a permissions group

`GET /v2/iam/permissionsGroup/{permissionsGroupURN}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/policies/permissions-groups/#get-iam-permissionsgroup-permissionsgroupurn

**Status:** Stable production version  
**IAM actions:** `account:apiovh:iam/permissionsGroup/get`

Returns the name, description and permissions of the group.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `permissionsGroupURN` | path | string | yes | Permissions groupurn |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | iam.PermissionsGroup | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation time |
| `description` | string | yes | Description of the permissions group |
| `id` | string (uuid) | read-only | Identifier of the permissions group |
| `name` | string | yes | Name of the permissions group |
| `owner` | string | read-only | Owner of the permissions group |
| `permissions` | iam.policy.Permissions | yes | Permissions granted when using this permissions group |
| `permissions.allow` | iam.policy.Action[] |  | List of allowed actions |
| `permissions.allow[].action` | string | yes | Name of the action |
| `permissions.deny` | iam.policy.Action[] |  | Actions to deny the access to |
| `permissions.deny[].action` | string | yes | Name of the action |
| `permissions.except` | iam.policy.Action[] |  | Actions to filter from the allowed list |
| `permissions.except[].action` | string | yes | Name of the action |
| `updatedAt` | string (date-time) | read-only | Last update time |
| `urn` | string | read-only | Unique resource name used in policies to include this permissions group |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "owner": "string",
  "permissions": {
    "allow": [
      {
        "action": "string"
      }
    ],
    "deny": [
      {
        "action": "string"
      }
    ],
    "except": [
      {
        "action": "string"
      }
    ]
  },
  "updatedAt": "2024-01-01T12:00:00Z",
  "urn": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/iam/permissionsGroup/{permissionsGroupURN}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/iam/permissionsGroup/{permissionsGroupURN}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/iam/permissionsGroup/{permissionsGroupURN}");

print_r($result);
?>
```

## Create a permissions group

`POST /v2/iam/permissionsGroup`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/policies/permissions-groups/#post-iam-permissionsgroup

**Status:** Stable production version  
**IAM actions:** `account:apiovh:iam/permissionsGroup/create`

Creates a reusable allow/deny action set to attach to policies via `permissionsGroups`.

### Request body (required)

Type: `iam.PermissionsGroup`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation time |
| `description` | string | yes | Description of the permissions group |
| `id` | string (uuid) | read-only | Identifier of the permissions group |
| `name` | string | yes | Name of the permissions group |
| `owner` | string | read-only | Owner of the permissions group |
| `permissions` | iam.policy.Permissions | yes | Permissions granted when using this permissions group |
| `permissions.allow` | iam.policy.Action[] |  | List of allowed actions |
| `permissions.allow[].action` | string | yes | Name of the action |
| `permissions.deny` | iam.policy.Action[] |  | Actions to deny the access to |
| `permissions.deny[].action` | string | yes | Name of the action |
| `permissions.except` | iam.policy.Action[] |  | Actions to filter from the allowed list |
| `permissions.except[].action` | string | yes | Name of the action |
| `updatedAt` | string (date-time) | read-only | Last update time |
| `urn` | string | read-only | Unique resource name used in policies to include this permissions group |

```json
{
  "description": "string",
  "name": "string",
  "permissions": {
    "allow": [
      {
        "action": "string"
      }
    ],
    "deny": [
      {
        "action": "string"
      }
    ],
    "except": [
      {
        "action": "string"
      }
    ]
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | iam.PermissionsGroup | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation time |
| `description` | string | yes | Description of the permissions group |
| `id` | string (uuid) | read-only | Identifier of the permissions group |
| `name` | string | yes | Name of the permissions group |
| `owner` | string | read-only | Owner of the permissions group |
| `permissions` | iam.policy.Permissions | yes | Permissions granted when using this permissions group |
| `permissions.allow` | iam.policy.Action[] |  | List of allowed actions |
| `permissions.allow[].action` | string | yes | Name of the action |
| `permissions.deny` | iam.policy.Action[] |  | Actions to deny the access to |
| `permissions.deny[].action` | string | yes | Name of the action |
| `permissions.except` | iam.policy.Action[] |  | Actions to filter from the allowed list |
| `permissions.except[].action` | string | yes | Name of the action |
| `updatedAt` | string (date-time) | read-only | Last update time |
| `urn` | string | read-only | Unique resource name used in policies to include this permissions group |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "owner": "string",
  "permissions": {
    "allow": [
      {
        "action": "string"
      }
    ],
    "deny": [
      {
        "action": "string"
      }
    ],
    "except": [
      {
        "action": "string"
      }
    ]
  },
  "updatedAt": "2024-01-01T12:00:00Z",
  "urn": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/iam/permissionsGroup" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: iam.PermissionsGroup
result = client.post("/v2/iam/permissionsGroup",
	description = None, # Description of the permissions group (type: string)
	name = None, # Name of the permissions group (type: string)
	permissions = None, # Permissions granted when using this permissions group (type: iam.policy.Permissions)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: iam.PermissionsGroup
$result = $ovh->post("/v2/iam/permissionsGroup", array(
	description => null, // Description of the permissions group (type: string)
	name => null, // Name of the permissions group (type: string)
	permissions => null, // Permissions granted when using this permissions group (type: iam.policy.Permissions)
));

print_r($result);
?>
```

## Delete a permissions group

`DELETE /v2/iam/permissionsGroup/{permissionsGroupURN}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/policies/permissions-groups/#delete-iam-permissionsgroup-permissionsgroupurn

**Status:** Stable production version  
**IAM actions:** `account:apiovh:iam/permissionsGroup/delete`

Deletes the permissions group. Resources and policies linked to it are not affected.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `permissionsGroupURN` | path | string | yes | Permissions groupurn |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/iam/permissionsGroup/{permissionsGroupURN}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/iam/permissionsGroup/{permissionsGroupURN}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/iam/permissionsGroup/{permissionsGroupURN}");

print_r($result);
?>
```

## Update a permissions group

`PUT /v2/iam/permissionsGroup/{permissionsGroupURN}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/policies/permissions-groups/#put-iam-permissionsgroup-permissionsgroupurn

**Status:** Stable production version  
**IAM actions:** `account:apiovh:iam/permissionsGroup/edit`

Replaces the group's name, description and permissions.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `permissionsGroupURN` | path | string | yes | Permissions groupurn |

### Request body (required)

Type: `iam.PermissionsGroup`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation time |
| `description` | string | yes | Description of the permissions group |
| `id` | string (uuid) | read-only | Identifier of the permissions group |
| `name` | string | yes | Name of the permissions group |
| `owner` | string | read-only | Owner of the permissions group |
| `permissions` | iam.policy.Permissions | yes | Permissions granted when using this permissions group |
| `permissions.allow` | iam.policy.Action[] |  | List of allowed actions |
| `permissions.allow[].action` | string | yes | Name of the action |
| `permissions.deny` | iam.policy.Action[] |  | Actions to deny the access to |
| `permissions.deny[].action` | string | yes | Name of the action |
| `permissions.except` | iam.policy.Action[] |  | Actions to filter from the allowed list |
| `permissions.except[].action` | string | yes | Name of the action |
| `updatedAt` | string (date-time) | read-only | Last update time |
| `urn` | string | read-only | Unique resource name used in policies to include this permissions group |

```json
{
  "description": "string",
  "name": "string",
  "permissions": {
    "allow": [
      {
        "action": "string"
      }
    ],
    "deny": [
      {
        "action": "string"
      }
    ],
    "except": [
      {
        "action": "string"
      }
    ]
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | iam.PermissionsGroup | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation time |
| `description` | string | yes | Description of the permissions group |
| `id` | string (uuid) | read-only | Identifier of the permissions group |
| `name` | string | yes | Name of the permissions group |
| `owner` | string | read-only | Owner of the permissions group |
| `permissions` | iam.policy.Permissions | yes | Permissions granted when using this permissions group |
| `permissions.allow` | iam.policy.Action[] |  | List of allowed actions |
| `permissions.allow[].action` | string | yes | Name of the action |
| `permissions.deny` | iam.policy.Action[] |  | Actions to deny the access to |
| `permissions.deny[].action` | string | yes | Name of the action |
| `permissions.except` | iam.policy.Action[] |  | Actions to filter from the allowed list |
| `permissions.except[].action` | string | yes | Name of the action |
| `updatedAt` | string (date-time) | read-only | Last update time |
| `urn` | string | read-only | Unique resource name used in policies to include this permissions group |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "owner": "string",
  "permissions": {
    "allow": [
      {
        "action": "string"
      }
    ],
    "deny": [
      {
        "action": "string"
      }
    ],
    "except": [
      {
        "action": "string"
      }
    ]
  },
  "updatedAt": "2024-01-01T12:00:00Z",
  "urn": "string"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/iam/permissionsGroup/{permissionsGroupURN}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: iam.PermissionsGroup
result = client.put("/v2/iam/permissionsGroup/{permissionsGroupURN}",
	description = None, # Description of the permissions group (type: string)
	name = None, # Name of the permissions group (type: string)
	permissions = None, # Permissions granted when using this permissions group (type: iam.policy.Permissions)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: iam.PermissionsGroup
$result = $ovh->put("/v2/iam/permissionsGroup/{permissionsGroupURN}", array(
	description => null, // Description of the permissions group (type: string)
	name => null, // Name of the permissions group (type: string)
	permissions => null, // Permissions granted when using this permissions group (type: iam.policy.Permissions)
));

print_r($result);
?>
```
