> For the complete documentation index, see [llms.txt](https://docs.gmetri.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gmetri.com/metaverse/sdk/gmetri-sdk-apis/viewer-group.md).

# Viewer Group

<details>

<summary>Viewer Group Schema</summary>

* **id**: Unique id for every file
* **name**: name of the file
* **created\_at:** File creation timestamp

</details>

## Get All Viewer Group

<mark style="color:green;">`POST`</mark> `https://api.gmetri.com/sdk/viewer_group/getAll`

Get All viewer group of the organization

#### Headers

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Token \<apiToken> |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| orgSlug<mark style="color:red;">\*</mark> | String |             |

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

```javascript
{
    "status": {
        "success": true
    },
    "data": {
        "orgViewerGroups": [
            {
                "id": 7,
                "name": "Group (1)",
                "created_at": "2022-09-05T08:06:56.375671"
            },
            {
                "id": 8,
                "name": "SAML",
                "created_at": "2022-09-08T10:30:47.483744"
            }
        ],
        "globalViewerGroups": [
            {
                "id": 1,
                "name": "Social",
                "created_at": "2022-09-05T06:37:22.024655"
            },
            {
                "id": 3,
                "name": "Public",
                "created_at": "2022-09-05T06:37:22.024655"
            },
            {
                "id": 4,
                "name": "SCORM",
                "created_at": "2022-09-05T06:37:22.428923"
            },
            {
                "id": 5,
                "name": "Public with History (beta)",
                "created_at": "2022-09-05T06:37:22.592825"
            },
            {
                "id": 2,
                "name": "Editor",
                "created_at": "2022-09-05T06:37:22.024655"
            },
            {
                "id": 6,
                "name": "Load From Another Experience",
                "created_at": "2022-09-05T06:37:24.890609"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## Get Viewer Group

<mark style="color:green;">`POST`</mark> `https://api.gmetri.com/sdk/viewer_group/get`

Get viewer group of the organization by viewer group id

#### Headers

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Token \<apiToken> |

#### Request Body

| Name                                            | Type   | Description                           |
| ----------------------------------------------- | ------ | ------------------------------------- |
| orgSlug<mark style="color:red;">\*</mark>       | String |                                       |
| viewerGroupId<mark style="color:red;">\*</mark> | String | Unique identifier of the viewer group |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "status": {
        "success": true
    },
    "data": {
        "id": 3,
        "name": "Public",
        "created_at": "2022-09-05T06:37:22.024655"
    }
} 
```

{% endtab %}

{% tab title="200: OK No Viewer Group Found" %}

```javascript
{
    "status": {
        "success": false,
        "errorMessage": "No viewer group found"
    }
} 
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gmetri.com/metaverse/sdk/gmetri-sdk-apis/viewer-group.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
