# Permissions

## /permissions.get

<mark style="color:blue;">`GET`</mark> `https://admin-api.imid.infomaker.io/v1/permissions.get`

Get permission by id

#### Query Parameters

| Name         | Type   | Description   |
| ------------ | ------ | ------------- |
| permissionId | string | Permission id |

{% tabs %}
{% tab title="200 Successful" %}

```javascript
{
  "id": "Permission id",
  "serviceId": "dashboard",
  "name": "plugin/getAvailable",
  "description": "Description of speicific part xxx",
  "updatedBySub": "infomaker_b8b9373b-a30d-459d-a44d-f270afb5e581"
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```javascript
"errors.api.BadRequestError"
```

{% endtab %}

{% tab title="500 Internal Server Error" %}

```javascript
"errors.api.InternalServerError"
```

{% endtab %}
{% endtabs %}

## /permissions.list

<mark style="color:blue;">`GET`</mark> `https://admin-api.imid.infomaker.io/v1/permissions.list`

List permissions

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
|      | string |             |

{% tabs %}
{% tab title="200 Successful" %}

```javascript
[
  {
    "id": "Permission id",
    "serviceId": "dashboard",
    "name": "plugin/getAvailable",
    "description": "Description of speicific part xxx",
    "updatedBySub": "infomaker_b8b9373b-a30d-459d-a44d-f270afb5e581"
  }
]
```

{% endtab %}

{% tab title="400 Bad Request" %}

```javascript
"errors.api.BadRequestError"
```

{% endtab %}

{% tab title="500 Internal Server Error" %}

```javascript
"errors.api.InternalServerError"
```

{% endtab %}
{% endtabs %}

## /permissions.create

<mark style="color:green;">`POST`</mark> `https://admin-api.imid.infomaker.io/v1/permissions.create`

Create permission

#### Request Body

| Name        | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| serviceId   | string | Service id                        |
| name        | string | Service permission name           |
| description | string | Description of speicific part xxx |

{% tabs %}
{% tab title="200 Successful" %}

```javascript
{
  "id": "Permission id",
  "serviceId": "dashboard",
  "name": "plugin/getAvailable",
  "description": "Description of speicific part xxx",
  "updatedBySub": "infomaker_b8b9373b-a30d-459d-a44d-f270afb5e581"
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```javascript
"errors.api.BadRequestError"
```

{% endtab %}

{% tab title="500 Internal Server Error" %}

```javascript
"errors.api.InternalServerError"
```

{% endtab %}
{% endtabs %}

## /permissions.delete

<mark style="color:green;">`POST`</mark> `https://admin-api.imid.infomaker.io/v1/permissions.delete`

Delete permission by id

#### Request Body

| Name         | Type   | Description   |
| ------------ | ------ | ------------- |
| permissionId | string | Permission id |

{% tabs %}
{% tab title="200 Successful" %}

```javascript
{}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```javascript
"errors.api.BadRequestError"
```

{% endtab %}

{% tab title="500 Internal Server Error" %}

```javascript
"errors.api.InternalServerError"
```

{% endtab %}
{% endtabs %}

## /permissions.setDescription

<mark style="color:green;">`POST`</mark> `https://admin-api.imid.infomaker.io/v1/permissions.setDescription`

Set permission description by id

#### Request Body

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| permissionId | string | Permission id                     |
| description  | string | Description of speicific part xxx |

{% tabs %}
{% tab title="200 Successful" %}

```javascript
{
  "description": "Description of speicific part xxx"
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```javascript
"errors.api.BadRequestError"
```

{% endtab %}

{% tab title="500 Internal Server Error" %}

```javascript
"errors.api.InternalServerError"
```

{% endtab %}
{% endtabs %}

## /permissions.setName

<mark style="color:green;">`POST`</mark> `https://admin-api.imid.infomaker.io/v1/permissions.setName`

Set permission name by id

#### Request Body

| Name         | Type   | Description             |
| ------------ | ------ | ----------------------- |
| permissionId | string | Permission id           |
| name         | string | Service permission name |

{% tabs %}
{% tab title="200 Successful" %}

```javascript
{
  "name": "plugin/getAvailable"
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```javascript
"errors.api.BadRequestError"
```

{% endtab %}

{% tab title="500 Internal Server Error" %}

```javascript
"errors.api.InternalServerError"
```

{% endtab %}
{% endtabs %}
