> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/001_user/007_groups/001__search_groups.md).

# Search Groups

GraphQL endpoint: `/user`

Search for groups. This returns only the groups the user can see, public groups or the groups the user is a member of.

## Query

```graphql
query (
  $name: String
  $limit: Int
  $metadata: JSON
) {
  groups (
    name: $name
    limit: $limit
    metadata: $metadata
  ) {
    id
    name
    metadata
    logo_url
    visibility
  }
}

```

## Variables

```json
{}
```

## Response

```json
{
  "data": {
    "groups": [
      {
        "id": "00000000-0000-4000-8000-000000000001",
        "logo_url": "logo_url",
        "metadata": {
          "test": "value"
        },
        "name": "test group",
        "visibility": [
          "PUBLIC"
        ]
      },
      {
        "id": "00000000-0000-4000-8000-000000000002",
        "logo_url": "logo_url",
        "metadata": {
          "test": "value"
        },
        "name": "test group",
        "visibility": [
          "PUBLIC"
        ]
      },
      {
        "id": "00000000-0000-4000-8000-000000000003",
        "logo_url": "logo_url",
        "metadata": {
          "test": "value"
        },
        "name": "test group",
        "visibility": [
          "PUBLIC"
        ]
      },
      {
        "id": "00000000-0000-4000-8000-000000000004",
        "logo_url": "logo_url",
        "metadata": {
          "test": "value"
        },
        "name": "test group",
        "visibility": [
          "PUBLIC"
        ]
      },
      {
        "id": "00000000-0000-4000-8000-000000000005",
        "logo_url": "logo_url",
        "metadata": {
          "test": "value"
        },
        "name": "test group",
        "visibility": [
          "PUBLIC"
        ]
      }
    ]
  }
}
```
