# Cluster groups API

Source: https://frameleaf.app/docs/api/reference/cluster-groups/

Use your own server and its scoped API keys.

## Retrieve cluster group requests

GET /api/cluster-groups/requests

Retrieve the pending requests for the current user to join a cluster group.

```json
{
  "description": "Retrieve the pending requests for the current user to join a cluster group.",
  "operationId": "getClusterGroupRequests",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/ClusterGroupRequestResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve cluster group requests",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroupRequest.read"
}
```

## Decline a cluster group request

DELETE /api/cluster-groups/requests/{id}

Delete a pending request to join a cluster group.

```json
{
  "description": "Delete a pending request to join a cluster group.",
  "operationId": "deleteClusterGroupRequest",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Decline a cluster group request",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroupRequest.delete"
}
```

## Accept a cluster group request

POST /api/cluster-groups/requests/{id}/accept

Join the cluster group the request was created for.

```json
{
  "description": "Join the cluster group the request was created for.",
  "operationId": "acceptClusterGroupRequest",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Accept a cluster group request",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroupRequest.create"
}
```

## Leave a cluster group

POST /api/cluster-groups/{id}/leave

Move the current user into a new cluster group of their own.

```json
{
  "description": "Move the current user into a new cluster group of their own.",
  "operationId": "leaveClusterGroup",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Leave a cluster group",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroup.leave"
}
```

## Regenerate people of users in cluster group

POST /api/cluster-groups/{id}/regenerate-people

Forcefully re-run facial recognition for all faces of users in this group.

```json
{
  "description": "Forcefully re-run facial recognition for all faces of users in this group.",
  "operationId": "clusterGroupRegeneratePeople",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Regenerate people of users in cluster group",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroup.read"
}
```

## Retrieve the requests sent by a cluster group

GET /api/cluster-groups/{id}/requests

Retrieve the pending requests for other users to join the cluster group.

```json
{
  "description": "Retrieve the pending requests for other users to join the cluster group.",
  "operationId": "getClusterGroupRequestsForGroup",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/ClusterGroupRequestResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve the requests sent by a cluster group",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroupRequest.read"
}
```

## Create a cluster group request

PUT /api/cluster-groups/{id}/requests

Ask another user to join the cluster group of the current user.

```json
{
  "description": "Ask another user to join the cluster group of the current user.",
  "operationId": "createClusterGroupRequest",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ClusterGroupRequestCreateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ClusterGroupRequestResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Create a cluster group request",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroupRequest.create"
}
```

## Retrieve the users of a cluster group

GET /api/cluster-groups/{id}/users

Retrieve the users that are a member of the cluster group.

```json
{
  "description": "Retrieve the users that are a member of the cluster group.",
  "operationId": "getClusterGroupUsers",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/UserResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve the users of a cluster group",
  "tags": [
    "Cluster groups"
  ],
  "x-frameleaf-permission": "clusterGroup.read"
}
```
