Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
groups
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Groups.ListAsync(
            new ListGroupsRequestParameters {
                ConnectionId = "connection_id",
                Name = "name",
                ExternalId = "external_id",
                Search = "search",
                Fields = "fields",
                IncludeFields = true,
                From = "from",
                Take = 1
            }
        );
    }

}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.groups.requests.ListGroupsRequestParameters;

public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();

client.groups().list(
ListGroupsRequestParameters
.builder()
.connectionId("connection_id")
.name("name")
.externalId("external_id")
.search("search")
.fields("fields")
.includeFields(true)
.from("from")
.take(1)
.build()
);
}
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Groups\Requests\ListGroupsRequestParameters;

$client = new Management(
token: '<token>',
);
$client->groups->list(
new ListGroupsRequestParameters([
'connectionId' => 'connection_id',
'name' => 'name',
'externalId' => 'external_id',
'search' => 'search',
'fields' => 'fields',
'includeFields' => true,
'from' => 'from',
'take' => 1,
]),
);
from auth0.management import ManagementClient

client = ManagementClient(
token="<token>",
)

client.groups.list(
connection_id="connection_id",
name="name",
external_id="external_id",
search="search",
fields="fields",
include_fields=True,
from="from",
take=1,
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.groups.list(
connection_id: "connection_id",
name: "name",
external_id: "external_id",
search: "search",
fields: "fields",
include_fields: true,
from: "from",
take: 1
)
curl --request GET \
--url https://{tenantDomain}/api/v2/groups \
--header 'Authorization: Bearer <token>'
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{tenantDomain}/api/v2/groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

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

func main() {

url := "https://{tenantDomain}/api/v2/groups"

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

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
[
  {
    "id": "<string>",
    "name": "<string>",
    "external_id": "<string>",
    "connection_id": "<string>",
    "tenant_name": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
]

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de requête

connection_id
string

Filter groups by connection ID.

name
string

Filter groups by name.

Required string length: 1 - 128
external_id
string

Filter groups by external ID.

Maximum string length: 256

Search for groups by name or external ID.

Required string length: 1 - 256
fields
string

A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields

Maximum string length: 256
include_fields
boolean

Whether specified fields are to be included (true) or excluded (false).

page
integer

Page index of the results to return. First page is 0.

Plage requise: x >= 0
per_page
integer

Number of results per page. Defaults to 50.

Plage requise: 1 <= x <= 100
include_totals
boolean

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

from
string

Optional Id from which to start selection.

take
integer

Number of results per page. Defaults to 50.

Plage requise: 1 <= x <= 100

Réponse

Groups successfully retrieved.

Represents the metadata of a group. Member lists are retrieved via a separate endpoint.

id
string

Unique identifier for the group (service-generated).

Required string length: 18 - 26
Pattern: ^grp_[1-9a-km-zA-HJ-NP-Z]{14,22}$
name
string

Name of the group. Must be unique within its connection. Must contain between 1 and 128 printable ASCII characters.

Required string length: 1 - 128
Pattern: ^[\x20-\x7E]+$
external_id
string

External identifier for the group, often used for SCIM synchronization. Max length of 256 characters.

Maximum string length: 256
connection_id
string<connection-id>

Identifier for the connection this group belongs to (if a connection group).

tenant_name
string

Identifier for the tenant this group belongs to.

Minimum string length: 3
Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
created_at
string<date-time>

Timestamp of when the group was created.

updated_at
string<date-time>

Timestamp of when the group was last updated.