---
title: "Create IAM Role"
method: POST
path: "/iam-role"
tags: ["role"]
---

# Create IAM Role

`POST /iam-role`

## Request

- Base URL: `https://api-ch-gva-2.exoscale.com/v2`
- URL: `https://api-ch-gva-2.exoscale.com/v2/iam-role`
- Auth: none declared
- TypeScript: <https://skmtc.dev/exoscale/apis/exoscale-api/docs/iam-role/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `name` string, required: IAM Role name
  - `description` string: IAM Role description
  - `permissions` string[]: IAM Role permissions
  - `editable` boolean: Sets if the IAM Role Policy is editable or not (default: true). This setting cannot be changed after creation
  - `labels` Labels
  - `policy` IamPolicy: Policy
    - `default-service-strategy` 'allow' | 'deny', required: IAM default service strategy
    - `services` object, required: IAM services
  - `assume-role-policy` IamAssumeRolePolicy: Assume Role Policy
    - `rules` IamServicePolicyRule[]: IAM Assume Role Policy rules
      - `action` 'allow' | 'deny'
      - `expression` string
      - `resources` string[]
  - `max-session-ttl` integer: Maximum TTL requester is allowed to ask for when assuming a role

## Response `200`

200

- Operation: Operation
  - `id` string, uuid: Operation ID
  - `reason` 'incorrect' | 'unknown' | 'unavailable' | 'forbidden' | 'busy' | 'fault' | 'partial' | 'not-found' | 'interrupted' | 'unsupported' | 'conflict': Operation failure reason
  - `reference` object: Related resource reference
    - `id` string, uuid: Reference ID
    - `link` string: Link to the referenced resource
    - `command` string: Command name
  - `message` string: Operation message
  - `state` 'failure' | 'pending' | 'success' | 'timeout': Operation status

## Changes

- **2026-11-06** `63da6f74c845`: 2 warning, 1 info
  - removed the request property `assume-role-policy/default-service-strategy`
  - removed the request property `assume-role-policy/services`
  - added the new optional request property `assume-role-policy/rules`
- **2026-03-16** `e05707a7b346`: 4 info
  - api tag `role` added
  - api tag `iam` removed
  - added the new optional request property `assume-role-policy`
  - added the new optional request property `max-session-ttl`
- **2025-05-22** `37a05010e8b4`: 1 info
  - added the new `reset-iam-organization-policy` enum value to the request property `permissions/items/`
- **2023-12-08** `ec6a2a6bc1c1`: 2 breaking, 2 warning
  - the `description` request property's minLength was increased from `0` to `1`
  - the `name` request property's minLength was increased from `0` to `1`
  - the `description` request property's maxLength was set to `255`
  - the `name` request property's maxLength was set to `191`
- **2023-06-06** `cf7b08181585`: 1 info
  - added the new optional request property `permissions`

[Operation history](https://skmtc.dev/exoscale/apis/exoscale-api/changes/iam-role/post.md)

---

[API](https://skmtc.dev/exoscale/apis/exoscale-api.md) - [All operations](https://skmtc.dev/exoscale/apis/exoscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/exoscale/apis/exoscale-api/revisions/63da6f74c845?raw)
