> For the complete documentation index, see [llms.txt](https://dev.vulos.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.vulos.io/reference/organization-api/memberships/roles.md).

# Roles

## Role List

<mark style="color:blue;">`GET`</mark> `https://identity.vulos.io/api/v1/organization/:organizationId/:membershipId/role/list`

Get all of the roles in a specific membership.

#### Path Parameters

| Name                                             | Type   | Description                |
| ------------------------------------------------ | ------ | -------------------------- |
| organizationId<mark style="color:red;">\*</mark> | String | The ID of the organization |
| membershipId<mark style="color:red;">\*</mark>   | String | The ID of the membership   |

#### Headers

| Name                                            | Type   | Description                                                               |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer authentication with the access token obtained using OpenID Connect |

{% tabs %}
{% tab title="200: OK All of the roles that are in the membership" %}

```javascript
[
    { "name": "SuperAdmin", "id": "<guid>" }
]
```

{% endtab %}

{% tab title="400: Bad Request Error response" %}

```javascript
{
    "error": "Something went wrong",
    "code": "<errror code>",
    "request": "<request id>"
}
```

{% endtab %}

{% tab title="401: Unauthorized Empty body" %}

```javascript
```

{% endtab %}
{% endtabs %}

## Create Role

<mark style="color:orange;">`PUT`</mark> `https://identity.vulos.io/api/v1/organization/:organizationId/:membershipId/role/create`

Create a new role in a specific membership.

#### Path Parameters

| Name                                             | Type   | Description                |
| ------------------------------------------------ | ------ | -------------------------- |
| organizationId<mark style="color:red;">\*</mark> | String | The ID of the organization |
| membershipId<mark style="color:red;">\*</mark>   | String | The ID of the membership   |

#### Headers

| Name                                            | Type   | Description                                                               |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer authentication with the access token obtained using OpenID Connect |

#### Request Body

| Name                                   | Type   | Description          |
| -------------------------------------- | ------ | -------------------- |
| name<mark style="color:red;">\*</mark> | String | The name of the role |

{% tabs %}
{% tab title="200: OK The role that was created" %}

```javascript
{ "name": "SuperAdmin", "id": "<guid>" }
```

{% endtab %}

{% tab title="400: Bad Request Error response" %}

```javascript
{
    "error": "Something went wrong",
    "code": "<errror code>",
    "request": "<request id>"
}
```

{% endtab %}

{% tab title="403: Forbidden Empty body" %}

```javascript
```

{% endtab %}
{% endtabs %}

## Delete Role

<mark style="color:red;">`DELETE`</mark> `https://identity.vulos.io/api/v1/organization/:organizationId/:membershipId/role/:roleId/delete`

Delete a specific role.

#### Path Parameters

| Name                                             | Type   | Description                |
| ------------------------------------------------ | ------ | -------------------------- |
| organizationId<mark style="color:red;">\*</mark> | String | The ID of the organization |
| membershipId<mark style="color:red;">\*</mark>   | String | The ID of the membership   |
| roleId<mark style="color:red;">\*</mark>         | String | The ID of the role         |

#### Headers

| Name                                            | Type   | Description                                                               |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer authentication with the access token obtained using OpenID Connect |

{% tabs %}
{% tab title="200: OK Success message" %}

```javascript
{
     "success": true,
     "message": "A message describing the successful response"
}
```

{% endtab %}

{% tab title="400: Bad Request Error response" %}

```javascript
{
    "error": "Something went wrong",
    "code": "<errror code>",
    "request": "<request id>"
}
```

{% endtab %}

{% tab title="401: Unauthorized Empty body" %}

```javascript
```

{% endtab %}
{% endtabs %}
