# Manage & Operate › Identity & Access Management 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

> 1 operation 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/

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

## Operations

- `POST /iam/authorization/check` — Check authorizations on resources

## Check authorizations on resources

`POST /v2/iam/authorization/check`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/#post-iam-authorization-check

**Status:** Stable production version

Checks the listed actions against each `resourceURN`.
Returns, per resource, which actions are authorized and which are not.

### Parameters

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

### Request body (required)

Type: `iam.AuthorizeBatchRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `actions` | string[] | yes | List of actions to check authorizations for |
| `resourceURNs` | string[] | yes | Resources on which accesses should be checked |

```json
{
  "actions": [
    "string"
  ],
  "resourceURNs": [
    "string"
  ]
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authorizedActions` | string[] | read-only | Actions from your request that the caller is allowed to perform on the resource |
| `resourceURN` | string | read-only | URN of the resource |
| `unauthorizedActions` | string[] | read-only | Actions from your request that the caller is not allowed to perform on the resource |

```json
[
  {
    "authorizedActions": [
      "string"
    ],
    "resourceURN": "string",
    "unauthorizedActions": [
      "string"
    ]
  }
]
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/iam/authorization/check" \
  -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.AuthorizeBatchRequest
result = client.post("/v2/iam/authorization/check",
	actions = None, # List of actions to check authorizations for (type: array)
	resourceURNs = None, # Resources on which accesses should be checked (type: array)
)

# 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.AuthorizeBatchRequest
$result = $ovh->post("/v2/iam/authorization/check", array(
	actions => null, // List of actions to check authorizations for (type: array)
	resourceURNs => null, // Resources on which accesses should be checked (type: array)
));

print_r($result);
?>
```
