# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.vulos.io/reference/organization-api/memberships/roles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
