TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.segments.list({
from: "from",
take: 1,
type: "auth0",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.segments.list({
from: "from",
take: 1,
type: "auth0",
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.ListSegmentsRequestParameters{
From: management.String(
"from",
),
Take: management.Int(
1,
),
Type: management.SegmentTypeFilterEnumAuth0.Ptr(),
}
mgmt.Experimentation.Segments.List(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "experimentation/segments" --query "from=from" --query "take=1" --query "type=auth0"using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.Segments.ListAsync(
new ListSegmentsRequestParameters {
From = "from",
Take = 1,
Type = SegmentTypeFilterEnum.Auth0
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.ListSegmentsRequestParameters;
import com.auth0.client.mgmt.types.SegmentTypeFilterEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().segments().list(
ListSegmentsRequestParameters
.builder()
.from("from")
.take(1)
.type(SegmentTypeFilterEnum.AUTH0)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Segments\Requests\ListSegmentsRequestParameters;
use Auth0\SDK\API\Management\Types\SegmentTypeFilterEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->segments->list(
new ListSegmentsRequestParameters([
'from' => 'from',
'take' => 1,
'type' => SegmentTypeFilterEnum::Auth0->value,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.segments.list(
from_="from",
take=1,
type="auth0",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.segments.list(
from: "from",
take: 1,
type: "auth0"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/experimentation/segments \
--header 'Authorization: Bearer <token>'{
"segments": [
{
"id": "<string>",
"name": "<string>",
"type": "self",
"status": "active",
"rules": [
{
"match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
},
"not_match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}
],
"next": "<string>"
}List segments for the tenant.
Retrieve a paginated list of segments for the tenant.
GET
https://{tenantDomain}/api/v2
/
experimentation
/
segments
TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.segments.list({
from: "from",
take: 1,
type: "auth0",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.experimentation.segments.list({
from: "from",
take: 1,
type: "auth0",
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.ListSegmentsRequestParameters{
From: management.String(
"from",
),
Take: management.Int(
1,
),
Type: management.SegmentTypeFilterEnumAuth0.Ptr(),
}
mgmt.Experimentation.Segments.List(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "experimentation/segments" --query "from=from" --query "take=1" --query "type=auth0"using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.Segments.ListAsync(
new ListSegmentsRequestParameters {
From = "from",
Take = 1,
Type = SegmentTypeFilterEnum.Auth0
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.ListSegmentsRequestParameters;
import com.auth0.client.mgmt.types.SegmentTypeFilterEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().segments().list(
ListSegmentsRequestParameters
.builder()
.from("from")
.take(1)
.type(SegmentTypeFilterEnum.AUTH0)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Segments\Requests\ListSegmentsRequestParameters;
use Auth0\SDK\API\Management\Types\SegmentTypeFilterEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->segments->list(
new ListSegmentsRequestParameters([
'from' => 'from',
'take' => 1,
'type' => SegmentTypeFilterEnum::Auth0->value,
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.segments.list(
from_="from",
take=1,
type="auth0",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.segments.list(
from: "from",
take: 1,
type: "auth0"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/experimentation/segments \
--header 'Authorization: Bearer <token>'{
"segments": [
{
"id": "<string>",
"name": "<string>",
"type": "self",
"status": "active",
"rules": [
{
"match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
},
"not_match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}
],
"next": "<string>"
}Authorizations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Optional Id from which to start selection.
Number of segments to return per page. Defaults to 25, maximum 50.
Required range:
1 <= x <= 50Filter by type. Exact match.
Available options:
auth0, self