> For the complete documentation index, see [llms.txt](https://docs.skeddly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.skeddly.com/resources/credentials/generateiampolicy-method.md).

# GenerateIamPolicy Method

## Description

Generates an Amazon IAM policy document for an Amazon credential.

## HTTP Request

`GET https://api.skeddly.com/api/Credentials/<id>/IamPolicy`

## URL Parameters

### id

ID of the credential.

Type: `string`

Required: Yes

## Query Parameters

### extras

Comma-separated list of extra data to include.

Type: `string`

Valid Values:

* `my-resources`

Required: No

## Returns

A JSON string containing an IAM policy document.

The IAM policy document is in JSON format, but it is encased in a JSON string.

Deserialize the response body as a JSON string. Then, if required, deserialize the string contents as an Amazon IAM policy document.

## Sample Request

{% tabs %}
{% tab title="HTTP" %}

```http
GET /api/Credentials/cred-00000001/IamPolicy HTTP/1.1
Host: api.skeddly.com
Authorization: AccessKey <api key>
```

{% endtab %}

{% tab title="Bash" %}

```bash
curl "https://api.skeddly.com/api/Credentials/cred-00000001/IamPolicy" \
  -H "Authorization: AccessKey <api key>"
```

{% endtab %}
{% endtabs %}

## Sample Response

```javascript
"{
    \"Version\": \"2012-10-17\",
    \"Statement\": [
        {
            \"Effect\": \"Allow\",
            \"Action\": [
                \"ec2:DescribeInstances\",
                \"ec2:StartInstances\"
            ],
            \"Resource\": \"*\"
        }
    ]
}"
```
