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.UpdateAsync(
id: "id",
request: new UpdateSegmentRequestContent()
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.UpdateSegmentRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().segments().update(
"id",
UpdateSegmentRequestContent
.builder()
.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\UpdateSegmentRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->segments->update(
'id',
new UpdateSegmentRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.segments.update(
id="id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.segments.update(id: "id")
curl --request PATCH \
--url https://{tenantDomain}/api/v2/experimentation/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"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>"
]
}
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
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>']
}
}
]
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/segments/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rules\": [\n {\n \"match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n },\n \"not_match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"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>"
}Mettre à jour un segment.
Met partiellement à jour un segment par ID. Seuls les champs fournis sont mis à jour. L’envoi de rules remplace l’ensemble du tableau rules.
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.UpdateAsync(
id: "id",
request: new UpdateSegmentRequestContent()
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.UpdateSegmentRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().segments().update(
"id",
UpdateSegmentRequestContent
.builder()
.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\UpdateSegmentRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->segments->update(
'id',
new UpdateSegmentRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.segments.update(
id="id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.segments.update(id: "id")
curl --request PATCH \
--url https://{tenantDomain}/api/v2/experimentation/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"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>"
]
}
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
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>']
}
}
]
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/segments/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rules\": [\n {\n \"match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n },\n \"not_match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"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>"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
L’ID du segment à mettre à jour.
Corps
Mise à jour partielle d’un segment. Seuls les champs fournis sont mis à jour. L’envoi de rules remplace l’array rules au complet.
Nom du segment en clair
3 - 255^(?!.*\x00)\S(.*\S)?$Description du segment
3 - 1024^(?!.*\x00)\S(.*\S)?$Remplace l’ensemble du tableau de règles. Chaque règle est limitée à 4KB et l’ensemble du segment à 10KB (sérialisé).
1Show child attributes
Show child attributes
Statut cible du cycle de vie. L’archivage retire le segment de l’ensemble des segments actifs et est définitif (un segment archivé ne peut pas redevenir actif). Lorsque des modifications de champs sont également fournies, elles sont appliquées en premier, puis la transition est effectuée.
active, archived Réponse
Segment mis à jour avec succès.
^seg_[A-HJ-NP-Za-km-z1-9]+$self, auth0 active, archived Show child attributes
Show child attributes