# Operator

## Get operators

<mark style="color:blue;">`GET`</mark> `https://app.blinger.io/api/operators/all`

This endpoint allows you to get operators.

#### Headers

| Name           | Type   | Description           |
| -------------- | ------ | --------------------- |
| Authentication | string | Authentication token. |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "status": 200,
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "owner_user_id": 1,
            "invite_email": "user1@gmail.com",
            "conversations_token": "5c763415ee6c7"
        },
        {
            "id": 2,
            "user_id": 3,
            "owner_user_id": 1,
            "invite_email": "al@blinger.io",
            "conversations_token": "5cf8c80657eec"
        }
    ]
}
```

{% endtab %}

{% tab title="401 Could not find a cake matching this query." %}

```javascript
{
    "error": "Empty token",
    "status": 401
}
```

{% endtab %}
{% endtabs %}

## Get groups

<mark style="color:blue;">`GET`</mark> `https://app.blinger.io/api/operators/groups`

#### Headers

| Name           | Type   | Description          |
| -------------- | ------ | -------------------- |
| Authentication | string | Authentication token |

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

```javascript
{
    "status": 200,
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "title": "Default",
            "priority": 1,
            "color": "#22539c",
            "is_default": true
        }
    ]
}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{
    "error": "Empty token",
    "status": 401
}
```

{% endtab %}
{% endtabs %}

## Create operator

<mark style="color:green;">`POST`</mark> `https://app.blinger.io/api/operators/create`

#### Path Parameters

| Name           | Type   | Description          |
| -------------- | ------ | -------------------- |
| Authentication | string | Authentication token |

#### Request Body

| Name               | Type   | Description |
| ------------------ | ------ | ----------- |
| operator\_email    | string |             |
| operator\_password | string |             |

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

```
{
    "status": 200,
    "data": {
        "invite_email": "bbb@bb.bb",
        "owner_user_id": 47,
        "id": 14758,
        "user_id": 14432
    }
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "error": {
        "invite_email": "Email \"bbb@bb.bb\" has already been taken."
    },
    "status": 400
}
```

{% endtab %}
{% endtabs %}

## Delete operator

<mark style="color:green;">`POST`</mark> `https://app.blinger.io/api/operators/delete`

#### Path Parameters

| Name           | Type   | Description          |
| -------------- | ------ | -------------------- |
| Authentication | string | Authentication token |

#### Request Body

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| operator\_id | integer |             |

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

```
{
    "status": 200,
    "data": {
        "success": true
    }
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "error": "Operator not found",
    "status": 400
}
```

{% endtab %}
{% endtabs %}
