For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://help.moveworks.com/api-reference/content-gateway/content-gateway/llms.txt. For full documentation content, see https://help.moveworks.com/api-reference/content-gateway/content-gateway/llms-full.txt.

# List groups

GET https://content-gateway-example.com/v1/groups

Retrieve a paginated list of groups using OData parameters.

Reference: https://help.moveworks.com/api-reference/content-gateway/content-gateway/list-groups

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: content-gateway
  version: 1.0.0
paths:
  /groups:
    get:
      operationId: list-groups
      summary: List groups
      description: Retrieve a paginated list of groups using OData parameters.
      tags:
        - ''
      parameters:
        - name: $top
          in: query
          description: Number of items to return per page (default pagination)
          required: false
          schema:
            type: integer
        - name: $skip
          in: query
          description: Number of items to skip (default pagination offset)
          required: false
          schema:
            type: integer
        - name: $skiptoken
          in: query
          description: >-
            Used when the query parameters can be memoized into an encoded
            string containing filtering and pagination parameters. If the
            endpoint supports memoized paging, the first call can use $top and
            $skip, while @odata.nextLink will return with $skiptoken. If
            memoized querying is not supported, $top and $skip should be
            sufficient.
          required: false
          schema:
            type: string
        - name: $filter
          in: query
          required: false
          schema:
            type: string
        - name: $select
          in: query
          required: false
          schema:
            type: string
        - name: $orderby
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Group list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupCollection'
        '400':
          description: Bad Request - The request was invalid or cannot be served.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - The request requires user authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden - The server understood the request but refuses to
            authorize it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - The requested resource could not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: >-
            Internal Server Error - The server encountered an unexpected
            condition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            Service Unavailable - The server is currently unable to handle the
            request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
servers:
  - url: https://content-gateway-example.com/v1
components:
  schemas:
    GroupMetadata:
      type: object
      properties: {}
      description: Custom key-value metadata for the group.
      title: GroupMetadata
    Group:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the group.
        name:
          type: string
          description: Name of the group.
        created_datetime:
          type: string
          description: Timestamp when the group was created.
        last_modified_datetime:
          type: string
          description: Timestamp when the group was last updated.
        metadata:
          $ref: '#/components/schemas/GroupMetadata'
          description: Custom key-value metadata for the group.
      title: Group
    GroupCollection:
      type: object
      properties:
        '@odata.context':
          type: string
        value:
          type: array
          items:
            $ref: '#/components/schemas/Group'
        '@odata.nextLink':
          type: string
      title: GroupCollection
    ErrorResponseError:
      type: object
      properties:
        code:
          type: string
          description: >-
            Standard error code (e.g., UNAUTHORIZED, INVALID_ARGUMENT,
            NOT_FOUND).
        message:
          type: string
          description: Human-readable explanation of the error.
      required:
        - code
        - message
      title: ErrorResponseError
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorResponseError'
      required:
        - error
      title: ErrorResponse

```

## SDK Code Examples

```python
import requests

url = "https://content-gateway-example.com/v1/groups"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://content-gateway-example.com/v1/groups';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://content-gateway-example.com/v1/groups"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://content-gateway-example.com/v1/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://content-gateway-example.com/v1/groups")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://content-gateway-example.com/v1/groups');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://content-gateway-example.com/v1/groups");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/groups")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```