# User


<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>

IAM users map to humans empowered with access to Exoscale resources.

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

## <span data-label="POST" class="pill-POST"></span>create-user

Create a User

```
POST /user
```

null

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string | **yes** | User Email |
| `role` | [IAM Role](/reference/api/_schemas/iam-role/) | no | IAM Role |

<details>
<summary>Example</summary>

```json
{
  "email": "string",
  "role": {
    "assume-role-policy": {
      "rules": [
        {
          "action": "allow",
          "expression": "string",
          "resources": [
            null
          ]
        }
      ]
    },
    "description": "string",
    "editable": true,
    "id": "string",
    "labels": {},
    "max-session-ttl": 0,
    "name": "string",
    "permissions": [
      "bypass-governance-retention"
    ],
    "policy": {
      "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 `create-user`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateUser) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_user) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createUser(com.exoscale.sdk.model.CreateUserRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-user`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-user

Delete User

```
DELETE /user/{id}
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### 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 `delete-user`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteUser) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_user) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteUser(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-user`


---

## Other Operations

## <span data-label="PUT" class="pill-PUT"></span>update-user-role

Update a User's IAM role

```
PUT /user/{id}
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `role` | [IAM Role](/reference/api/_schemas/iam-role/) | no | IAM Role |

<details>
<summary>Example</summary>

```json
{
  "role": {
    "assume-role-policy": {
      "rules": [
        {
          "action": "allow",
          "expression": "string",
          "resources": [
            null
          ]
        }
      ]
    },
    "description": "string",
    "editable": true,
    "id": "string",
    "labels": {},
    "max-session-ttl": 0,
    "name": "string",
    "permissions": [
      "bypass-governance-retention"
    ],
    "policy": {
      "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-user-role`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateUserRole) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_user_role) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateUserRole(java.util.UUID,com.exoscale.sdk.model.UpdateUserRoleRequest))

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

## <span data-label="GET" class="pill-GET"></span>list-users

List Users

```
GET /user
```

null

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `users` | array of [User](/reference/api/_schemas/user/) |  |

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

```json
{
  "users": [
    {
      "email": "string",
      "id": "string",
      "pending": true,
      "role": {
        "assume-role-policy": {
          "rules": [
            null
          ]
        },
        "description": "string",
        "editable": true,
        "id": "string",
        "labels": {},
        "max-session-ttl": 0,
        "name": "string",
        "permissions": [
          "bypass-governance-retention"
        ],
        "policy": {
          "default-service-strategy": "allow",
          "services": {}
        }
      },
      "sso": true,
      "two-factor-authentication": true
    }
  ]
}
```
</details>


SDK reference for `list-users`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListUsers) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_users) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listUsers())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-users`


