# Create

## Create Role

<mark style="color:green;">`POST`</mark> `https://biometridon.polygon.pt/api/roles`

This endpoint allows you to create roles.

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Content-Type  | string | application/json          |
| Authorization | string | Authentication user token |

#### Request Body

| Name          | Type    | Description                |
| ------------- | ------- | -------------------------- |
| name          | string  | Unique name                |
| permissions   | array   | List of module permissions |
| clientId      | string  | Client id (Master User)    |
| forAllClients | boolean | Availability (Master User) |

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

```bash
{
  "data": {
    "name": "Admin1",
    "permissions": [
      {
        "resource": "users",
        "read": true,
        "write": true,
        "delete": true
      },
      {
        "resource": "processes",
        "read": true,
        "write": true,
        "delete": true
      },
      {
        "resource": "client_settings",
        "read": true,
        "write": true,
        "delete": true
      },
      {
        "resource": "queues",
        "read": true,
        "write": true,
        "delete": true
      },
      {
        "resource": "clients",
        "read": true,
        "write": true,
        "delete": true
      },
      {
        "resource": "roles",
        "read": true,
        "write": true,
        "delete": true
      },
      {
        "resource": "steps",
        "read": true,
        "write": true,
        "delete": true
      },
      {
        "resource": "flows",
        "read": true,
        "write": true,
        "delete": true
      }
    ],
    "clientId": "5f06dd360d2a954da80c098f",
    "active": true,
    "created_at": "2020-07-10T15:38:38.887Z",
    "updated_at": "2020-07-10T15:38:38.887Z",
    "id": "5f088b7eae1e08524034ec86"
  },
  "meta": {
    "message": "Role created with success."
  },
  "status": true
}
```

{% endtab %}
{% endtabs %}

```javascript
// Example

{
	"name": "Admin1",
	"permissions": [
		{
			"resource": "users",
			"read": true,
			"write": true,
			"delete": true
		},
		{
			"resource": "processes",
			"read": true,
			"write": true,
			"delete": true
		},
		{
      "resource": "client_settings",
      "read": true,
      "write": true,
      "delete": true
    },
		{
			"resource": "queues",
			"read": true,
			"write": true,
			"delete": true
		},
		{
			"resource": "clients",
			"read": true,
			"write": true,
			"delete": true
		},
		{
			"resource": "roles",
			"read": true,
			"write": true,
			"delete": true
		},
		{
			"resource": "steps",
			"read": true,
			"write": true,
			"delete": true
		},
		{
			"resource": "flows",
			"read": true,
			"write": true,
			"delete": true
		}
	]
}
```
